Skip to content

Commit fac2f3e

Browse files
Peter Ujfalusibroonie
authored andcommitted
ASoC: twl6040: Remove PLL usage restrictions
There is no limitation dictated by outputs or inputs regarding to the selected PLL (LP/HP). Remove the checks for this, and allow all path with any PLL configuration. Signed-off-by: Peter Ujfalusi <[email protected]> Signed-off-by: Mark Brown <[email protected]>
1 parent f872826 commit fac2f3e

File tree

1 file changed

+9
-31
lines changed

1 file changed

+9
-31
lines changed

sound/soc/codecs/twl6040.c

Lines changed: 9 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ struct twl6040_data {
8787
int plug_irq;
8888
int codec_powered;
8989
int pll;
90-
int non_lp;
9190
int pll_power_mode;
9291
int hs_power_mode;
9392
int hs_power_mode_locked;
@@ -588,10 +587,6 @@ static int out_drv_event(struct snd_soc_dapm_widget *w,
588587
out->left_step = priv->hf_left_step;
589588
out->right_step = priv->hf_right_step;
590589
out->step_delay = 5; /* 5 ms between volume ramp steps */
591-
if (SND_SOC_DAPM_EVENT_ON(event))
592-
priv->non_lp++;
593-
else
594-
priv->non_lp--;
595590
break;
596591
default:
597592
return -1;
@@ -686,18 +681,12 @@ static int twl6040_power_mode_event(struct snd_soc_dapm_widget *w,
686681
int ret = 0;
687682

688683
if (SND_SOC_DAPM_EVENT_ON(event)) {
689-
priv->non_lp++;
690-
if (!strcmp(w->name, "Earphone Driver")) {
691-
/* Earphone doesn't support low power mode */
692-
priv->hs_power_mode_locked = 1;
693-
ret = headset_power_mode(codec, 1);
694-
}
684+
/* Earphone doesn't support low power mode */
685+
priv->hs_power_mode_locked = 1;
686+
ret = headset_power_mode(codec, 1);
695687
} else {
696-
priv->non_lp--;
697-
if (!strcmp(w->name, "Earphone Driver")) {
698-
priv->hs_power_mode_locked = 0;
699-
ret = headset_power_mode(codec, priv->hs_power_mode);
700-
}
688+
priv->hs_power_mode_locked = 0;
689+
ret = headset_power_mode(codec, priv->hs_power_mode);
701690
}
702691

703692
msleep(1);
@@ -1125,14 +1114,10 @@ static const struct snd_soc_dapm_widget twl6040_dapm_widgets[] = {
11251114
/* DACs */
11261115
SND_SOC_DAPM_DAC("HSDAC Left", "Headset Playback", SND_SOC_NOPM, 0, 0),
11271116
SND_SOC_DAPM_DAC("HSDAC Right", "Headset Playback", SND_SOC_NOPM, 0, 0),
1128-
SND_SOC_DAPM_DAC_E("HFDAC Left", "Handsfree Playback",
1129-
TWL6040_REG_HFLCTL, 0, 0,
1130-
twl6040_power_mode_event,
1131-
SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD),
1132-
SND_SOC_DAPM_DAC_E("HFDAC Right", "Handsfree Playback",
1133-
TWL6040_REG_HFRCTL, 0, 0,
1134-
twl6040_power_mode_event,
1135-
SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD),
1117+
SND_SOC_DAPM_DAC("HFDAC Left", "Handsfree Playback",
1118+
TWL6040_REG_HFLCTL, 0, 0),
1119+
SND_SOC_DAPM_DAC("HFDAC Right", "Handsfree Playback",
1120+
TWL6040_REG_HFRCTL, 0, 0),
11361121
/* Virtual DAC for vibra path (DL4 channel) */
11371122
SND_SOC_DAPM_DAC("VIBRA DAC", "Vibra Playback",
11381123
SND_SOC_NOPM, 0, 0),
@@ -1383,13 +1368,6 @@ static int twl6040_prepare(struct snd_pcm_substream *substream,
13831368
return -EINVAL;
13841369
}
13851370

1386-
if ((priv->sysclk == 17640000) && priv->non_lp) {
1387-
dev_err(codec->dev,
1388-
"some enabled paths aren't supported at %dHz\n",
1389-
priv->sysclk);
1390-
return -EPERM;
1391-
}
1392-
13931371
ret = twl6040_set_pll(twl6040, priv->pll, priv->clk_in, priv->sysclk);
13941372
if (ret) {
13951373
dev_err(codec->dev, "Can not set PLL (%d)\n", ret);

0 commit comments

Comments
 (0)