Skip to content

Commit ced20ea

Browse files
vijendarmukundavinodkoul
authored andcommitted
soundwire: amd: pass acp pci revision id as resource data
Pass ACP pci revision id as resource data and store it in amd SoundWire manager private data structure. This field will be used to differentiate ACP variants. Signed-off-by: Vijendar Mukunda <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 9852d85 commit ced20ea

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

drivers/soundwire/amd_init.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ static struct sdw_amd_ctx *sdw_amd_probe_controller(struct sdw_amd_res *res)
121121

122122
sdw_pdata[index].instance = index;
123123
sdw_pdata[index].acp_sdw_lock = res->acp_lock;
124+
sdw_pdata[index].acp_rev = res->acp_rev;
124125
pdevinfo[index].name = "amd_sdw_manager";
125126
pdevinfo[index].id = index;
126127
pdevinfo[index].parent = res->parent;

drivers/soundwire/amd_manager.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -910,6 +910,7 @@ static int amd_sdw_manager_probe(struct platform_device *pdev)
910910
amd_manager->mmio = amd_manager->acp_mmio +
911911
(amd_manager->instance * SDW_MANAGER_REG_OFFSET);
912912
amd_manager->acp_sdw_lock = pdata->acp_sdw_lock;
913+
amd_manager->acp_rev = pdata->acp_rev;
913914
amd_manager->cols_index = sdw_find_col_index(AMD_SDW_DEFAULT_COLUMNS);
914915
amd_manager->rows_index = sdw_find_row_index(AMD_SDW_DEFAULT_ROWS);
915916
amd_manager->dev = dev;

include/linux/soundwire/sdw_amd.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
struct acp_sdw_pdata {
3232
u16 instance;
33+
u32 acp_rev;
3334
/* mutex to protect acp common register access */
3435
struct mutex *acp_sdw_lock;
3536
};
@@ -66,6 +67,7 @@ struct sdw_amd_dai_runtime {
6667
* @instance: SoundWire manager instance
6768
* @quirks: SoundWire manager quirks
6869
* @wake_en_mask: wake enable mask per SoundWire manager
70+
* @acp_rev: acp pci device revision id
6971
* @clk_stopped: flag set to true when clock is stopped
7072
* @power_mode_mask: flag interprets amd SoundWire manager power mode
7173
* @dai_runtime_array: dai runtime array
@@ -94,6 +96,7 @@ struct amd_sdw_manager {
9496
u32 quirks;
9597
u32 wake_en_mask;
9698
u32 power_mode_mask;
99+
u32 acp_rev;
97100
bool clk_stopped;
98101

99102
struct sdw_amd_dai_runtime **dai_runtime_array;
@@ -134,6 +137,7 @@ struct sdw_amd_ctx {
134137
* struct sdw_amd_res - Soundwire AMD global resource structure,
135138
* typically populated by the DSP driver/Legacy driver
136139
*
140+
* @acp_rev: acp pci device revision id
137141
* @addr: acp pci device resource start address
138142
* @reg_range: ACP register range
139143
* @link_mask: bit-wise mask listing links selected by the DSP driver/
@@ -146,6 +150,7 @@ struct sdw_amd_ctx {
146150
* @acp_lock: mutex protecting acp common registers access
147151
*/
148152
struct sdw_amd_res {
153+
u32 acp_rev;
149154
u32 addr;
150155
u32 reg_range;
151156
u32 link_mask;

0 commit comments

Comments
 (0)