regulator: mp8859: Support active discharge control

The MP8859 can actively discharge the output when disabled, add support for
controlling this feature.

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-5-68ee2c839ded@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Mark Brown 2024-02-25 14:59:31 +00:00
parent 673d06a858
commit d7217c91bb
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -36,6 +36,7 @@
#define MP8859_GO_BIT 0x01
#define MP8859_ENABLE_MASK 0x80
#define MP8859_DISCHG_EN_MASK 0x10
#define MP8859_MODE_MASK 0x08
static int mp8859_set_voltage_sel(struct regulator_dev *rdev, unsigned int sel)
@ -167,6 +168,7 @@ static const struct regulator_ops mp8859_ops = {
.is_enabled = regulator_is_enabled_regmap,
.set_mode = mp8859_set_mode,
.get_mode = mp8859_get_mode,
.set_active_discharge = regulator_set_active_discharge_regmap,
};
static const struct regulator_desc mp8859_regulators[] = {
@ -182,6 +184,9 @@ static const struct regulator_desc mp8859_regulators[] = {
.enable_reg = MP8859_CTL1_REG,
.enable_mask = MP8859_ENABLE_MASK,
.enable_val = MP8859_ENABLE_MASK,
.active_discharge_reg = MP8859_CTL1_REG,
.active_discharge_on = MP8859_DISCHG_EN_MASK,
.active_discharge_mask = MP8859_DISCHG_EN_MASK,
.ops = &mp8859_ops,
.owner = THIS_MODULE,
},