]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
soundwire: amd: pass acp pci revision id as resource data
authorVijendar Mukunda <Vijendar.Mukunda@amd.com>
Tue, 24 Sep 2024 08:18:43 +0000 (13:48 +0530)
committerVinod Koul <vkoul@kernel.org>
Thu, 3 Oct 2024 07:14:41 +0000 (12:44 +0530)
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 <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20240924081846.1834612-2-Vijendar.Mukunda@amd.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/soundwire/amd_init.c
drivers/soundwire/amd_manager.c
include/linux/soundwire/sdw_amd.h

index db040f435059945b7564d63a20c10b42132efdd2..4f6e356e6bd246ef397ab0d9de38c6fc71269211 100644 (file)
@@ -121,6 +121,7 @@ static struct sdw_amd_ctx *sdw_amd_probe_controller(struct sdw_amd_res *res)
 
                sdw_pdata[index].instance = index;
                sdw_pdata[index].acp_sdw_lock = res->acp_lock;
+               sdw_pdata[index].acp_rev = res->acp_rev;
                pdevinfo[index].name = "amd_sdw_manager";
                pdevinfo[index].id = index;
                pdevinfo[index].parent = res->parent;
index 0d01849c358619d9c45acf9ceca0edd619d728c6..4a1966fb01f6b5e14c56c8d7ed230ab528579630 100644 (file)
@@ -910,6 +910,7 @@ static int amd_sdw_manager_probe(struct platform_device *pdev)
        amd_manager->mmio = amd_manager->acp_mmio +
                            (amd_manager->instance * SDW_MANAGER_REG_OFFSET);
        amd_manager->acp_sdw_lock = pdata->acp_sdw_lock;
+       amd_manager->acp_rev = pdata->acp_rev;
        amd_manager->cols_index = sdw_find_col_index(AMD_SDW_DEFAULT_COLUMNS);
        amd_manager->rows_index = sdw_find_row_index(AMD_SDW_DEFAULT_ROWS);
        amd_manager->dev = dev;
index 28a4eb77717f987c1a389ff722632ed719e63f97..e0abc59d4748b9d687c1095d689569d1c93e99df 100644 (file)
@@ -30,6 +30,7 @@
 
 struct acp_sdw_pdata {
        u16 instance;
+       u32 acp_rev;
        /* mutex to protect acp common register access */
        struct mutex *acp_sdw_lock;
 };
@@ -66,6 +67,7 @@ struct sdw_amd_dai_runtime {
  * @instance: SoundWire manager instance
  * @quirks: SoundWire manager quirks
  * @wake_en_mask: wake enable mask per SoundWire manager
+ * @acp_rev: acp pci device revision id
  * @clk_stopped: flag set to true when clock is stopped
  * @power_mode_mask: flag interprets amd SoundWire manager power mode
  * @dai_runtime_array: dai runtime array
@@ -94,6 +96,7 @@ struct amd_sdw_manager {
        u32 quirks;
        u32 wake_en_mask;
        u32 power_mode_mask;
+       u32 acp_rev;
        bool clk_stopped;
 
        struct sdw_amd_dai_runtime **dai_runtime_array;
@@ -134,6 +137,7 @@ struct sdw_amd_ctx {
  * struct sdw_amd_res - Soundwire AMD global resource structure,
  * typically populated by the DSP driver/Legacy driver
  *
+ * @acp_rev: acp pci device revision id
  * @addr: acp pci device resource start address
  * @reg_range: ACP register range
  * @link_mask: bit-wise mask listing links selected by the DSP driver/
@@ -146,6 +150,7 @@ struct sdw_amd_ctx {
  * @acp_lock: mutex protecting acp common registers access
  */
 struct sdw_amd_res {
+       u32 acp_rev;
        u32 addr;
        u32 reg_range;
        u32 link_mask;