summaryrefslogtreecommitdiff
path: root/drivers/regulator
diff options
context:
space:
mode:
authorDuje Mihanović <duje@dujemihanovic.xyz>2026-06-13 16:20:55 +0200
committerMark Brown <broonie@kernel.org>2026-09-25 18:46:08 +0100
commit3fe744bac408579c1d65e2d70b4c04d0c3818008 (patch)
treee57a4099ea75c48e9cc50615bf21eb78624d7f93 /drivers/regulator
parent9048d2416b0923e88c07db585fd47034c6b95dad (diff)
downloadlinux-next-3fe744bac408579c1d65e2d70b4c04d0c3818008.tar.gz
linux-next-3fe744bac408579c1d65e2d70b4c04d0c3818008.zip
regulator: 88pm886: Add Vbus regulator
Add support for the PMIC's Vbus regulator. This regulator is mandatory for USB OTG support on boards using the PMIC. Reviewed-by: Karel Balej <balejk@matfyz.cz> Signed-off-by: Duje Mihanović <duje@dujemihanovic.xyz> Link: https://patch.msgid.link/20260613-88pm886-vbus-v2-3-021dfb02c6bb@dujemihanovic.xyz Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/88pm886-regulator.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/regulator/88pm886-regulator.c b/drivers/regulator/88pm886-regulator.c
index 7328cd1cf265..1961a7968982 100644
--- a/drivers/regulator/88pm886-regulator.c
+++ b/drivers/regulator/88pm886-regulator.c
@@ -337,6 +337,25 @@ static struct regulator_desc pm886_regulators[] = {
},
};
+static const struct linear_range pm886_vbus_volt_ranges[] = {
+ REGULATOR_LINEAR_RANGE(3750000, 0, 7, 250000)
+};
+
+static struct regulator_desc pm886_vbus_regulator = {
+ .name = "vbus",
+ .regulators_node = "regulators",
+ .of_match = "vbus",
+ .ops = &pm886_buck_ops,
+ .type = REGULATOR_VOLTAGE,
+ .n_voltages = 8,
+ .linear_ranges = pm886_vbus_volt_ranges,
+ .n_linear_ranges = ARRAY_SIZE(pm886_vbus_volt_ranges),
+ .vsel_reg = PM886_REG_BOOST_CONFIG1,
+ .vsel_mask = PM886_REG_BOOST_MASK,
+ .enable_reg = PM886_REG_BATTERY_CONFIG1,
+ .enable_mask = PM886_REG_VBUS_EN,
+};
+
static int pm886_regulator_probe(struct platform_device *pdev)
{
struct pm886_chip *chip = dev_get_drvdata(pdev->dev.parent);
@@ -369,6 +388,13 @@ static int pm886_regulator_probe(struct platform_device *pdev)
"Failed to register %s\n", rdesc->name);
}
+ rcfg.regmap = chip->regmap_battery;
+ rdesc = &pm886_vbus_regulator;
+ rdev = devm_regulator_register(dev, rdesc, &rcfg);
+ if (IS_ERR(rdev))
+ return dev_err_probe(dev, PTR_ERR(rdev),
+ "Failed to register %s\n", rdesc->name);
+
return 0;
}