Skip to content

Commit e7543e1

Browse files
M-Vaittinenbroonie
authored andcommitted
regulator: bd718x7: Use rohm generic restricted voltage setting
Use common restricted voltage setting instead of implementing own. Signed-off-by: Matti Vaittinen <[email protected]> Link: https://lore.kernel.org/r/5a0ee14852802690241568a29ed19ff9550b0b08.1637233864.git.matti.vaittinen@fi.rohmeurope.com Signed-off-by: Mark Brown <[email protected]>
1 parent 8b6e885 commit e7543e1

File tree

1 file changed

+4
-25
lines changed

1 file changed

+4
-25
lines changed

drivers/regulator/bd718x7-regulator.c

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -125,27 +125,6 @@ static int bd71837_get_buck34_enable_hwctrl(struct regulator_dev *rdev)
125125

126126
return !!(BD718XX_BUCK_RUN_ON & val);
127127
}
128-
/*
129-
* On BD71837 (not on BD71847, BD71850, ...)
130-
* Bucks 1 to 4 support DVS. PWM mode is used when voltage is changed.
131-
* Bucks 5 to 8 and LDOs can use PFM and must be disabled when voltage
132-
* is changed. Hence we return -EBUSY for these if voltage is changed
133-
* when BUCK/LDO is enabled.
134-
*
135-
* On BD71847, BD71850, ... The LDO voltage can be changed when LDO is
136-
* enabled. But if voltage is increased the LDO power-good monitoring
137-
* must be disabled for the duration of changing + 1mS to ensure voltage
138-
* has reached the higher level before HW does next under voltage detection
139-
* cycle.
140-
*/
141-
static int bd71837_set_voltage_sel_restricted(struct regulator_dev *rdev,
142-
unsigned int sel)
143-
{
144-
if (rdev->desc->ops->is_enabled(rdev))
145-
return -EBUSY;
146-
147-
return regulator_set_voltage_sel_regmap(rdev, sel);
148-
}
149128

150129
static void voltage_change_done(struct regulator_dev *rdev, unsigned int sel,
151130
unsigned int *mask)
@@ -642,22 +621,22 @@ BD718XX_OPS(bd71837_pickable_range_buck_ops,
642621
bd718x7_set_buck_ovp);
643622

644623
BD718XX_OPS(bd71837_ldo_regulator_ops, regulator_list_voltage_linear_range,
645-
NULL, bd71837_set_voltage_sel_restricted,
624+
NULL, rohm_regulator_set_voltage_sel_restricted,
646625
regulator_get_voltage_sel_regmap, NULL, NULL, bd718x7_set_ldo_uvp,
647626
NULL);
648627

649628
BD718XX_OPS(bd71837_ldo_regulator_nolinear_ops, regulator_list_voltage_table,
650-
NULL, bd71837_set_voltage_sel_restricted,
629+
NULL, rohm_regulator_set_voltage_sel_restricted,
651630
regulator_get_voltage_sel_regmap, NULL, NULL, bd718x7_set_ldo_uvp,
652631
NULL);
653632

654633
BD718XX_OPS(bd71837_buck_regulator_ops, regulator_list_voltage_linear_range,
655-
NULL, bd71837_set_voltage_sel_restricted,
634+
NULL, rohm_regulator_set_voltage_sel_restricted,
656635
regulator_get_voltage_sel_regmap, regulator_set_voltage_time_sel,
657636
NULL, bd718x7_set_buck_uvp, bd718x7_set_buck_ovp);
658637

659638
BD718XX_OPS(bd71837_buck_regulator_nolinear_ops, regulator_list_voltage_table,
660-
regulator_map_voltage_ascend, bd71837_set_voltage_sel_restricted,
639+
regulator_map_voltage_ascend, rohm_regulator_set_voltage_sel_restricted,
661640
regulator_get_voltage_sel_regmap, regulator_set_voltage_time_sel,
662641
NULL, bd718x7_set_buck_uvp, bd718x7_set_buck_ovp);
663642
/*

0 commit comments

Comments
 (0)