summaryrefslogtreecommitdiff
path: root/driver/charger/sm5803.h
diff options
context:
space:
mode:
Diffstat (limited to 'driver/charger/sm5803.h')
-rw-r--r--driver/charger/sm5803.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/driver/charger/sm5803.h b/driver/charger/sm5803.h
index e1a3e10560..b7638411e4 100644
--- a/driver/charger/sm5803.h
+++ b/driver/charger/sm5803.h
@@ -95,6 +95,9 @@
#define SM5803_GPIO0_OPEN_DRAIN_EN BIT(6)
#define SM5803_CHG_DET_OPEN_DRAIN_EN BIT(7)
+#define SM5803_REG_VBATSNSP_MEAS_MSB 0x40
+#define SM5803_REG_VBATSNSP_MEAS_LSB 0x41
+
enum sm5803_gpio0_modes {
GPIO0_MODE_PROCHOT,
GPIO0_MODE_OUTPUT,
@@ -133,6 +136,7 @@ enum sm5803_gpio0_modes {
/* Note: Threshold registers all assume lower 2 bits are 0 */
#define SM5803_REG_VBUS_LOW_TH 0x1A
+#define SM5803_REG_VBATSNSP_MAX_TH 0x26
#define SM5803_REG_VBUS_HIGH_TH 0x2A
#define SM5803_REG_VCHG_PWR_LOW_TH 0x1B
#define SM5803_REG_VCHG_PWR_HIGH_TH 0x2B
@@ -146,6 +150,8 @@ enum sm5803_gpio0_modes {
#define SM5803_VBUS_LOW_LEVEL 0x25
#define SM5803_VBUS_HIGH_LEVEL 0x2C
+
+
/*
* TINT thresholds. TINT steps are in 0.43 K with the upper threshold set to
* 360 K and lower threshold to de-assert PROCHOT at 330 K.
@@ -156,6 +162,22 @@ enum sm5803_gpio0_modes {
#define SM5803_TINT_MAX_LEVEL 0xFF
#define SM5803_TINT_MIN_LEVEL 0x00
+/*
+ * Set minimum thresholds for VBUS_PWR_LOW_TH interrupt generation
+ * 2S battery 9.4v
+ * 3S battery 14.1V VBUS_PWR MIN TH
+ */
+#define SM5803_VBAT_PWR_MINTH_3S_LEVEL 0x9B
+#define SM5803_VBAT_PWR_MINTH_2S_LEVEL 0x9B
+
+/*
+ * Set thresholds for VBATSNSP_MAX_TH GPADC interrupt generation
+ * 2S battery 9v
+ * 3S battery 13.3V
+ */
+#define SM5803_VBAT_SNSP_MAXTH_3S_LEVEL 0xD8
+#define SM5803_VBAT_SNSP_MAXTH_2S_LEVEL 0xDC
+
/* IBAT levels - The IBAT levels increment in 7.32mA */
#define SM5803_REG_IBAT_CHG_MEAS_MSB 0x44
#define SM5803_REG_IBAT_CHG_MEAS_LSB 0x45