build/patch/kernel/archive/sunxi-6.5/patches.megous/regulator-axp20x-Enable-over-temperature-protection-and-16s-res.patch

42 lines
1.3 KiB
Diff

From f73fce2320b55d8dcd4b3faa53f2e7472e6bf6c2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Tue, 18 Feb 2020 23:57:20 +0100
Subject: [PATCH 224/464] regulator: axp20x: Enable over-temperature protection
and 16s reset function
Why not? Also why here, but whatever.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
drivers/regulator/axp20x-regulator.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/regulator/axp20x-regulator.c b/drivers/regulator/axp20x-regulator.c
index 810f90f3e2a1..62ade1caf8bc 100644
--- a/drivers/regulator/axp20x-regulator.c
+++ b/drivers/regulator/axp20x-regulator.c
@@ -93,6 +93,8 @@
#define AXP22X_WORKMODE_DCDCX_MASK(x) BIT_MASK(x)
#define AXP22X_MISC_N_VBUSEN_FUNC BIT(4)
+#define AXP22X_MISC_16S_RESET_FUNC BIT(3)
+#define AXP22X_MISC_OTP BIT(2)
#define AXP22X_DCDC1_V_OUT_MASK GENMASK(4, 0)
#define AXP22X_DCDC2_V_OUT_MASK GENMASK(5, 0)
@@ -1631,6 +1633,11 @@ static int axp20x_regulator_probe(struct platform_device *pdev)
}
}
+ // enable 16s power-on reset and over-temperature protection
+ regmap_update_bits(axp20x->regmap, AXP20X_OVER_TMP,
+ AXP22X_MISC_16S_RESET_FUNC | AXP22X_MISC_OTP,
+ AXP22X_MISC_16S_RESET_FUNC | AXP22X_MISC_OTP);
+
return 0;
}
--
2.34.1