diff options
Diffstat (limited to 'sound/soc/omap/sdp4430.c')
-rw-r--r-- | sound/soc/omap/sdp4430.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/sound/soc/omap/sdp4430.c b/sound/soc/omap/sdp4430.c index ad2cec2..8baa898 100644 --- a/sound/soc/omap/sdp4430.c +++ b/sound/soc/omap/sdp4430.c @@ -377,6 +377,26 @@ static const struct snd_soc_dapm_route audio_map[] = { {"Digital Mic1 Bias", NULL, "Digital Mic 2"}, }; +static int sdp4430_mcpdm_twl6040_pre(struct snd_pcm_substream *substream) +{ + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct snd_soc_codec *codec = rtd->codec; + struct twl6040 *twl6040 = codec->control_data; + + /* TWL6040 supplies McPDM PAD_CLKS */ + return twl6040_enable(twl6040); +} + +static void sdp4430_mcpdm_twl6040_post(struct snd_pcm_substream *substream) +{ + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct snd_soc_codec *codec = rtd->codec; + struct twl6040 *twl6040 = codec->control_data; + + /* TWL6040 supplies McPDM PAD_CLKS */ + twl6040_disable(twl6040); +} + static int sdp4430_twl6040_init(struct snd_soc_pcm_runtime *rtd) { struct snd_soc_codec *codec = rtd->codec; @@ -686,6 +706,8 @@ static struct snd_soc_dai_link sdp4430_dai[] = { .codec_dai_name = "twl6040-dl1", .codec_name = "twl6040-codec", + .pre = sdp4430_mcpdm_twl6040_pre, + .post = sdp4430_mcpdm_twl6040_post, .ops = &sdp4430_mcpdm_ops, .ignore_suspend = 1, }, @@ -724,6 +746,8 @@ static struct snd_soc_dai_link sdp4430_dai[] = { .no_pcm = 1, /* don't create ALSA pcm for this */ .init = sdp4430_twl6040_init, + .pre = sdp4430_mcpdm_twl6040_pre, + .post = sdp4430_mcpdm_twl6040_post, .ops = &sdp4430_mcpdm_ops, .be_id = OMAP_ABE_DAI_PDM_DL1, }, @@ -757,6 +781,8 @@ static struct snd_soc_dai_link sdp4430_dai[] = { .no_pcm = 1, /* don't create ALSA pcm for this */ .init = sdp4430_twl6040_dl2_init, + .pre = sdp4430_mcpdm_twl6040_pre, + .post = sdp4430_mcpdm_twl6040_post, .ops = &sdp4430_mcpdm_ops, .be_id = OMAP_ABE_DAI_PDM_DL2, }, @@ -773,6 +799,8 @@ static struct snd_soc_dai_link sdp4430_dai[] = { .codec_name = "twl6040-codec", .no_pcm = 1, /* don't create ALSA pcm for this */ + .pre = sdp4430_mcpdm_twl6040_pre, + .post = sdp4430_mcpdm_twl6040_post, .ops = &sdp4430_mcpdm_ops, .be_id = OMAP_ABE_DAI_PDM_VIB, }, |