Skip to content

Commit a2be2f0

Browse files
acgzxrkhuangtao
authored andcommitted
ASoC: codecs: rk_dsm: Fixed the configuration in multi codec sound was modified by capture stream
Also, the setting of rk_dsm_set_clk() is only in the playback stream. Signed-off-by: Xing Zheng <[email protected]> Change-Id: I142091151f94cc62b4b22f4079d3ab03f9dce57f
1 parent 36d47d4 commit a2be2f0

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

sound/soc/codecs/rk_dsm.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,9 +380,9 @@ static int rk_dsm_hw_params(struct snd_pcm_substream *substream,
380380
snd_soc_component_get_drvdata(dai->component);
381381
unsigned int srt = 0, val = 0;
382382

383-
rk_dsm_set_clk(rd, substream, params_rate(params));
384-
385383
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
384+
rk_dsm_set_clk(rd, substream, params_rate(params));
385+
386386
switch (params_rate(params)) {
387387
case 8000:
388388
case 11025:
@@ -460,6 +460,9 @@ static int rk_dsm_pcm_startup(struct snd_pcm_substream *substream,
460460
struct rk_dsm_priv *rd =
461461
snd_soc_component_get_drvdata(dai->component);
462462

463+
if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
464+
return 0;
465+
463466
/* Recover DAC Volumes */
464467
regmap_write(rd->regmap, DACVOLL0, rd->vols.vol_l);
465468
regmap_write(rd->regmap, DACVOLR0, rd->vols.vol_r);
@@ -489,6 +492,9 @@ static void rk_dsm_pcm_shutdown(struct snd_pcm_substream *substream,
489492
struct rk_dsm_priv *rd =
490493
snd_soc_component_get_drvdata(dai->component);
491494

495+
if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
496+
return;
497+
492498
gpiod_set_value(rd->pa_ctl, 0);
493499

494500
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
@@ -519,6 +525,9 @@ static int rk_dsm_pcm_trigger(struct snd_pcm_substream *substream,
519525
struct rk_dsm_priv *rd =
520526
snd_soc_component_get_drvdata(dai->component);
521527

528+
if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
529+
return 0;
530+
522531
switch (cmd) {
523532
case SNDRV_PCM_TRIGGER_START:
524533
case SNDRV_PCM_TRIGGER_RESUME:

0 commit comments

Comments
 (0)