On 25/12/24 12:53, Vijendar Mukunda wrote: > Add SoundWire support for ACP7.0 and ACP7.1 platforms. > > Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@xxxxxxx> > --- > drivers/soundwire/amd_manager.c | 23 +++++++++++++++++++++++ > drivers/soundwire/amd_manager.h | 18 ++++++++++++++++++ > include/linux/soundwire/sdw_amd.h | 2 ++ > 3 files changed, 43 insertions(+) > > diff --git a/drivers/soundwire/amd_manager.c b/drivers/soundwire/amd_manager.c > index 60be5805715e..9eb8d345b527 100644 > --- a/drivers/soundwire/amd_manager.c > +++ b/drivers/soundwire/amd_manager.c > @@ -446,6 +446,10 @@ static int amd_sdw_port_params(struct sdw_bus *bus, struct sdw_port_params *p_pa > return -EINVAL; > } > break; > + case ACP70_PCI_REV_ID: > + case ACP71_PCI_REV_ID: > + frame_fmt_reg = acp70_sdw_dp_reg[p_params->num].frame_fmt_reg; > + break; > default: > return -EINVAL; > } > @@ -494,6 +498,14 @@ static int amd_sdw_transport_params(struct sdw_bus *bus, > return -EINVAL; > } > break; > + case ACP70_PCI_REV_ID: > + case ACP71_PCI_REV_ID: > + frame_fmt_reg = acp70_sdw_dp_reg[params->port_num].frame_fmt_reg; > + sample_int_reg = acp70_sdw_dp_reg[params->port_num].sample_int_reg; > + hctrl_dp0_reg = acp70_sdw_dp_reg[params->port_num].hctrl_dp0_reg; > + offset_reg = acp70_sdw_dp_reg[params->port_num].offset_reg; > + lane_ctrl_ch_en_reg = acp70_sdw_dp_reg[params->port_num].lane_ctrl_ch_en_reg; > + break; > default: > return -EINVAL; > } > @@ -549,6 +561,10 @@ static int amd_sdw_port_enable(struct sdw_bus *bus, > return -EINVAL; > } > break; > + case ACP70_PCI_REV_ID: > + case ACP71_PCI_REV_ID: > + lane_ctrl_ch_en_reg = acp70_sdw_dp_reg[enable_ch->port_num].lane_ctrl_ch_en_reg; > + break; > default: > return -EINVAL; > } > @@ -895,6 +911,7 @@ int amd_sdw_manager_start(struct amd_sdw_manager *amd_manager) > ret = amd_enable_sdw_manager(amd_manager); > if (ret) > return ret; > + > amd_sdw_set_frameshape(amd_manager); > } > /* Enable runtime PM */ > @@ -966,6 +983,11 @@ static int amd_sdw_manager_probe(struct platform_device *pdev) > return -EINVAL; > } > break; > + case ACP70_PCI_REV_ID: > + case ACP71_PCI_REV_ID: > + amd_manager->num_dout_ports = AMD_ACP70_SDW_MAX_TX_PORTS; > + amd_manager->num_din_ports = AMD_ACP70_SDW_MAX_RX_PORTS; > + break; > default: > return -EINVAL; > } > @@ -1172,6 +1194,7 @@ static int __maybe_unused amd_suspend_runtime(struct device *dev) > ret = amd_sdw_clock_stop(amd_manager); > if (ret) > return ret; > + Extra white line is added. Will fix it in V2 version. > return amd_deinit_sdw_manager(amd_manager); > } > return 0; > diff --git a/drivers/soundwire/amd_manager.h b/drivers/soundwire/amd_manager.h > index cc2170e4521e..30244a31c21c 100644 > --- a/drivers/soundwire/amd_manager.h > +++ b/drivers/soundwire/amd_manager.h > @@ -159,8 +159,11 @@ > #define AMD_ACP63_SDW0_MAX_RX_PORTS 3 > #define AMD_ACP63_SDW1_MAX_TX_PORTS 1 > #define AMD_ACP63_SDW1_MAX_RX_PORTS 1 > +#define AMD_ACP70_SDW_MAX_TX_PORTS 3 > +#define AMD_ACP70_SDW_MAX_RX_PORTS 3 > #define AMD_ACP63_SDW0_MAX_DAI 6 > #define AMD_ACP63_SDW1_MAX_DAI 2 > +#define AMD_ACP70_SDW_MAX_DAI 6 > #define AMD_SDW_SLAVE_0_ATTACHED 5 > #define AMD_SDW_SSP_COUNTER_VAL 3 > > @@ -244,6 +247,21 @@ static struct sdw_manager_dp_reg acp63_sdw1_dp_reg[AMD_ACP63_SDW1_MAX_DAI] = { > ACP_SW_AUDIO1_RX_OFFSET, ACP_SW_AUDIO1_RX_CHANNEL_ENABLE_DP0} > }; > > +static struct sdw_manager_dp_reg acp70_sdw_dp_reg[AMD_ACP70_SDW_MAX_DAI] = { > + {ACP_SW_AUDIO0_TX_FRAME_FORMAT, ACP_SW_AUDIO0_TX_SAMPLEINTERVAL, ACP_SW_AUDIO0_TX_HCTRL_DP0, > + ACP_SW_AUDIO0_TX_OFFSET_DP0, ACP_SW_AUDIO0_TX_CHANNEL_ENABLE_DP0}, > + {ACP_SW_AUDIO1_TX_FRAME_FORMAT, ACP_SW_AUDIO1_TX_SAMPLEINTERVAL, ACP_SW_AUDIO1_TX_HCTRL, > + ACP_SW_AUDIO1_TX_OFFSET, ACP_SW_AUDIO1_TX_CHANNEL_ENABLE_DP0}, > + {ACP_SW_AUDIO2_TX_FRAME_FORMAT, ACP_SW_AUDIO2_TX_SAMPLEINTERVAL, ACP_SW_AUDIO2_TX_HCTRL, > + ACP_SW_AUDIO2_TX_OFFSET, ACP_SW_AUDIO2_TX_CHANNEL_ENABLE_DP0}, > + {ACP_SW_AUDIO0_RX_FRAME_FORMAT, ACP_SW_AUDIO0_RX_SAMPLEINTERVAL, ACP_SW_AUDIO0_RX_HCTRL_DP0, > + ACP_SW_AUDIO0_RX_OFFSET_DP0, ACP_SW_AUDIO0_RX_CHANNEL_ENABLE_DP0}, > + {ACP_SW_AUDIO1_RX_FRAME_FORMAT, ACP_SW_AUDIO1_RX_SAMPLEINTERVAL, ACP_SW_AUDIO1_RX_HCTRL, > + ACP_SW_AUDIO1_RX_OFFSET, ACP_SW_AUDIO1_RX_CHANNEL_ENABLE_DP0}, > + {ACP_SW_AUDIO2_RX_FRAME_FORMAT, ACP_SW_AUDIO2_RX_SAMPLEINTERVAL, ACP_SW_AUDIO2_RX_HCTRL, > + ACP_SW_AUDIO2_RX_OFFSET, ACP_SW_AUDIO2_RX_CHANNEL_ENABLE_DP0}, > +}; > + > static u32 sdw_manager_reg_mask_array[AMD_SDW_MAX_MANAGER_COUNT] = { > AMD_SDW0_EXT_INTR_MASK, > AMD_SDW1_EXT_INTR_MASK > diff --git a/include/linux/soundwire/sdw_amd.h b/include/linux/soundwire/sdw_amd.h > index 799f8578137b..6b839987f14c 100644 > --- a/include/linux/soundwire/sdw_amd.h > +++ b/include/linux/soundwire/sdw_amd.h > @@ -28,6 +28,8 @@ > #define ACP_SDW1 1 > #define AMD_SDW_MAX_MANAGER_COUNT 2 > #define ACP63_PCI_REV_ID 0x63 > +#define ACP70_PCI_REV_ID 0x70 > +#define ACP71_PCI_REV_ID 0x71 > > struct acp_sdw_pdata { > u16 instance;