Skip to content

Commit b79d93d

Browse files
committed
regulator: mp8859: Support enable control
The MP8859 provides a software enable control, support it in the regulator driver. Tested-by: Markus Reichl <m.reichl@fivetechno.de> Signed-off-by: Mark Brown <broonie@kernel.org> Link: https://msgid.link/r/20240225-regulator-mp8859-v1-3-68ee2c839ded@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 6c848d7 commit b79d93d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/regulator/mp8859.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535

3636
#define MP8859_GO_BIT 0x01
3737

38+
#define MP8859_ENABLE_MASK 0x80
3839

3940
static int mp8859_set_voltage_sel(struct regulator_dev *rdev, unsigned int sel)
4041
{
@@ -124,6 +125,9 @@ static const struct regulator_ops mp8859_ops = {
124125
.set_voltage_sel = mp8859_set_voltage_sel,
125126
.get_voltage_sel = mp8859_get_voltage_sel,
126127
.list_voltage = regulator_list_voltage_linear_range,
128+
.enable = regulator_enable_regmap,
129+
.disable = regulator_disable_regmap,
130+
.is_enabled = regulator_is_enabled_regmap,
127131
};
128132

129133
static const struct regulator_desc mp8859_regulators[] = {
@@ -136,6 +140,9 @@ static const struct regulator_desc mp8859_regulators[] = {
136140
.n_voltages = VOL_MAX_IDX + 1,
137141
.linear_ranges = mp8859_dcdc_ranges,
138142
.n_linear_ranges = 1,
143+
.enable_reg = MP8859_CTL1_REG,
144+
.enable_mask = MP8859_ENABLE_MASK,
145+
.enable_val = MP8859_ENABLE_MASK,
139146
.ops = &mp8859_ops,
140147
.owner = THIS_MODULE,
141148
},

0 commit comments

Comments
 (0)