[PATCH v2 3/3] mfd: aat2870: Add support for VIN and IN-LDO power supplies
From: Svyatoslav Ryhel
Date: Sun Oct 04 2026 - 12:43:38 EST
The AAT2870 supports a dedicated main power supply input alongside parent
power supply for its internal regulators.
Add support for retrieving and managing these supply regulators
(vin-supply and in-ldo-supply) using the regulator framework to ensure
proper power supply dependencies and power-up sequencing.
Signed-off-by: Svyatoslav Ryhel <clamor95@xxxxxxxxx>
---
drivers/mfd/aat2870-core.c | 5 +++++
drivers/regulator/aat2870-regulator.c | 1 +
2 files changed, 6 insertions(+)
diff --git a/drivers/mfd/aat2870-core.c b/drivers/mfd/aat2870-core.c
index 909c14ee60323..0bd430b90bc1b 100644
--- a/drivers/mfd/aat2870-core.c
+++ b/drivers/mfd/aat2870-core.c
@@ -17,6 +17,7 @@
#include <linux/mfd/core.h>
#include <linux/mfd/aat2870.h>
#include <linux/of_platform.h>
+#include <linux/regulator/consumer.h>
#include <linux/regulator/machine.h>
struct aat2870_register {
@@ -309,6 +310,10 @@ static int aat2870_i2c_probe(struct i2c_client *client)
aat2870->reg_cache = aat2870_regs;
+ ret = devm_regulator_get_enable(&client->dev, "vin");
+ if (ret)
+ return dev_err_probe(&client->dev, ret, "Failed to enable regulator\n");
+
aat2870->en_pin = devm_gpiod_get_optional(&client->dev, "enable",
GPIOD_OUT_HIGH);
if (IS_ERR(aat2870->en_pin))
diff --git a/drivers/regulator/aat2870-regulator.c b/drivers/regulator/aat2870-regulator.c
index 8a58eb27f3f5f..a921e40ca47dd 100644
--- a/drivers/regulator/aat2870-regulator.c
+++ b/drivers/regulator/aat2870-regulator.c
@@ -114,6 +114,7 @@ static const unsigned int aat2870_ldo_voltages[] = {
{ \
.desc = { \
.name = #ids, \
+ .supply_name = "in-ldo", \
.id = AAT2870_ID_##ids, \
.n_voltages = ARRAY_SIZE(aat2870_ldo_voltages), \
.volt_table = aat2870_ldo_voltages, \
--
2.53.0