summaryrefslogtreecommitdiff
path: root/driver/charger/isl923x.h
diff options
context:
space:
mode:
Diffstat (limited to 'driver/charger/isl923x.h')
-rw-r--r--driver/charger/isl923x.h144
1 files changed, 72 insertions, 72 deletions
diff --git a/driver/charger/isl923x.h b/driver/charger/isl923x.h
index 0de2a32ae5..e4ce34ee66 100644
--- a/driver/charger/isl923x.h
+++ b/driver/charger/isl923x.h
@@ -1,4 +1,4 @@
-/* Copyright 2015 The Chromium OS Authors. All rights reserved.
+/* Copyright 2015 The ChromiumOS Authors
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*
@@ -12,29 +12,29 @@
#include "driver/charger/isl923x_public.h"
/* Registers */
-#define ISL923X_REG_CHG_CURRENT 0x14
+#define ISL923X_REG_CHG_CURRENT 0x14
#define ISL923X_REG_ADAPTER_CURRENT_LIMIT1 0x3f
#define ISL923X_REG_ADAPTER_CURRENT_LIMIT2 0x3b
-#define ISL923X_REG_SYS_VOLTAGE_MAX 0x15
-#define ISL923X_REG_SYS_VOLTAGE_MIN 0x3e
-#define ISL923X_REG_PROCHOT_AC 0x47
-#define ISL923X_REG_PROCHOT_DC 0x48
-#define ISL923X_REG_T1_T2 0x38
-#define ISL923X_REG_CONTROL0 0x39
-#define ISL923X_REG_CONTROL1 0x3c
-#define ISL923X_REG_CONTROL2 0x3d
-#define ISL9238_REG_CONTROL3 0x4c
-#define ISL9238_REG_CONTROL4 0x4e
-#define ISL9238C_REG_CONTROL6 0x37
-#define ISL923X_REG_INFO 0x3a
-#define ISL9238_REG_INFO2 0x4d
-#define ISL923X_REG_OTG_VOLTAGE 0x49
-#define ISL923X_REG_OTG_CURRENT 0x4a
-#define ISL9238_REG_INPUT_VOLTAGE 0x4b
-#define ISL923X_REG_MANUFACTURER_ID 0xfe
-#define ISL923X_REG_DEVICE_ID 0xff
-#define RAA489000_REG_CONTROL8 0x37
-#define RAA489000_REG_CONTROL10 0x35
+#define ISL923X_REG_SYS_VOLTAGE_MAX 0x15
+#define ISL923X_REG_SYS_VOLTAGE_MIN 0x3e
+#define ISL923X_REG_PROCHOT_AC 0x47
+#define ISL923X_REG_PROCHOT_DC 0x48
+#define ISL923X_REG_T1_T2 0x38
+#define ISL923X_REG_CONTROL0 0x39
+#define ISL923X_REG_CONTROL1 0x3c
+#define ISL923X_REG_CONTROL2 0x3d
+#define ISL9238_REG_CONTROL3 0x4c
+#define ISL9238_REG_CONTROL4 0x4e
+#define ISL9238C_REG_CONTROL6 0x37
+#define ISL923X_REG_INFO 0x3a
+#define ISL9238_REG_INFO2 0x4d
+#define ISL923X_REG_OTG_VOLTAGE 0x49
+#define ISL923X_REG_OTG_CURRENT 0x4a
+#define ISL9238_REG_INPUT_VOLTAGE 0x4b
+#define ISL923X_REG_MANUFACTURER_ID 0xfe
+#define ISL923X_REG_DEVICE_ID 0xff
+#define RAA489000_REG_CONTROL8 0x37
+#define RAA489000_REG_CONTROL10 0x35
/* Sense resistor default values in mOhm */
#define ISL923X_DEFAULT_SENSE_RESISTOR_AC 20
@@ -48,18 +48,18 @@
#define ISL923X_T1_10000 0x00
#define ISL923X_T1_20000 0x01
#define ISL923X_T1_15000 0x02
-#define ISL923X_T1_5000 0x03
-#define ISL923X_T1_1000 0x04
-#define ISL923X_T1_500 0x05
-#define ISL923X_T1_100 0x06
-#define ISL923X_T1_0 0x07
-#define ISL923X_T2_10 (0x00 << 8)
-#define ISL923X_T2_100 (0x01 << 8)
-#define ISL923X_T2_500 (0x02 << 8)
-#define ISL923X_T2_1000 (0x03 << 8)
-#define ISL923X_T2_300 (0x04 << 8)
-#define ISL923X_T2_750 (0x05 << 8)
-#define ISL923X_T2_2000 (0x06 << 8)
+#define ISL923X_T1_5000 0x03
+#define ISL923X_T1_1000 0x04
+#define ISL923X_T1_500 0x05
+#define ISL923X_T1_100 0x06
+#define ISL923X_T1_0 0x07
+#define ISL923X_T2_10 (0x00 << 8)
+#define ISL923X_T2_100 (0x01 << 8)
+#define ISL923X_T2_500 (0x02 << 8)
+#define ISL923X_T2_1000 (0x03 << 8)
+#define ISL923X_T2_300 (0x04 << 8)
+#define ISL923X_T2_750 (0x05 << 8)
+#define ISL923X_T2_2000 (0x06 << 8)
#define ISL923X_T2_10000 (0x07 << 8)
#define ISL9237_SYS_VOLTAGE_REG_MAX 13824
@@ -69,19 +69,19 @@
#define RAA489000_SYS_VOLTAGE_REG_MIN 64
/* PROCHOT# debounce time and duration time in micro seconds */
-#define ISL923X_PROCHOT_DURATION_10000 (0 << 6)
-#define ISL923X_PROCHOT_DURATION_20000 BIT(6)
-#define ISL923X_PROCHOT_DURATION_15000 (2 << 6)
-#define ISL923X_PROCHOT_DURATION_5000 (3 << 6)
-#define ISL923X_PROCHOT_DURATION_1000 (4 << 6)
-#define ISL923X_PROCHOT_DURATION_500 (5 << 6)
+#define ISL923X_PROCHOT_DURATION_10000 (0 << 6)
+#define ISL923X_PROCHOT_DURATION_20000 BIT(6)
+#define ISL923X_PROCHOT_DURATION_15000 (2 << 6)
+#define ISL923X_PROCHOT_DURATION_5000 (3 << 6)
+#define ISL923X_PROCHOT_DURATION_1000 (4 << 6)
+#define ISL923X_PROCHOT_DURATION_500 (5 << 6)
#define ISL923X_PROCHOT_DURATION_100000 (6 << 6)
-#define ISL923X_PROCHOT_DURATION_0 (7 << 6)
-#define ISL923X_PROCHOT_DURATION_MASK (7 << 6)
+#define ISL923X_PROCHOT_DURATION_0 (7 << 6)
+#define ISL923X_PROCHOT_DURATION_MASK (7 << 6)
-#define ISL923X_PROCHOT_DEBOUNCE_10 (0 << 9)
-#define ISL923X_PROCHOT_DEBOUNCE_100 BIT(9)
-#define ISL923X_PROCHOT_DEBOUNCE_500 (2 << 9)
+#define ISL923X_PROCHOT_DEBOUNCE_10 (0 << 9)
+#define ISL923X_PROCHOT_DEBOUNCE_100 BIT(9)
+#define ISL923X_PROCHOT_DEBOUNCE_500 (2 << 9)
#define ISL923X_PROCHOT_DEBOUNCE_1000 (3 << 9)
#define ISL923X_PROCHOT_DEBOUNCE_MASK (3 << 9)
@@ -100,10 +100,10 @@
#define ISL923X_C0_DISABLE_VREG BIT(2)
/* Control0: battery DCHOT reference for RS2 == 20mOhm */
-#define ISL923X_C0_DCHOT_6A (0 << 3)
-#define ISL923X_C0_DCHOT_5A BIT(3)
-#define ISL923X_C0_DCHOT_4A (2 << 3)
-#define ISL923X_C0_DCHOT_3A (3 << 3)
+#define ISL923X_C0_DCHOT_6A (0 << 3)
+#define ISL923X_C0_DCHOT_5A BIT(3)
+#define ISL923X_C0_DCHOT_4A (2 << 3)
+#define ISL923X_C0_DCHOT_3A (3 << 3)
#define ISL923X_C0_DCHOT_MASK (3 << 3)
/* Control0: BGATE force on */
@@ -111,15 +111,15 @@
#define RAA489000_C0_EN_CHG_PUMPS_TO_100PCT BIT(6)
/* Control1: general purpose comparator debounce time in micro second */
-#define ISL923X_C1_GP_DEBOUNCE_2 (0 << 14)
-#define ISL923X_C1_GP_DEBOUNCE_12 BIT(14)
-#define ISL923X_C1_GP_DEBOUNCE_2000 (2 << 14)
+#define ISL923X_C1_GP_DEBOUNCE_2 (0 << 14)
+#define ISL923X_C1_GP_DEBOUNCE_12 BIT(14)
+#define ISL923X_C1_GP_DEBOUNCE_2000 (2 << 14)
#define ISL923X_C1_GP_DEBOUNCE_5000000 (3 << 14)
-#define ISL923X_C1_GP_DEBOUNCE_MASK (3 << 14)
+#define ISL923X_C1_GP_DEBOUNCE_MASK (3 << 14)
/* Control1: learn mode */
#define ISL923X_C1_LEARN_MODE_AUTOEXIT BIT(13)
-#define ISL923X_C1_LEARN_MODE_ENABLE BIT(12)
+#define ISL923X_C1_LEARN_MODE_ENABLE BIT(12)
/* Control1: OTG enable */
#define ISL923X_C1_OTG BIT(11)
@@ -161,15 +161,15 @@
#define RAA489000_C1_BGATE_FORCE_OFF BIT(6)
/* Control2: trickle charging current in mA */
-#define ISL923X_C2_TRICKLE_256 (0 << 14)
-#define ISL923X_C2_TRICKLE_128 BIT(14)
-#define ISL923X_C2_TRICKLE_64 (2 << 14)
-#define ISL923X_C2_TRICKLE_512 (3 << 14)
+#define ISL923X_C2_TRICKLE_256 (0 << 14)
+#define ISL923X_C2_TRICKLE_128 BIT(14)
+#define ISL923X_C2_TRICKLE_64 (2 << 14)
+#define ISL923X_C2_TRICKLE_512 (3 << 14)
#define ISL923X_C2_TRICKLE_MASK (3 << 14)
/* Control2: OTGEN debounce time in ms */
#define ISL923X_C2_OTG_DEBOUNCE_1300 (0 << 13)
-#define ISL923X_C2_OTG_DEBOUNCE_150 BIT(13)
+#define ISL923X_C2_OTG_DEBOUNCE_150 BIT(13)
#define ISL923X_C2_OTG_DEBOUNCE_MASK BIT(13)
/* Control2: 2-level adapter over current */
@@ -177,14 +177,14 @@
/* Control2: adapter insertion debounce time in ms */
#define ISL923X_C2_ADAPTER_DEBOUNCE_1300 (0 << 11)
-#define ISL923X_C2_ADAPTER_DEBOUNCE_150 BIT(11)
+#define ISL923X_C2_ADAPTER_DEBOUNCE_150 BIT(11)
#define ISL923X_C2_ADAPTER_DEBOUNCE_MASK BIT(11)
/* Control2: PROCHOT debounce time in uS */
-#define ISL9238_C2_PROCHOT_DEBOUNCE_7 (0 << 9)
-#define ISL9237_C2_PROCHOT_DEBOUNCE_10 (0 << 9)
-#define ISL923X_C2_PROCHOT_DEBOUNCE_100 BIT(9)
-#define ISL923X_C2_PROCHOT_DEBOUNCE_500 (2 << 9)
+#define ISL9238_C2_PROCHOT_DEBOUNCE_7 (0 << 9)
+#define ISL9237_C2_PROCHOT_DEBOUNCE_10 (0 << 9)
+#define ISL923X_C2_PROCHOT_DEBOUNCE_100 BIT(9)
+#define ISL923X_C2_PROCHOT_DEBOUNCE_500 (2 << 9)
#define ISL923X_C2_PROCHOT_DEBOUNCE_1000 (3 << 9)
#define ISL923X_C2_PROCHOT_DEBOUNCE_MASK (3 << 9)
@@ -192,12 +192,12 @@
#define ISL923X_C2_PROCHOT_DURATION_10000 (0 << 6)
#define ISL923X_C2_PROCHOT_DURATION_20000 BIT(6)
#define ISL923X_C2_PROCHOT_DURATION_15000 (2 << 6)
-#define ISL923X_C2_PROCHOT_DURATION_5000 (3 << 6)
-#define ISL923X_C2_PROCHOT_DURATION_1000 (4 << 6)
-#define ISL923X_C2_PROCHOT_DURATION_500 (5 << 6)
-#define ISL923X_C2_PROCHOT_DURATION_100 (6 << 6)
-#define ISL923X_C2_PROCHOT_DURATION_0 (7 << 6)
-#define ISL923X_C2_PROCHOT_DURATION_MASK (7 << 6)
+#define ISL923X_C2_PROCHOT_DURATION_5000 (3 << 6)
+#define ISL923X_C2_PROCHOT_DURATION_1000 (4 << 6)
+#define ISL923X_C2_PROCHOT_DURATION_500 (5 << 6)
+#define ISL923X_C2_PROCHOT_DURATION_100 (6 << 6)
+#define ISL923X_C2_PROCHOT_DURATION_0 (7 << 6)
+#define ISL923X_C2_PROCHOT_DURATION_MASK (7 << 6)
/* Control2: turn off ASGATE in OTG mode */
#define ISL923X_C2_ASGATE_OFF BIT(5)
@@ -346,7 +346,7 @@ enum isl9237_fsm_state {
#define I2C_ADDR_CHARGER_FLAGS ISL923X_ADDR_FLAGS
-#define ISL923X_AC_PROCHOT_CURRENT_MAX 6400 /* mA */
-#define ISL923X_DC_PROCHOT_CURRENT_MAX 12800 /* mA */
+#define ISL923X_AC_PROCHOT_CURRENT_MAX 6400 /* mA */
+#define ISL923X_DC_PROCHOT_CURRENT_MAX 12800 /* mA */
#endif /* __CROS_EC_ISL923X_H */