Skip to content

Commit 5f55c96

Browse files
Srinivas-Kandagatlabroonie
authored andcommitted
ASoC: qcom: sdm845: only setup slim ports once
Currently same slim channel map setup for every dai link, which is redundant. Fix this by adding a flag and conditionally setting these channel maps. Signed-off-by: Srinivas Kandagatla <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 5ecc573 commit 5f55c96

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

sound/soc/qcom/sdm845.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
struct sdm845_snd_data {
3434
struct snd_soc_jack jack;
3535
bool jack_setup;
36+
bool slim_port_setup;
3637
bool stream_prepared[AFE_PORT_MAX];
3738
struct snd_soc_card *card;
3839
uint32_t pri_mi2s_clk_count;
@@ -224,6 +225,7 @@ static int sdm845_dai_init(struct snd_soc_pcm_runtime *rtd)
224225
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
225226
struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
226227
struct sdm845_snd_data *pdata = snd_soc_card_get_drvdata(card);
228+
struct snd_soc_dai_link *link = rtd->dai_link;
227229
struct snd_jack *jack;
228230
/*
229231
* Codec SLIMBUS configuration
@@ -276,6 +278,10 @@ static int sdm845_dai_init(struct snd_soc_pcm_runtime *rtd)
276278
}
277279
break;
278280
case SLIMBUS_0_RX...SLIMBUS_6_TX:
281+
/* setting up wcd multiple times for slim port is redundant */
282+
if (pdata->slim_port_setup || !link->no_pcm)
283+
return 0;
284+
279285
for_each_rtd_codec_dais(rtd, i, codec_dai) {
280286
rval = snd_soc_dai_set_channel_map(codec_dai,
281287
ARRAY_SIZE(tx_ch),
@@ -295,8 +301,10 @@ static int sdm845_dai_init(struct snd_soc_pcm_runtime *rtd)
295301
dev_warn(card->dev, "Failed to set jack: %d\n", rval);
296302
return rval;
297303
}
298-
299304
}
305+
306+
pdata->slim_port_setup = true;
307+
300308
break;
301309
default:
302310
break;

0 commit comments

Comments
 (0)