Commit fcea8b02 authored by Adam Thomson's avatar Adam Thomson Committed by Mark Brown

ASoC: da7219: Fix I/O voltage range configuration during probe

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: aa5b18d1 ("ASoC: da7219: Move soft reset handling to codec level probe")
Reported-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: default avatarAdam Thomson <Adam.Thomson.Opensource@diasemi.com>
Link: https://lore.kernel.org/r/20200821142259.C2ECE3FB96@swsrvapps-01.diasemi.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 75136503
......@@ -1864,6 +1864,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);
......@@ -1871,8 +1874,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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment