MLK-11561-2 regulator: anatop: set default voltage selector for pcie
authorRichard Zhu <Richard.Zhu@freescale.com>
Tue, 15 Sep 2015 06:27:00 +0000 (14:27 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:48:40 +0000 (14:48 -0500)
The code reads the default voltage selector from its register.
If the default voltage selector is 0 which results in faulty
behaviour of this regulator driver.

This patch sets a default voltage selector for vddpcie-phy if
it is not set in the register.

Signed-off-by: Richard Zhu <Richard.Zhu@freescale.com>
drivers/regulator/anatop-regulator.c

index bd33f86..be3b350 100644 (file)
@@ -352,6 +352,10 @@ static int anatop_regulator_probe(struct platform_device *pdev)
                if (!sreg->sel && !strcmp(sreg->name, "vddpu"))
                        sreg->sel = 22;
 
+               /* set the default voltage of the pcie phy to be 1.100v */
+               if (!sreg->sel && !strcmp(sreg->name, "vddpcie-phy"))
+                       sreg->sel = 0x10;
+
                if (!sreg->bypass && !sreg->sel) {
                        dev_err(&pdev->dev, "Failed to read a valid default voltage selector.\n");
                        return -EINVAL;