mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
ASoC: codecs: rk_dsm: Fix the silence during recover from XRUN
Here we need to restore the volume and ioswitch status. Otherwise, there will be no sound if you restore from the xrun state. Signed-off-by: Xing Zheng <zhengxing@rock-chips.com> Change-Id: I96e4bbcde035a700e2e18ee8782d75cdac2b18be
This commit is contained in:
@@ -520,6 +520,19 @@ static int rk_dsm_pcm_trigger(struct snd_pcm_substream *substream,
|
||||
snd_soc_component_get_drvdata(dai->component);
|
||||
|
||||
switch (cmd) {
|
||||
case SNDRV_PCM_TRIGGER_START:
|
||||
case SNDRV_PCM_TRIGGER_RESUME:
|
||||
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
|
||||
/**
|
||||
* NOTE: Recover DAC volumes and switch RKDSM_ON_FUNC after hw_param()
|
||||
* again, avoid to incorrect silence during recover from XRUN.
|
||||
*/
|
||||
regmap_write(rd->regmap, DACVOLL0, rd->vols.vol_l);
|
||||
regmap_write(rd->regmap, DACVOLR0, rd->vols.vol_r);
|
||||
regmap_write(rd->regmap, DACVOGP, rd->vols.polarity);
|
||||
if (rd->data && rd->data->iomux_switch)
|
||||
rd->data->iomux_switch(rd->dev, RKDSM_ON_FUNC);
|
||||
break;
|
||||
case SNDRV_PCM_TRIGGER_SUSPEND:
|
||||
case SNDRV_PCM_TRIGGER_STOP:
|
||||
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
|
||||
|
||||
Reference in New Issue
Block a user