mirror of
https://github.com/torvalds/linux.git
synced 2026-07-31 19:47:08 +02:00
ASoC: amd: acp: simplify platform conditional checks code
Simplify code with switch statements for platform conditional checks. Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com> Link: https://patch.msgid.link/20240924061821.1127054-2-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
46f2dd5ce5
commit
839a8b18db
|
|
@ -1647,16 +1647,21 @@ int acp_legacy_dai_links_create(struct snd_soc_card *card)
|
|||
links[i].id = HEADSET_BE_ID;
|
||||
links[i].cpus = i2s_hs;
|
||||
links[i].num_cpus = ARRAY_SIZE(i2s_hs);
|
||||
if (drv_data->platform == REMBRANDT) {
|
||||
switch (drv_data->platform) {
|
||||
case REMBRANDT:
|
||||
links[i].platforms = platform_rmb_component;
|
||||
links[i].num_platforms = ARRAY_SIZE(platform_rmb_component);
|
||||
} else if (drv_data->platform == ACP63) {
|
||||
break;
|
||||
case ACP63:
|
||||
links[i].platforms = platform_acp63_component;
|
||||
links[i].num_platforms = ARRAY_SIZE(platform_acp63_component);
|
||||
} else {
|
||||
break;
|
||||
default:
|
||||
links[i].platforms = platform_component;
|
||||
links[i].num_platforms = ARRAY_SIZE(platform_component);
|
||||
break;
|
||||
}
|
||||
|
||||
links[i].dpcm_playback = 1;
|
||||
links[i].dpcm_capture = 1;
|
||||
if (!drv_data->hs_codec_id) {
|
||||
|
|
@ -1714,16 +1719,21 @@ int acp_legacy_dai_links_create(struct snd_soc_card *card)
|
|||
links[i].id = AMP_BE_ID;
|
||||
links[i].cpus = i2s_hs;
|
||||
links[i].num_cpus = ARRAY_SIZE(i2s_hs);
|
||||
if (drv_data->platform == REMBRANDT) {
|
||||
switch (drv_data->platform) {
|
||||
case REMBRANDT:
|
||||
links[i].platforms = platform_rmb_component;
|
||||
links[i].num_platforms = ARRAY_SIZE(platform_rmb_component);
|
||||
} else if (drv_data->platform == ACP63) {
|
||||
break;
|
||||
case ACP63:
|
||||
links[i].platforms = platform_acp63_component;
|
||||
links[i].num_platforms = ARRAY_SIZE(platform_acp63_component);
|
||||
} else {
|
||||
break;
|
||||
default:
|
||||
links[i].platforms = platform_component;
|
||||
links[i].num_platforms = ARRAY_SIZE(platform_component);
|
||||
break;
|
||||
}
|
||||
|
||||
links[i].dpcm_playback = 1;
|
||||
if (!drv_data->amp_codec_id) {
|
||||
/* Use dummy codec if codec id not specified */
|
||||
|
|
@ -1760,18 +1770,24 @@ int acp_legacy_dai_links_create(struct snd_soc_card *card)
|
|||
}
|
||||
links[i].cpus = pdm_dmic;
|
||||
links[i].num_cpus = ARRAY_SIZE(pdm_dmic);
|
||||
if (drv_data->platform == REMBRANDT) {
|
||||
switch (drv_data->platform) {
|
||||
case REMBRANDT:
|
||||
links[i].platforms = platform_rmb_component;
|
||||
links[i].num_platforms = ARRAY_SIZE(platform_rmb_component);
|
||||
} else if (drv_data->platform == ACP63) {
|
||||
break;
|
||||
case ACP63:
|
||||
links[i].platforms = platform_acp63_component;
|
||||
links[i].num_platforms = ARRAY_SIZE(platform_acp63_component);
|
||||
} else if ((drv_data->platform == ACP70) || (drv_data->platform == ACP71)) {
|
||||
break;
|
||||
case ACP70:
|
||||
case ACP71:
|
||||
links[i].platforms = platform_acp70_component;
|
||||
links[i].num_platforms = ARRAY_SIZE(platform_acp70_component);
|
||||
} else {
|
||||
break;
|
||||
default:
|
||||
links[i].platforms = platform_component;
|
||||
links[i].num_platforms = ARRAY_SIZE(platform_component);
|
||||
break;
|
||||
}
|
||||
links[i].ops = &acp_card_dmic_ops;
|
||||
links[i].dpcm_capture = 1;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user