summaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorGraeme Gregory <gg@slimlogic.co.uk>2013-03-07 13:17:48 +0000
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-03-08 17:34:04 +0800
commit7be859f74ce232361c39d92d29da207ce6ee72bb (patch)
tree12b92fa8da6afec7d2b7a99189736abf74f12d24 /drivers/regulator
parent3c870e3f9d9d98f1ab98614b3b1fd5c79287d361 (diff)
downloadop-kernel-dev-7be859f74ce232361c39d92d29da207ce6ee72bb.zip
op-kernel-dev-7be859f74ce232361c39d92d29da207ce6ee72bb.tar.gz
regulator: palmas correct dt parsing
Fix the DT parsing to agree with the bindings document. Some small changes to the value names and also fix the handling of boolean values. They were previously using prop = 1/0, now just use of_property_read_bool calls. Signed-off-by: Graeme Gregory <gg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/palmas-regulator.c36
1 files changed, 20 insertions, 16 deletions
diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c
index 4f86f6c..c25c2ff 100644
--- a/drivers/regulator/palmas-regulator.c
+++ b/drivers/regulator/palmas-regulator.c
@@ -1,7 +1,7 @@
/*
* Driver for Regulator part of Palmas PMIC Chips
*
- * Copyright 2011-2012 Texas Instruments Inc.
+ * Copyright 2011-2013 Texas Instruments Inc.
*
* Author: Graeme Gregory <gg@slimlogic.co.uk>
*
@@ -552,15 +552,13 @@ static void palmas_dt_to_pdata(struct device *dev,
pdata->reg_init[idx] = devm_kzalloc(dev,
sizeof(struct palmas_reg_init), GFP_KERNEL);
- ret = of_property_read_u32(palmas_matches[idx].of_node,
- "ti,warm-reset", &prop);
- if (!ret)
- pdata->reg_init[idx]->warm_reset = prop;
+ pdata->reg_init[idx]->warm_reset =
+ of_property_read_u32(palmas_matches[idx].of_node,
+ "ti,warm-reset", &prop);
- ret = of_property_read_u32(palmas_matches[idx].of_node,
- "ti,roof-floor", &prop);
- if (!ret)
- pdata->reg_init[idx]->roof_floor = prop;
+ pdata->reg_init[idx]->roof_floor =
+ of_property_read_bool(palmas_matches[idx].of_node,
+ "ti,roof-floor");
ret = of_property_read_u32(palmas_matches[idx].of_node,
"ti,mode-sleep", &prop);
@@ -572,15 +570,14 @@ static void palmas_dt_to_pdata(struct device *dev,
if (!ret)
pdata->reg_init[idx]->tstep = prop;
- ret = of_property_read_u32(palmas_matches[idx].of_node,
- "ti,vsel", &prop);
- if (!ret)
- pdata->reg_init[idx]->vsel = prop;
+ ret = of_property_read_bool(palmas_matches[idx].of_node,
+ "ti,smps-range");
+ if (ret)
+ pdata->reg_init[idx]->vsel =
+ PALMAS_SMPS12_VOLTAGE_RANGE;
}
- ret = of_property_read_u32(node, "ti,ldo6-vibrator", &prop);
- if (!ret)
- pdata->ldo6_vibrator = prop;
+ pdata->ldo6_vibrator = of_property_read_bool(node, "ti,ldo6-vibrator");
}
@@ -805,6 +802,13 @@ static int palmas_remove(struct platform_device *pdev)
static struct of_device_id of_palmas_match_tbl[] = {
{ .compatible = "ti,palmas-pmic", },
+ { .compatible = "ti,palmas-charger-pmic", },
+ { .compatible = "ti,twl6035-pmic", },
+ { .compatible = "ti,twl6036-pmic", },
+ { .compatible = "ti,twl6037-pmic", },
+ { .compatible = "ti,tps65913-pmic", },
+ { .compatible = "ti,tps65914-pmic", },
+ { .compatible = "ti,tps80036-pmic", },
{ /* end */ }
};
OpenPOWER on IntegriCloud