mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
ASoC: rockchip: pdm: set pin as pdm function when record
Otherwise a pulse occur when the pdm resume and suspend. Change-Id: If5d4d6f3212ce10a647948b72ab171c8740821d9 Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
This commit is contained in:
@@ -110,6 +110,8 @@ static const struct pdm_of_quirks {
|
||||
},
|
||||
};
|
||||
|
||||
static int rockchip_pdm_pinctrl_select_clk_state(struct device *dev);
|
||||
|
||||
static unsigned int get_pdm_clk(struct rk_pdm_dev *pdm, unsigned int sr,
|
||||
unsigned int *clk_src, unsigned int *clk_out,
|
||||
unsigned int signoff)
|
||||
@@ -489,6 +491,9 @@ static int rockchip_pdm_trigger(struct snd_pcm_substream *substream, int cmd,
|
||||
case SNDRV_PCM_TRIGGER_START:
|
||||
case SNDRV_PCM_TRIGGER_RESUME:
|
||||
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
|
||||
if (!(pdm->quirks & QUIRK_ALWAYS_ON))
|
||||
rockchip_pdm_pinctrl_select_clk_state(pdm->dev);
|
||||
|
||||
if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
|
||||
rockchip_pdm_rxctrl(pdm, 1);
|
||||
break;
|
||||
@@ -497,6 +502,9 @@ static int rockchip_pdm_trigger(struct snd_pcm_substream *substream, int cmd,
|
||||
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
|
||||
if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
|
||||
rockchip_pdm_rxctrl(pdm, 0);
|
||||
|
||||
if (!(pdm->quirks & QUIRK_ALWAYS_ON))
|
||||
pinctrl_pm_select_idle_state(pdm->dev);
|
||||
break;
|
||||
default:
|
||||
ret = -EINVAL;
|
||||
@@ -827,7 +835,8 @@ static int rockchip_pdm_runtime_resume(struct device *dev)
|
||||
|
||||
rockchip_pdm_rxctrl(pdm, 0);
|
||||
|
||||
rockchip_pdm_pinctrl_select_clk_state(dev);
|
||||
if (pdm->quirks & QUIRK_ALWAYS_ON)
|
||||
rockchip_pdm_pinctrl_select_clk_state(dev);
|
||||
|
||||
return 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user