summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAlexander Kurz <akurz@blala.de>2016-11-04 10:19:06 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2016-11-07 08:54:31 +0100
commita3390e16ed1cc99cf076cca722bf638f72486752 (patch)
tree58f6b2d9201d1e25b6ddd7a8361d387ac2b2d221 /include
parent86b716c06ae2e6fde05c881e9e7c597211f32afa (diff)
downloadbarebox-a3390e16ed1cc99cf076cca722bf638f72486752.tar.gz
barebox-a3390e16ed1cc99cf076cca722bf638f72486752.tar.xz
mfd: mc13892: more descriptive charger register defines
Make access to the mc13892 charger parameter voltage, current and max power dissipation readable in terms of millivolts, milliamps and milliwatts. Signed-off-by: Alexander Kurz <akurz@blala.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/mfd/mc13892.h40
1 files changed, 31 insertions, 9 deletions
diff --git a/include/mfd/mc13892.h b/include/mfd/mc13892.h
index c92a462445..8b522391b0 100644
--- a/include/mfd/mc13892.h
+++ b/include/mfd/mc13892.h
@@ -29,21 +29,43 @@
/* REG_CHARGE */
-#define MC13782_CHARGE_VCHRG0 (1 << 0)
-#define MC13782_CHARGE_VCHRG1 (1 << 1)
-#define MC13782_CHARGE_VCHRG2 (1 << 2)
-#define MC13782_CHARGE_ICHRG0 (1 << 3)
-#define MC13782_CHARGE_ICHRG1 (1 << 4)
-#define MC13782_CHARGE_ICHRG2 (1 << 5)
-#define MC13782_CHARGE_ICHRG3 (1 << 6)
+#define MC13782_CHARGE_VCHRG_3800 (0 << 0)
+#define MC13782_CHARGE_VCHRG_4100 (1 << 0)
+#define MC13782_CHARGE_VCHRG_4150 (2 << 0)
+#define MC13782_CHARGE_VCHRG_4200 (3 << 0)
+#define MC13782_CHARGE_VCHRG_4250 (4 << 0)
+#define MC13782_CHARGE_VCHRG_4300 (5 << 0)
+#define MC13782_CHARGE_VCHRG_4375 (6 << 0)
+#define MC13782_CHARGE_VCHRG_4450 (7 << 0)
+#define MC13782_CHARGE_VCHRG_MASK (7 << 0)
+#define MC13782_CHARGE_ICHRG_0 (0 << 3)
+#define MC13782_CHARGE_ICHRG_80 (1 << 3)
+#define MC13782_CHARGE_ICHRG_240 (2 << 3)
+#define MC13782_CHARGE_ICHRG_320 (3 << 3)
+#define MC13782_CHARGE_ICHRG_400 (4 << 3)
+#define MC13782_CHARGE_ICHRG_480 (5 << 3)
+#define MC13782_CHARGE_ICHRG_560 (6 << 3)
+#define MC13782_CHARGE_ICHRG_640 (7 << 3)
+#define MC13782_CHARGE_ICHRG_720 (8 << 3)
+#define MC13782_CHARGE_ICHRG_800 (9 << 3)
+#define MC13782_CHARGE_ICHRG_880 (10 << 3)
+#define MC13782_CHARGE_ICHRG_960 (11 << 3)
+#define MC13782_CHARGE_ICHRG_1040 (12 << 3)
+#define MC13782_CHARGE_ICHRG_1200 (13 << 3)
+#define MC13782_CHARGE_ICHRG_1600 (14 << 3)
+#define MC13782_CHARGE_ICHRG_FULL (15 << 3)
+#define MC13782_CHARGE_ICHRG_MASK (15 << 3)
#define MC13782_CHARGE_TREN (1 << 7)
#define MC13782_CHARGE_ACKLPB (1 << 8)
#define MC13782_CHARGE_THCHKB (1 << 9)
#define MC13782_CHARGE_FETOVRD (1 << 10)
#define MC13782_CHARGE_FETCTRL (1 << 11)
#define MC13782_CHARGE_RVRSMODE (1 << 13)
-#define MC13782_CHARGE_PLIM0 (1 << 15)
-#define MC13782_CHARGE_PLIM1 (1 << 16)
+#define MC13782_CHARGE_PLIM_600 (0 << 15)
+#define MC13782_CHARGE_PLIM_800 (1 << 15)
+#define MC13782_CHARGE_PLIM_1000 (2 << 15)
+#define MC13782_CHARGE_PLIM_1200 (3 << 15)
+#define MC13782_CHARGE_PLIM_MASK (3 << 15)
#define MC13782_CHARGE_PLIMDIS (1 << 17)
#define MC13782_CHARGE_CHRGLEDEN (1 << 18)
#define MC13782_CHARGE_CHGTMRRST (1 << 19)