From 5511c90d0c571cb848360eecf5a341d7f1e7d269 Mon Sep 17 00:00:00 2001 From: Richard Zhu Date: Tue, 15 Sep 2015 14:27:00 +0800 Subject: [PATCH] MLK-11561-2 regulator: anatop: set default voltage selector for pcie 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 --- drivers/regulator/anatop-regulator.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/regulator/anatop-regulator.c b/drivers/regulator/anatop-regulator.c index bd33f86f8ed6..be3b350e04cc 100644 --- a/drivers/regulator/anatop-regulator.c +++ b/drivers/regulator/anatop-regulator.c @@ -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; -- 2.17.1