Commit 5b8ff89f authored by Mark Brown's avatar Mark Brown

Merge existing fixes from regulator/for-5.8

parents b3a9e3b9 6f1cf525
...@@ -512,7 +512,6 @@ static const struct da9063_regulator_info da9063_regulator_info[] = { ...@@ -512,7 +512,6 @@ static const struct da9063_regulator_info da9063_regulator_info[] = {
}, },
{ {
DA9063_LDO(DA9063, LDO9, 950, 50, 3600), DA9063_LDO(DA9063, LDO9, 950, 50, 3600),
.suspend = BFIELD(DA9063_REG_LDO9_CONT, DA9063_VLDO9_SEL),
}, },
{ {
DA9063_LDO(DA9063, LDO11, 900, 50, 3600), DA9063_LDO(DA9063, LDO11, 900, 50, 3600),
......
...@@ -486,7 +486,7 @@ int regulator_map_voltage_pickable_linear_range(struct regulator_dev *rdev, ...@@ -486,7 +486,7 @@ int regulator_map_voltage_pickable_linear_range(struct regulator_dev *rdev,
continue; continue;
} }
ret = selector + sel; ret = selector + sel - range->min_sel;
voltage = rdev->desc->ops->list_voltage(rdev, ret); voltage = rdev->desc->ops->list_voltage(rdev, ret);
......
...@@ -209,6 +209,19 @@ static const struct regulator_ops pfuze100_swb_regulator_ops = { ...@@ -209,6 +209,19 @@ static const struct regulator_ops pfuze100_swb_regulator_ops = {
}; };
static const struct regulator_ops pfuze3000_sw_regulator_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,
.set_voltage_time_sel = regulator_set_voltage_time_sel,
.set_ramp_delay = pfuze100_set_ramp_delay,
};
#define PFUZE100_FIXED_REG(_chip, _name, base, voltage) \ #define PFUZE100_FIXED_REG(_chip, _name, base, voltage) \
[_chip ## _ ## _name] = { \ [_chip ## _ ## _name] = { \
.desc = { \ .desc = { \
...@@ -318,23 +331,28 @@ static const struct regulator_ops pfuze100_swb_regulator_ops = { ...@@ -318,23 +331,28 @@ static const struct regulator_ops pfuze100_swb_regulator_ops = {
.stby_mask = 0x20, \ .stby_mask = 0x20, \
} }
/* No linar case for the some switches of PFUZE3000 */
#define PFUZE3000_SW2_REG(_chip, _name, base, min, max, step) { \ #define PFUZE3000_SW_REG(_chip, _name, base, mask, voltages) \
.desc = { \ [_chip ## _ ## _name] = { \
.name = #_name,\ .desc = { \
.n_voltages = ((max) - (min)) / (step) + 1, \ .name = #_name, \
.ops = &pfuze100_sw_regulator_ops, \ .n_voltages = ARRAY_SIZE(voltages), \
.type = REGULATOR_VOLTAGE, \ .ops = &pfuze3000_sw_regulator_ops, \
.id = _chip ## _ ## _name, \ .type = REGULATOR_VOLTAGE, \
.owner = THIS_MODULE, \ .id = _chip ## _ ## _name, \
.min_uV = (min), \ .owner = THIS_MODULE, \
.uV_step = (step), \ .volt_table = voltages, \
.vsel_reg = (base) + PFUZE100_VOL_OFFSET, \ .vsel_reg = (base) + PFUZE100_VOL_OFFSET, \
.vsel_mask = 0x7, \ .vsel_mask = (mask), \
}, \ .enable_reg = (base) + PFUZE100_MODE_OFFSET, \
.stby_reg = (base) + PFUZE100_STANDBY_OFFSET, \ .enable_mask = 0xf, \
.stby_mask = 0x7, \ .enable_val = 0x8, \
} .enable_time = 500, \
}, \
.stby_reg = (base) + PFUZE100_STANDBY_OFFSET, \
.stby_mask = (mask), \
.sw_reg = true, \
}
#define PFUZE3000_SW3_REG(_chip, _name, base, min, max, step) { \ #define PFUZE3000_SW3_REG(_chip, _name, base, min, max, step) { \
.desc = { \ .desc = { \
...@@ -391,9 +409,9 @@ static struct pfuze_regulator pfuze200_regulators[] = { ...@@ -391,9 +409,9 @@ static struct pfuze_regulator pfuze200_regulators[] = {
}; };
static struct pfuze_regulator pfuze3000_regulators[] = { static struct pfuze_regulator pfuze3000_regulators[] = {
PFUZE100_SWB_REG(PFUZE3000, SW1A, PFUZE100_SW1ABVOL, 0x1f, pfuze3000_sw1a), PFUZE3000_SW_REG(PFUZE3000, SW1A, PFUZE100_SW1ABVOL, 0x1f, pfuze3000_sw1a),
PFUZE100_SW_REG(PFUZE3000, SW1B, PFUZE100_SW1CVOL, 700000, 1475000, 25000), PFUZE100_SW_REG(PFUZE3000, SW1B, PFUZE100_SW1CVOL, 700000, 1475000, 25000),
PFUZE100_SWB_REG(PFUZE3000, SW2, PFUZE100_SW2VOL, 0x7, pfuze3000_sw2lo), PFUZE3000_SW_REG(PFUZE3000, SW2, PFUZE100_SW2VOL, 0x7, pfuze3000_sw2lo),
PFUZE3000_SW3_REG(PFUZE3000, SW3, PFUZE100_SW3AVOL, 900000, 1650000, 50000), PFUZE3000_SW3_REG(PFUZE3000, SW3, PFUZE100_SW3AVOL, 900000, 1650000, 50000),
PFUZE100_SWB_REG(PFUZE3000, SWBST, PFUZE100_SWBSTCON1, 0x3, pfuze100_swbst), PFUZE100_SWB_REG(PFUZE3000, SWBST, PFUZE100_SWBSTCON1, 0x3, pfuze100_swbst),
PFUZE100_SWB_REG(PFUZE3000, VSNVS, PFUZE100_VSNVSVOL, 0x7, pfuze100_vsnvs), PFUZE100_SWB_REG(PFUZE3000, VSNVS, PFUZE100_VSNVSVOL, 0x7, pfuze100_vsnvs),
...@@ -407,8 +425,8 @@ static struct pfuze_regulator pfuze3000_regulators[] = { ...@@ -407,8 +425,8 @@ static struct pfuze_regulator pfuze3000_regulators[] = {
}; };
static struct pfuze_regulator pfuze3001_regulators[] = { static struct pfuze_regulator pfuze3001_regulators[] = {
PFUZE100_SWB_REG(PFUZE3001, SW1, PFUZE100_SW1ABVOL, 0x1f, pfuze3000_sw1a), PFUZE3000_SW_REG(PFUZE3001, SW1, PFUZE100_SW1ABVOL, 0x1f, pfuze3000_sw1a),
PFUZE100_SWB_REG(PFUZE3001, SW2, PFUZE100_SW2VOL, 0x7, pfuze3000_sw2lo), PFUZE3000_SW_REG(PFUZE3001, SW2, PFUZE100_SW2VOL, 0x7, pfuze3000_sw2lo),
PFUZE3000_SW3_REG(PFUZE3001, SW3, PFUZE100_SW3AVOL, 900000, 1650000, 50000), PFUZE3000_SW3_REG(PFUZE3001, SW3, PFUZE100_SW3AVOL, 900000, 1650000, 50000),
PFUZE100_SWB_REG(PFUZE3001, VSNVS, PFUZE100_VSNVSVOL, 0x7, pfuze100_vsnvs), PFUZE100_SWB_REG(PFUZE3001, VSNVS, PFUZE100_VSNVSVOL, 0x7, pfuze100_vsnvs),
PFUZE100_VGEN_REG(PFUZE3001, VLDO1, PFUZE100_VGEN1VOL, 1800000, 3300000, 100000), PFUZE100_VGEN_REG(PFUZE3001, VLDO1, PFUZE100_VGEN1VOL, 1800000, 3300000, 100000),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment