regulator: imx-anatop: Set default voltage selector for vddpu
PATCH 1/2 regulator: imx-anatop: Set default voltage selector for vddpu
The code reads the default voltage selector from its register. If the bootloader disables the regulator, the default voltage selector will be 0 which results in faulty behaviour of this regulator driver.
This patch sets a default voltage selector for vddpu if it is not set in the register.
--- drivers/regulator/anatop-regulator.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/regulator/anatop-regulator.c +8 -0
@@ -283,6 +283,14 @@ static int anatop_regulator_probe(struct platform_device *pdev) sreg->sel =0 ; sreg->bypass = true; } + +/* +* In case vddpu was disabled by the bootloader, we need to set +* a sane default until imx6-cpufreq was probed and changes the +* voltage to the correct value. In this case we set 1.25V. +*/ +if (!sreg->sel && !strcmp (sreg->name,"vddpu" )) + sreg->sel =22 ; }else { rdesc->ops = &anatop_rops; }
Signature · 1 line
2.1.0
PATCH 2/2 regulator: imx-anatop: Fail on invalid voltage selector
A '0' voltage selector is invalid and can't be used with this driver.
--- drivers/regulator/anatop-regulator.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/regulator/anatop-regulator.c +5 -0
@@ -291,6 +291,11 @@ static int anatop_regulator_probe(struct platform_device *pdev)*/ if (!sreg->sel && !strcmp (sreg->name,"vddpu" )) sreg->sel =22 ; + +if (!sreg->sel) { +dev_err (&pdev->dev,"Failed to read a valid default voltage selector.\n" ); +return -EINVAL ; + } }else { rdesc->ops = &anatop_rops; }
Signature · 1 line
2.1.0
Mark Brown
maintainerPATCH 2/2 regulator: imx-anatop: Fail on invalid voltage selector
Quoted 1 line · Markus Pargmann
A '0' voltage selector is invalid and can't be used with this driver.
Applied, thanks.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141007/1bd32dca/attachment.sig>
Mark Brown
maintainerPATCH 1/2 regulator: imx-anatop: Set default voltage selector for vddpu
In reply to Markus PargmannQuoted 3 lines · Markus Pargmann
The code reads the default voltage selector from its register. If the bootloader disables the regulator, the default voltage selector will be 0 which results in faulty behaviour of this regulator driver.
Applied, thanks.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141007/ae7d7892/attachment.sig>