55 lines
1.8 KiB
Diff
55 lines
1.8 KiB
Diff
From 53ff295b591ae969a6a4afe3a825440626d9c7f8 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
|
|
Date: Tue, 9 Jun 2020 22:00:36 +0200
|
|
Subject: [PATCH 208/391] regulator: axp20x: Turn N_VBUSEN to input on
|
|
x-powers,sense-vbus-en
|
|
|
|
When x-powers,sense-vbus-en is present on the PMIC DT node, force
|
|
the N_VBUSEN to be an input. This is necessary on boards that
|
|
have N_VBUSEN connected to VBUS enabling switch to make PMIC
|
|
not charge when the board is generating VBUS voltage itself.
|
|
|
|
Signed-off-by: Ondrej Jirman <megi@xff.cz>
|
|
---
|
|
.../arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts | 4 ++++
|
|
drivers/regulator/axp20x-regulator.c | 8 ++++++++
|
|
2 files changed, 12 insertions(+)
|
|
|
|
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts
|
|
index c4e3547e0..ec4927dfe 100644
|
|
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts
|
|
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts
|
|
@@ -15,6 +15,10 @@ wifi_pwrseq: wifi-pwrseq {
|
|
};
|
|
};
|
|
|
|
+&axp803 {
|
|
+ x-powers,sense-vbus-en;
|
|
+};
|
|
+
|
|
&backlight {
|
|
power-supply = <®_ldo_io0>;
|
|
lth-brightness = <10>;
|
|
diff --git a/drivers/regulator/axp20x-regulator.c b/drivers/regulator/axp20x-regulator.c
|
|
index 7017eee0c..21752e4bf 100644
|
|
--- a/drivers/regulator/axp20x-regulator.c
|
|
+++ b/drivers/regulator/axp20x-regulator.c
|
|
@@ -1344,6 +1344,14 @@ static int axp20x_regulator_probe(struct platform_device *pdev)
|
|
&dcdc5_name);
|
|
}
|
|
|
|
+ if (!drivevbus &&
|
|
+ of_property_read_bool(pdev->dev.parent->of_node, "x-powers,sense-vbus-en")) {
|
|
+ /* make N_VBUSEN an input */
|
|
+ regmap_update_bits(axp20x->regmap, AXP20X_OVER_TMP,
|
|
+ AXP22X_MISC_N_VBUSEN_FUNC,
|
|
+ AXP22X_MISC_N_VBUSEN_FUNC);
|
|
+ }
|
|
+
|
|
if (drivevbus) {
|
|
struct regulator_desc *new_desc;
|
|
bool drivevbus_vin = false;
|
|
--
|
|
2.35.3
|
|
|