summaryrefslogtreecommitdiff
path: root/drivers/regulator
diff options
context:
space:
mode:
authorRobin Gong <yibin.gong@nxp.com>2016-06-27 15:32:50 +0800
committerLeonard Crestez <leonard.crestez@nxp.com>2018-08-24 12:41:33 +0300
commit90af4188a7c6400851496ef30545c8010d949ed1 (patch)
treee3e55a5a1fd0f0610f8716f0946e11097667dbb9 /drivers/regulator
parent3fbb43f14cc20880f0ccbffd8cb3aa0465738ff0 (diff)
MLK-12928-7 regulator: pf1550: correct ldo ops setting
The voltage of LDO1 and LDO3 are not linear, use voltage_table instead,so add new ops for them. Meanwhile, correct 12500uV for one step of SW1/SW2 rather than 125000uV. Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/pf1550.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/drivers/regulator/pf1550.c b/drivers/regulator/pf1550.c
index fb58a1f3f42f..271897c39b5e 100644
--- a/drivers/regulator/pf1550.c
+++ b/drivers/regulator/pf1550.c
@@ -98,7 +98,17 @@ static struct regulator_ops pf1550_sw_ops = {
.set_ramp_delay = pf1550_set_ramp_delay,
};
-static struct regulator_ops pf1550_ldo_ops = {
+static struct regulator_ops pf1550_ldo1_ops = {
+ .enable = regulator_enable_regmap,
+ .disable = regulator_disable_regmap,
+ .is_enabled = regulator_is_enabled_regmap,
+ .list_voltage = regulator_list_voltage_table,
+ .map_voltage = regulator_map_voltage_ascend,
+ .set_voltage_sel = regulator_set_voltage_sel_regmap,
+ .get_voltage_sel = regulator_get_voltage_sel_regmap,
+};
+
+static struct regulator_ops pf1550_ldo2_ops = {
.enable = regulator_enable_regmap,
.disable = regulator_disable_regmap,
.is_enabled = regulator_is_enabled_regmap,
@@ -175,7 +185,7 @@ static struct regulator_ops pf1550_fixed_ops = {
.of_match = of_match_ptr(#_name), \
.regulators_node = of_match_ptr("regulators"), \
.n_voltages = ARRAY_SIZE(voltages), \
- .ops = &pf1550_ldo_ops, \
+ .ops = &pf1550_ldo1_ops, \
.type = REGULATOR_VOLTAGE, \
.id = _chip ## _ ## _name, \
.owner = THIS_MODULE, \
@@ -195,7 +205,7 @@ static struct regulator_ops pf1550_fixed_ops = {
.of_match = of_match_ptr(#_name), \
.regulators_node = of_match_ptr("regulators"), \
.n_voltages = ((max) - (min)) / (step) + 1, \
- .ops = &pf1550_ldo_ops, \
+ .ops = &pf1550_ldo2_ops, \
.type = REGULATOR_VOLTAGE, \
.id = _chip ## _ ## _name, \
.owner = THIS_MODULE, \
@@ -211,8 +221,8 @@ static struct regulator_ops pf1550_fixed_ops = {
}
static const struct pf1550_desc pf1550_regulators[] = {
- PF_SW3(PF1550, SW1, 600000, 1387500, 0x3f, 125000),
- PF_SW3(PF1550, SW2, 600000, 1387500, 0x3f, 125000),
+ PF_SW3(PF1550, SW1, 600000, 1387500, 0x3f, 12500),
+ PF_SW3(PF1550, SW2, 600000, 1387500, 0x3f, 12500),
PF_SW3(PF1550, SW3, 1800000, 3300000, 0xf, 100000),
PF_VREF(PF1550, VREFDDR, 1200000),
PF_LDO1(PF1550, LDO1, 0x1f, pf1550_ldo13_volts),