From 7c818328b76d9d43164fef14bbdf8cf40eee2d2c Mon Sep 17 00:00:00 2001 From: Oleksandr Suvorov Date: Thu, 2 May 2019 13:44:41 +0300 Subject: ASoC: sgtl5000: Don't fallback to ldo regulator - the code to fallback to internal ldo regulator instead of external vddd is completely wrong. According to TDM and Errata of sgtl5000 chips revision < 0x11 strongly need to use external vddd due to ER1. For chips revision >= 0x11 there is no limitation to use either external vddd or internal ldo regulator. - fix logical error in cleanup sequence. Signed-off-by: Oleksandr Suvorov --- sound/soc/codecs/sgtl5000.c | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c index 07fe76c8cc8d..dd07286a79c3 100644 --- a/sound/soc/codecs/sgtl5000.c +++ b/sound/soc/codecs/sgtl5000.c @@ -1261,31 +1261,6 @@ static int sgtl5000_enable_regulators(struct snd_soc_codec *codec) rev = (reg & SGTL5000_REVID_MASK) >> SGTL5000_REVID_SHIFT; dev_info(codec->dev, "sgtl5000 revision 0x%x\n", rev); - /* - * workaround for revision 0x11 and later, - * roll back to use internal LDO - */ - if (external_vddd && rev >= 0x11) { - /* disable all regulator first */ - regulator_bulk_disable(ARRAY_SIZE(sgtl5000->supplies), - sgtl5000->supplies); - /* free VDDD regulator */ - regulator_bulk_free(ARRAY_SIZE(sgtl5000->supplies), - sgtl5000->supplies); - - ret = sgtl5000_replace_vddd_with_ldo(codec); - if (ret) - return ret; - - ret = regulator_bulk_enable(ARRAY_SIZE(sgtl5000->supplies), - sgtl5000->supplies); - if (ret) - goto err_regulator_free; - - /* wait for all power rails bring up */ - udelay(10); - } - return 0; err_regulator_disable: @@ -1294,7 +1269,7 @@ err_regulator_disable: err_regulator_free: regulator_bulk_free(ARRAY_SIZE(sgtl5000->supplies), sgtl5000->supplies); - if (external_vddd) + if (! external_vddd) ldo_regulator_remove(codec); return ret; -- cgit v1.2.3