diff options
author | Oleksandr Suvorov <oleksandr.suvorov@toradex.com> | 2019-07-19 06:05:37 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-07-22 08:26:27 -0400 |
commit | b6319b061ba279577fd7030a9848fbd6a17151e3 (patch) | |
tree | 64c5df8b8cc5cae01f9c271b930b83826824f6a5 | |
parent | 631bc8f0134ae9620d86a96b8c5f9445d91a2dca (diff) |
ASoC: sgtl5000: Fix charge pump source assignment
If VDDA != VDDIO and any of them is greater than 3.1V, charge pump
source can be assigned automatically [1].
[1] https://www.nxp.com/docs/en/data-sheet/SGTL5000.pdf
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
Reviewed-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20190719100524.23300-7-oleksandr.suvorov@toradex.com
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/codecs/sgtl5000.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c index 23f4ae2f0723..aa1f9637d895 100644 --- a/sound/soc/codecs/sgtl5000.c +++ b/sound/soc/codecs/sgtl5000.c | |||
@@ -1338,12 +1338,17 @@ static int sgtl5000_set_power_regs(struct snd_soc_component *component) | |||
1338 | SGTL5000_INT_OSC_EN); | 1338 | SGTL5000_INT_OSC_EN); |
1339 | /* Enable VDDC charge pump */ | 1339 | /* Enable VDDC charge pump */ |
1340 | ana_pwr |= SGTL5000_VDDC_CHRGPMP_POWERUP; | 1340 | ana_pwr |= SGTL5000_VDDC_CHRGPMP_POWERUP; |
1341 | } else if (vddio >= 3100 && vdda >= 3100) { | 1341 | } else { |
1342 | ana_pwr &= ~SGTL5000_VDDC_CHRGPMP_POWERUP; | 1342 | ana_pwr &= ~SGTL5000_VDDC_CHRGPMP_POWERUP; |
1343 | /* VDDC use VDDIO rail */ | 1343 | /* |
1344 | lreg_ctrl |= SGTL5000_VDDC_ASSN_OVRD; | 1344 | * if vddio == vdda the source of charge pump should be |
1345 | lreg_ctrl |= SGTL5000_VDDC_MAN_ASSN_VDDIO << | 1345 | * assigned manually to VDDIO |
1346 | SGTL5000_VDDC_MAN_ASSN_SHIFT; | 1346 | */ |
1347 | if (vddio == vdda) { | ||
1348 | lreg_ctrl |= SGTL5000_VDDC_ASSN_OVRD; | ||
1349 | lreg_ctrl |= SGTL5000_VDDC_MAN_ASSN_VDDIO << | ||
1350 | SGTL5000_VDDC_MAN_ASSN_SHIFT; | ||
1351 | } | ||
1347 | } | 1352 | } |
1348 | 1353 | ||
1349 | snd_soc_component_write(component, SGTL5000_CHIP_LINREG_CTRL, lreg_ctrl); | 1354 | snd_soc_component_write(component, SGTL5000_CHIP_LINREG_CTRL, lreg_ctrl); |