mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ASoC: da7219: Fix I/O voltage range configuration during probe
@ 2020-08-21 14:22 Adam Thomson
  2020-08-21 16:39 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Adam Thomson @ 2020-08-21 14:22 UTC (permalink / raw)
  To: Mark Brown, Takashi Iwai, Liam Girdwood, Jaroslav Kysela
  Cc: Pierre-Louis Bossart, alsa-devel, linux-kernel, Support Opensource

Previous improvements around handling device and codec level
probe functionality added the possibility of the voltage level
being undefined for the scenario where the IO voltage retrieved
from the regulator supply was below 1.2V, whereas previously the
code defaulted to the 2.5V to 3.6V range in that case. This
commit restores the default value to avoid this happening.

Fixes: aa5b18d1c290 ("ASoC: da7219: Move soft reset handling to codec level probe")
Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
---
 sound/soc/codecs/da7219.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/da7219.c b/sound/soc/codecs/da7219.c
index ddd422c..045aeb6 100644
--- a/sound/soc/codecs/da7219.c
+++ b/sound/soc/codecs/da7219.c
@@ -1862,6 +1862,9 @@ static int da7219_handle_supplies(struct snd_soc_component *component,
 		return ret;
 	}
 
+	/* Default to upper range */
+	*io_voltage_lvl = DA7219_IO_VOLTAGE_LEVEL_2_5V_3_6V;
+
 	/* Determine VDDIO voltage provided */
 	vddio = da7219->supplies[DA7219_SUPPLY_VDDIO].consumer;
 	ret = regulator_get_voltage(vddio);
@@ -1869,8 +1872,6 @@ static int da7219_handle_supplies(struct snd_soc_component *component,
 		dev_warn(component->dev, "Invalid VDDIO voltage\n");
 	else if (ret < 2800000)
 		*io_voltage_lvl = DA7219_IO_VOLTAGE_LEVEL_1_2V_2_8V;
-	else
-		*io_voltage_lvl = DA7219_IO_VOLTAGE_LEVEL_2_5V_3_6V;
 
 	/* Enable main supplies */
 	ret = regulator_bulk_enable(DA7219_NUM_SUPPLIES, da7219->supplies);
-- 
1.9.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-21 16:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-21 14:22 [PATCH] ASoC: da7219: Fix I/O voltage range configuration during probe Adam Thomson
2020-08-21 16:39 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®