ASoC: msmcobalt: Add independent clock support on codec
WCD9335 codec has single master clock supply widget for both playback and recording paths. Adding separate clock supply for playback and recording paths will help handle low power audio recording usecases without affecting playback usecases. Change is to enable separate clock supply widgets for playback and recording paths. CRs-Fixed: 1022917 Change-Id: Ia02a1ffed911498dd6eb5df246e6da68a7802a92 Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
This commit is contained in:
parent
46aa49c118
commit
80e0e34f04
1 changed files with 38 additions and 4 deletions
|
@ -512,10 +512,10 @@ static struct wcd_mbhc_config wcd_mbhc_cfg = {
|
|||
};
|
||||
|
||||
static struct snd_soc_dapm_route wcd_audio_paths[] = {
|
||||
{"MIC BIAS1", NULL, "MCLK"},
|
||||
{"MIC BIAS2", NULL, "MCLK"},
|
||||
{"MIC BIAS3", NULL, "MCLK"},
|
||||
{"MIC BIAS4", NULL, "MCLK"},
|
||||
{"MIC BIAS1", NULL, "MCLK TX"},
|
||||
{"MIC BIAS2", NULL, "MCLK TX"},
|
||||
{"MIC BIAS3", NULL, "MCLK TX"},
|
||||
{"MIC BIAS4", NULL, "MCLK TX"},
|
||||
};
|
||||
|
||||
static struct afe_clk_set mi2s_clk[MI2S_MAX] = {
|
||||
|
@ -2463,6 +2463,37 @@ static int msm_snd_enable_codec_ext_clk(struct snd_soc_codec *codec,
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int msm_snd_enable_codec_ext_tx_clk(struct snd_soc_codec *codec,
|
||||
int enable, bool dapm)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (!strcmp(dev_name(codec->dev), "tasha_codec"))
|
||||
ret = tasha_cdc_mclk_tx_enable(codec, enable, dapm);
|
||||
else {
|
||||
dev_err(codec->dev, "%s: unknown codec to enable ext clk\n",
|
||||
__func__);
|
||||
ret = -EINVAL;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int msm_mclk_tx_event(struct snd_soc_dapm_widget *w,
|
||||
struct snd_kcontrol *kcontrol, int event)
|
||||
{
|
||||
struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);
|
||||
|
||||
pr_debug("%s: event = %d\n", __func__, event);
|
||||
|
||||
switch (event) {
|
||||
case SND_SOC_DAPM_PRE_PMU:
|
||||
return msm_snd_enable_codec_ext_tx_clk(codec, 1, true);
|
||||
case SND_SOC_DAPM_POST_PMD:
|
||||
return msm_snd_enable_codec_ext_tx_clk(codec, 0, true);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int msm_mclk_event(struct snd_soc_dapm_widget *w,
|
||||
struct snd_kcontrol *kcontrol, int event)
|
||||
{
|
||||
|
@ -2485,6 +2516,9 @@ static const struct snd_soc_dapm_widget msm_dapm_widgets[] = {
|
|||
msm_mclk_event,
|
||||
SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
|
||||
|
||||
SND_SOC_DAPM_SUPPLY("MCLK TX", SND_SOC_NOPM, 0, 0,
|
||||
msm_mclk_tx_event, SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
|
||||
|
||||
SND_SOC_DAPM_SPK("Lineout_1 amp", NULL),
|
||||
SND_SOC_DAPM_SPK("Lineout_3 amp", NULL),
|
||||
SND_SOC_DAPM_SPK("Lineout_2 amp", NULL),
|
||||
|
|
Loading…
Add table
Reference in a new issue