summaryrefslogtreecommitdiff
path: root/drivers/regulator
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2024-02-25 14:59:31 +0000
committerMark Brown <broonie@kernel.org>2024-02-26 13:46:52 +0000
commitd7217c91bbde48ee60d3ce67cda6557f56c6b639 (patch)
tree3818875c4936339e4ef0dd920e1d0bb29923c80f /drivers/regulator
parent673d06a858864c7dca9dd5c36a78f5f7fda793af (diff)
downloadlwn-d7217c91bbde48ee60d3ce67cda6557f56c6b639.tar.gz
lwn-d7217c91bbde48ee60d3ce67cda6557f56c6b639.zip
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>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/mp8859.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/regulator/mp8859.c b/drivers/regulator/mp8859.c
index b97c00097148..87ef34875be1 100644
--- a/drivers/regulator/mp8859.c
+++ b/drivers/regulator/mp8859.c
@@ -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,
},