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 <zhengxing@rock-chips.com> Change-Id: I142091151f94cc62b4b22f4079d3ab03f9dce57f
This commit is contained in:
@@ -380,9 +380,9 @@ static int rk_dsm_hw_params(struct snd_pcm_substream *substream,
|
||||
snd_soc_component_get_drvdata(dai->component);
|
||||
unsigned int srt = 0, val = 0;
|
||||
|
||||
rk_dsm_set_clk(rd, substream, params_rate(params));
|
||||
|
||||
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
|
||||
rk_dsm_set_clk(rd, substream, params_rate(params));
|
||||
|
||||
switch (params_rate(params)) {
|
||||
case 8000:
|
||||
case 11025:
|
||||
@@ -460,6 +460,9 @@ static int rk_dsm_pcm_startup(struct snd_pcm_substream *substream,
|
||||
struct rk_dsm_priv *rd =
|
||||
snd_soc_component_get_drvdata(dai->component);
|
||||
|
||||
if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
|
||||
return 0;
|
||||
|
||||
/* Recover DAC Volumes */
|
||||
regmap_write(rd->regmap, DACVOLL0, rd->vols.vol_l);
|
||||
regmap_write(rd->regmap, DACVOLR0, rd->vols.vol_r);
|
||||
@@ -489,6 +492,9 @@ static void rk_dsm_pcm_shutdown(struct snd_pcm_substream *substream,
|
||||
struct rk_dsm_priv *rd =
|
||||
snd_soc_component_get_drvdata(dai->component);
|
||||
|
||||
if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
|
||||
return;
|
||||
|
||||
gpiod_set_value(rd->pa_ctl, 0);
|
||||
|
||||
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
|
||||
@@ -519,6 +525,9 @@ static int rk_dsm_pcm_trigger(struct snd_pcm_substream *substream,
|
||||
struct rk_dsm_priv *rd =
|
||||
snd_soc_component_get_drvdata(dai->component);
|
||||
|
||||
if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
|
||||
return 0;
|
||||
|
||||
switch (cmd) {
|
||||
case SNDRV_PCM_TRIGGER_START:
|
||||
case SNDRV_PCM_TRIGGER_RESUME:
|
||||
|
||||
Reference in New Issue
Block a user