From 2e31c77b8d8312bd87cd1e21427a9a94dcf26eaa Mon Sep 17 00:00:00 2001 From: Zhangfei Gao Date: Sat, 26 Oct 2013 09:32:19 +0800 Subject: regulator: hi6421: add supplier feature Example: ldo0 supplies ldo1 dts: ldo1: ldo@21 { ldo-supply = <&ldo0>; }; If supplier is register first, regulator is register successfully with supplier If suplier is register late, regulator probe will be defered automatically, while driver using such regulator may handle accordingly Or change the supplier regulator sequence in dts Signed-off-by: Zhangfei Gao Signed-off-by: Zhiliang Xue --- drivers/regulator/hi6421-regulator.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/regulator/hi6421-regulator.c b/drivers/regulator/hi6421-regulator.c index a48c9501030a..083e2c3d83ca 100644 --- a/drivers/regulator/hi6421-regulator.c +++ b/drivers/regulator/hi6421-regulator.c @@ -503,6 +503,9 @@ static int hi6421_regulator_probe(struct platform_device *pdev) rdesc = &sreg->rdesc; rdesc->name = sreg->name; rdesc->min_uV = initdata->constraints.min_uV; + if (of_get_property(np, "ldo-supply", NULL)) { + rdesc->supply_name = "ldo"; + } /* to parse device tree data for regulator specific */ ret = sreg->dt_parse(sreg, pdev); -- cgit v1.2.3