Commit 4b8ffdb9 authored by Peter Ujfalusi's avatar Peter Ujfalusi Committed by Liam Girdwood

ASoC: tlv320dac33: Move codec power up to DAPM

Move the codec power on (in reg 0x01, bit 4) from
set_bias_level:SND_SOC_BIAS_ON to a DAPM supply.
In this way we can be sure, that all the things within
the codec is powered before the external amp is
going to be enabled.
Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
parent 333802e9
...@@ -583,6 +583,9 @@ static const struct snd_soc_dapm_widget dac33_dapm_widgets[] = { ...@@ -583,6 +583,9 @@ static const struct snd_soc_dapm_widget dac33_dapm_widgets[] = {
SND_SOC_DAPM_SUPPLY("Right DAC Power", SND_SOC_DAPM_SUPPLY("Right DAC Power",
DAC33_RDAC_PWR_CTRL, 2, 0, NULL, 0), DAC33_RDAC_PWR_CTRL, 2, 0, NULL, 0),
SND_SOC_DAPM_SUPPLY("Codec Power",
DAC33_PWR_CTRL, 4, 0, NULL, 0),
SND_SOC_DAPM_PRE("Pre Playback", dac33_playback_event), SND_SOC_DAPM_PRE("Pre Playback", dac33_playback_event),
SND_SOC_DAPM_POST("Post Playback", dac33_playback_event), SND_SOC_DAPM_POST("Post Playback", dac33_playback_event),
}; };
...@@ -615,6 +618,9 @@ static const struct snd_soc_dapm_route audio_map[] = { ...@@ -615,6 +618,9 @@ static const struct snd_soc_dapm_route audio_map[] = {
/* output */ /* output */
{"LEFT_LO", NULL, "Output Left Amplifier"}, {"LEFT_LO", NULL, "Output Left Amplifier"},
{"RIGHT_LO", NULL, "Output Right Amplifier"}, {"RIGHT_LO", NULL, "Output Right Amplifier"},
{"LEFT_LO", NULL, "Codec Power"},
{"RIGHT_LO", NULL, "Codec Power"},
}; };
static int dac33_add_widgets(struct snd_soc_codec *codec) static int dac33_add_widgets(struct snd_soc_codec *codec)
...@@ -632,13 +638,10 @@ static int dac33_add_widgets(struct snd_soc_codec *codec) ...@@ -632,13 +638,10 @@ static int dac33_add_widgets(struct snd_soc_codec *codec)
static int dac33_set_bias_level(struct snd_soc_codec *codec, static int dac33_set_bias_level(struct snd_soc_codec *codec,
enum snd_soc_bias_level level) enum snd_soc_bias_level level)
{ {
struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec);
int ret; int ret;
switch (level) { switch (level) {
case SND_SOC_BIAS_ON: case SND_SOC_BIAS_ON:
if (!dac33->substream)
dac33_soft_power(codec, 1);
break; break;
case SND_SOC_BIAS_PREPARE: case SND_SOC_BIAS_PREPARE:
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment