summaryrefslogtreecommitdiff
path: root/drivers/regulator/pf1550.c
diff options
context:
space:
mode:
authorRobin Gong <yibin.gong@nxp.com>2016-06-27 15:32:50 +0800
committerJason Liu <jason.hui.liu@nxp.com>2019-02-12 10:25:03 +0800
commitb33de0c200ae1b430428055aff87bbf3659061ba (patch)
tree4b6564f30b729b76f3fac3e1e85661454c0576ff /drivers/regulator/pf1550.c
parent34c202239dd7107fd02771c874a0905b7c28069e (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/pf1550.c')
-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),