[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240225-regulator-mp8859-v1-5-68ee2c839ded@kernel.org>
Date: Sun, 25 Feb 2024 14:59:31 +0000
From: Mark Brown <broonie@...nel.org>
To: Liam Girdwood <lgirdwood@...il.com>
Cc: linux-kernel@...r.kernel.org, Markus Reichl <m.reichl@...etechno.de>,
Mark Brown <broonie@...nel.org>
Subject: [PATCH 5/8] regulator: mp8859: Support active discharge control
The MP8859 can actively discharge the output when disabled, add support for
controlling this feature.
Signed-off-by: Mark Brown <broonie@...nel.org>
---
drivers/regulator/mp8859.c | 5 +++++
1 file changed, 5 insertions(+)
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,
},
--
2.39.2
Powered by blists - more mailing lists