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 <[email protected]> --- 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 8f6d7956e79b2..a9a11be373916 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 4d399d0486d19..4cbcb277ff20d 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
