aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mfd
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2008-10-10 10:58:06 -0400
committerLiam Girdwood <lrg@slimlogic.co.uk>2008-10-13 16:51:54 -0400
commitf8ea79c2ab39513e90054ed2828a85759d979bfa (patch)
treec74a7503694853cf57e94e7d3041585405668949 /include/linux/mfd
parent03c127ee1e0c5f7a5285d1af3d5c1571ac2646a1 (diff)
mfd: Add WM8350 PMU register definitions
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Samuel Ortiz <sameo@openedhand.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'include/linux/mfd')
-rw-r--r--include/linux/mfd/wm8350/supply.h105
1 files changed, 105 insertions, 0 deletions
diff --git a/include/linux/mfd/wm8350/supply.h b/include/linux/mfd/wm8350/supply.h
new file mode 100644
index 000000000000..f1d4317cf022
--- /dev/null
+++ b/include/linux/mfd/wm8350/supply.h
@@ -0,0 +1,105 @@
1/*
2 * supply.h -- Power Supply Driver for Wolfson WM8350 PMIC
3 *
4 * Copyright 2007 Wolfson Microelectronics PLC
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 *
11 */
12
13#ifndef __LINUX_MFD_WM8350_SUPPLY_H_
14#define __LINUX_MFD_WM8350_SUPPLY_H_
15
16/*
17 * Charger registers
18 */
19#define WM8350_BATTERY_CHARGER_CONTROL_1 0xA8
20#define WM8350_BATTERY_CHARGER_CONTROL_2 0xA9
21#define WM8350_BATTERY_CHARGER_CONTROL_3 0xAA
22
23/*
24 * R168 (0xA8) - Battery Charger Control 1
25 */
26#define WM8350_CHG_ENA_R168 0x8000
27#define WM8350_CHG_THR 0x2000
28#define WM8350_CHG_EOC_SEL_MASK 0x1C00
29#define WM8350_CHG_TRICKLE_TEMP_CHOKE 0x0200
30#define WM8350_CHG_TRICKLE_USB_CHOKE 0x0100
31#define WM8350_CHG_RECOVER_T 0x0080
32#define WM8350_CHG_END_ACT 0x0040
33#define WM8350_CHG_FAST 0x0020
34#define WM8350_CHG_FAST_USB_THROTTLE 0x0010
35#define WM8350_CHG_NTC_MON 0x0008
36#define WM8350_CHG_BATT_HOT_MON 0x0004
37#define WM8350_CHG_BATT_COLD_MON 0x0002
38#define WM8350_CHG_CHIP_TEMP_MON 0x0001
39
40/*
41 * R169 (0xA9) - Battery Charger Control 2
42 */
43#define WM8350_CHG_ACTIVE 0x8000
44#define WM8350_CHG_PAUSE 0x4000
45#define WM8350_CHG_STS_MASK 0x3000
46#define WM8350_CHG_TIME_MASK 0x0F00
47#define WM8350_CHG_MASK_WALL_FB 0x0080
48#define WM8350_CHG_TRICKLE_SEL 0x0040
49#define WM8350_CHG_VSEL_MASK 0x0030
50#define WM8350_CHG_ISEL_MASK 0x000F
51#define WM8350_CHG_STS_OFF 0x0000
52#define WM8350_CHG_STS_TRICKLE 0x1000
53#define WM8350_CHG_STS_FAST 0x2000
54
55/*
56 * R170 (0xAA) - Battery Charger Control 3
57 */
58#define WM8350_CHG_THROTTLE_T_MASK 0x0060
59#define WM8350_CHG_SMART 0x0010
60#define WM8350_CHG_TIMER_ADJT_MASK 0x000F
61
62/*
63 * Charger Interrupts
64 */
65#define WM8350_IRQ_CHG_BAT_HOT 0
66#define WM8350_IRQ_CHG_BAT_COLD 1
67#define WM8350_IRQ_CHG_BAT_FAIL 2
68#define WM8350_IRQ_CHG_TO 3
69#define WM8350_IRQ_CHG_END 4
70#define WM8350_IRQ_CHG_START 5
71#define WM8350_IRQ_CHG_FAST_RDY 6
72#define WM8350_IRQ_CHG_VBATT_LT_3P9 10
73#define WM8350_IRQ_CHG_VBATT_LT_3P1 11
74#define WM8350_IRQ_CHG_VBATT_LT_2P85 12
75
76/*
77 * Charger Policy
78 */
79#define WM8350_CHG_TRICKLE_50mA (0 << 6)
80#define WM8350_CHG_TRICKLE_100mA (1 << 6)
81#define WM8350_CHG_4_05V (0 << 4)
82#define WM8350_CHG_4_10V (1 << 4)
83#define WM8350_CHG_4_15V (2 << 4)
84#define WM8350_CHG_4_20V (3 << 4)
85#define WM8350_CHG_FAST_LIMIT_mA(x) ((x / 50) & 0xf)
86#define WM8350_CHG_EOC_mA(x) (((x - 10) & 0x7) << 10)
87#define WM8350_CHG_TRICKLE_3_1V (0 << 13)
88#define WM8350_CHG_TRICKLE_3_9V (1 << 13)
89
90/*
91 * Supply Registers.
92 */
93#define WM8350_USB_VOLTAGE_READBACK 0x9C
94#define WM8350_LINE_VOLTAGE_READBACK 0x9D
95#define WM8350_BATT_VOLTAGE_READBACK 0x9E
96
97/*
98 * Supply Interrupts.
99 */
100#define WM8350_IRQ_USB_LIMIT 15
101#define WM8350_IRQ_EXT_USB_FB 36
102#define WM8350_IRQ_EXT_WALL_FB 37
103#define WM8350_IRQ_EXT_BAT_FB 38
104
105#endif