Skip to contentSkip to conversation

ASoC: tlv320dac33: codec enable fixes

PATCH In review Peter Ujfalusi 3 participants 6 messages Nov 30, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover ASoC: tlv320dac33: codec enable fixes

Hello,

two small fixes to avoid duplicated codec enable, which reduces i2c access to the chip.

---
Peter Ujfalusi (2):
ASoC: tlv320dac33: Do not enable the codec in init_chip
ASoC: tlv320dac33: Avoid multiple soft power up

 sound/soc/codecs/tlv320dac33.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
Signature · 1 line
1.7.3.2
#1 lore raw

PATCH 1/2 ASoC: tlv320dac33: Do not enable the codec in init_chip

No need to enable the codec at this time.
The codec will be enabled later by other events

---
 sound/soc/codecs/tlv320dac33.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
sound/soc/codecs/tlv320dac33.c +0 -2
index ccb267f..080ec91 100644
@@ -315,8 +315,6 @@ static void dac33_init_chip(struct snd_soc_codec *codec)
 	 clock source = internal osc (?) */
 	dac33_write(codec, DAC33_ANA_VOL_SOFT_STEP_CTRL, DAC33_VOLCLKEN);
 
-	dac33_write(codec, DAC33_PWR_CTRL, DAC33_PDNALLB);
-
 	/* Restore only selected registers (gains mostly) */
 	dac33_write(codec, DAC33_LDAC_DIG_VOL_CTRL,
 		    dac33_read_reg_cache(codec, DAC33_LDAC_DIG_VOL_CTRL));
Signature · 1 line
1.7.3.2
#3 lore raw

Re: [PATCH 1/2] ASoC: tlv320dac33: Do not enable the codec in init_chip

In reply to Peter Ujfalusi
Quoted 13 lines · Peter Ujfalusi

No need to enable the codec at this time.
The codec will be enabled later by other events

---
 sound/soc/codecs/tlv320dac33.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
sound/soc/codecs/tlv320dac33.c +0 -0
index ccb267f..080ec91 100644

sound/soc/codecs/tlv320dac33.c static void dac33_init_chip(struct snd_soc_codec *codec) · line 320

Quoted 8 lines
sound/soc/codecs/tlv320dac33.c +0 -2
@@ -315,8 +315,6 @@ static void dac33_init_chip(struct snd_soc_codec *codec)
 	 clock source = internal osc (?) */
 	dac33_write(codec, DAC33_ANA_VOL_SOFT_STEP_CTRL, DAC33_VOLCLKEN);
 
-	dac33_write(codec, DAC33_PWR_CTRL, DAC33_PDNALLB);
-
 	/* Restore only selected registers (gains mostly) */
 	dac33_write(codec, DAC33_LDAC_DIG_VOL_CTRL,
 		    dac33_read_reg_cache(codec, DAC33_LDAC_DIG_VOL_CTRL));

Both Applied.

Thanks

Liam

Signature · 3 lines
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk
#4 lore raw

PATCH 2/2 ASoC: tlv320dac33: Avoid multiple soft power up

In reply to Peter Ujfalusi

During playback start the codec has been already powered at BIAS_ON event time, so there's no need to enable the codec again.

---
 sound/soc/codecs/tlv320dac33.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
sound/soc/codecs/tlv320dac33.c +2 -1
index 080ec91..a0ba5d1 100644
@@ -642,7 +642,8 @@ static int dac33_set_bias_level(struct snd_soc_codec *codec,
 
 	switch (level) {
 	case SND_SOC_BIAS_ON:
-		dac33_soft_power(codec, 1);
+		if (!dac33->substream)
+			dac33_soft_power(codec, 1);
 		break;
 	case SND_SOC_BIAS_PREPARE:
 		break;
Signature · 1 line
1.7.3.2