Skip to contentSkip to conversation

ASoC: sgtl5000: remove useless register write clearing CHRGPUMP_POWERUP

PATCH Superseded Eric Nelson 2 participants 3 messages Feb 26, 2015 – Mar 6, 2015

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

PATCH 1/1 ASoC: sgtl5000: remove useless register write clearing CHRGPUMP_POWERUP

The only way the SGTL5000_VDDC_CHRGPMP_POWERUP bit is set is by execution on a machine with vddio and vdda below 3.1V, and the driver needn't handle the case where the design changes through a soft reboot.

Even if that were desired, the register write removed by this patch would get over-written by the cached value.

Patch inspired by Russell King's more colorful remarks in this patch:

	https://github.com/SolidRun/linux-imx6-3.14/commit/dd4bf6a
---
 sound/soc/codecs/sgtl5000.c | 7 -------
 1 file changed, 7 deletions(-)
sound/soc/codecs/sgtl5000.c +0 -7
index d4d793f..518731a 100644
@@ -952,13 +952,6 @@ static int sgtl5000_set_power_regs(struct snd_soc_codec *codec)
 		/* Enable VDDC charge pump */
 		ana_pwr |= SGTL5000_VDDC_CHRGPMP_POWERUP;
 	} else if (vddio >= 3100 && vdda >= 3100) {
-		/*
-		 * if vddio and vddd > 3.1v,
-		 * charge pump should be clean before set ana_pwr
-		 */
-		snd_soc_update_bits(codec, SGTL5000_CHIP_ANA_POWER,
-				SGTL5000_VDDC_CHRGPMP_POWERUP, 0);
-
 		/* VDDC use VDDIO rail */
 		lreg_ctrl |= SGTL5000_VDDC_ASSN_OVRD;
 		lreg_ctrl |= SGTL5000_VDDC_MAN_ASSN_VDDIO <<
Signature · 1 line
1.9.1
#1 lore raw

PATCH v2 1/1 ASoC: sgtl5000: remove useless register write clearing CHRGPUMP_POWERUP

The SGTL5000_CHIP_ANA_POWER register is cached. Update the cached value instead of writing it directly.

Patch inspired by Russell King's more colorful remarks in this patch:

	https://github.com/SolidRun/linux-imx6-3.14/commit/dd4bf6a

---
V2 updates the cached variable ana_pwr to make things more explicit,
removing the need for explanation

 sound/soc/codecs/sgtl5000.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
sound/soc/codecs/sgtl5000.c +1 -7
index d4d793f..1536ba7 100644
@@ -952,13 +952,7 @@ static int sgtl5000_set_power_regs(struct snd_soc_codec *codec)
 		/* Enable VDDC charge pump */
 		ana_pwr |= SGTL5000_VDDC_CHRGPMP_POWERUP;
 	} else if (vddio >= 3100 && vdda >= 3100) {
-		/*
-		 * if vddio and vddd > 3.1v,
-		 * charge pump should be clean before set ana_pwr
-		 */
-		snd_soc_update_bits(codec, SGTL5000_CHIP_ANA_POWER,
-				SGTL5000_VDDC_CHRGPMP_POWERUP, 0);
-
+		ana_pwr &= ~SGTL5000_VDDC_CHRGPMP_POWERUP;
 		/* VDDC use VDDIO rail */
 		lreg_ctrl |= SGTL5000_VDDC_ASSN_OVRD;
 		lreg_ctrl |= SGTL5000_VDDC_MAN_ASSN_VDDIO <<
Signature · 1 line
1.9.1
maintainer Applied
#2 lore raw
Quoted 2 lines · Eric Nelson

The SGTL5000_CHIP_ANA_POWER register is cached. Update the cached value instead of writing it directly.

Applied, thanks.