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.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/driver/charger/sm5803.h b/driver/charger/sm5803.h
index 79dbd55129..e1a3e10560 100644
--- a/driver/charger/sm5803.h
+++ b/driver/charger/sm5803.h
@@ -8,6 +8,8 @@
#ifndef __CROS_EC_SM5803_H
#define __CROS_EC_SM5803_H
+#include "common.h"
+
/* Note: configure charger struct with CHARGER_FLAGS */
#define SM5803_ADDR_MAIN_FLAGS 0x30
#define SM5803_ADDR_MEAS_FLAGS 0x31
@@ -132,6 +134,8 @@ enum sm5803_gpio0_modes {
/* Note: Threshold registers all assume lower 2 bits are 0 */
#define SM5803_REG_VBUS_LOW_TH 0x1A
#define SM5803_REG_VBUS_HIGH_TH 0x2A
+#define SM5803_REG_VCHG_PWR_LOW_TH 0x1B
+#define SM5803_REG_VCHG_PWR_HIGH_TH 0x2B
#define SM5803_REG_TINT_LOW_TH 0x1D
#define SM5803_REG_TINT_HIGH_TH 0x2D
@@ -172,6 +176,9 @@ enum sm5803_gpio0_modes {
#define SM5803_VBUS_MEAS_OV_TEMP BIT(5)
#define SM5803_VBUS_MEAS_CHG_DET BIT(6)
+/* VCHGPWR levels - The VCHGPWR levels increment in 23.4mV steps. */
+#define SM5803_REG_VCHG_PWR_MSB 0x4A
+
#define SM5803_REG_TINT_MEAS_MSB 0x4E
/* VSYS levels - The VSYS levels increment in 23.4mV steps. */
@@ -382,6 +389,15 @@ enum ec_error_list sm5803_vbus_sink_enable(int chgnum, int enable);
void sm5803_hibernate(int chgnum);
void sm5803_interrupt(int chgnum);
+/**
+ * Return whether ACOK is high or low.
+ *
+ * @param chgnum index into chg_chips table.
+ * @param acok will be set to true if ACOK is asserted, otherwise false.
+ * @return EC_SUCCESS, error otherwise.
+ */
+enum ec_error_list sm5803_is_acok(int chgnum, bool *acok);
+
/* Expose low power mode functions */
void sm5803_disable_low_power_mode(int chgnum);
void sm5803_enable_low_power_mode(int chgnum);