aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mfd/wm8350
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2008-10-10 10:58:04 -0400
committerLiam Girdwood <lrg@slimlogic.co.uk>2008-10-13 16:51:53 -0400
commit0c42e0b7631f1bfccc27eedac2a1e03f4c8c824c (patch)
treeabfae8d4482e0a707931152d03bab2c1a4c01140 /include/linux/mfd/wm8350
parent06532c474718e330a7e3625ef91b94e22991128c (diff)
mfd: Add WM8350 GPIO 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/wm8350')
-rw-r--r--include/linux/mfd/wm8350/gpio.h326
1 files changed, 326 insertions, 0 deletions
diff --git a/include/linux/mfd/wm8350/gpio.h b/include/linux/mfd/wm8350/gpio.h
new file mode 100644
index 000000000000..928aa6e91e36
--- /dev/null
+++ b/include/linux/mfd/wm8350/gpio.h
@@ -0,0 +1,326 @@
1/*
2 * gpio.h -- GPIO 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_GPIO_H_
14#define __LINUX_MFD_WM8350_GPIO_H_
15
16/*
17 * GPIO Registers.
18 */
19#define WM8350_GPIO_DEBOUNCE 0x80
20#define WM8350_GPIO_PIN_PULL_UP_CONTROL 0x81
21#define WM8350_GPIO_PULL_DOWN_CONTROL 0x82
22#define WM8350_GPIO_INT_MODE 0x83
23#define WM8350_GPIO_CONTROL 0x85
24#define WM8350_GPIO_CONFIGURATION_I_O 0x86
25#define WM8350_GPIO_PIN_POLARITY_TYPE 0x87
26#define WM8350_GPIO_FUNCTION_SELECT_1 0x8C
27#define WM8350_GPIO_FUNCTION_SELECT_2 0x8D
28#define WM8350_GPIO_FUNCTION_SELECT_3 0x8E
29#define WM8350_GPIO_FUNCTION_SELECT_4 0x8F
30
31/*
32 * GPIO Functions
33 */
34#define WM8350_GPIO0_GPIO_IN 0x0
35#define WM8350_GPIO0_GPIO_OUT 0x0
36#define WM8350_GPIO0_PWR_ON_IN 0x1
37#define WM8350_GPIO0_PWR_ON_OUT 0x1
38#define WM8350_GPIO0_LDO_EN_IN 0x2
39#define WM8350_GPIO0_VRTC_OUT 0x2
40#define WM8350_GPIO0_LPWR1_IN 0x3
41#define WM8350_GPIO0_POR_B_OUT 0x3
42
43#define WM8350_GPIO1_GPIO_IN 0x0
44#define WM8350_GPIO1_GPIO_OUT 0x0
45#define WM8350_GPIO1_PWR_ON_IN 0x1
46#define WM8350_GPIO1_DO_CONF_OUT 0x1
47#define WM8350_GPIO1_LDO_EN_IN 0x2
48#define WM8350_GPIO1_RESET_OUT 0x2
49#define WM8350_GPIO1_LPWR2_IN 0x3
50#define WM8350_GPIO1_MEMRST_OUT 0x3
51
52#define WM8350_GPIO2_GPIO_IN 0x0
53#define WM8350_GPIO2_GPIO_OUT 0x0
54#define WM8350_GPIO2_PWR_ON_IN 0x1
55#define WM8350_GPIO2_PWR_ON_OUT 0x1
56#define WM8350_GPIO2_WAKE_UP_IN 0x2
57#define WM8350_GPIO2_VRTC_OUT 0x2
58#define WM8350_GPIO2_32KHZ_IN 0x3
59#define WM8350_GPIO2_32KHZ_OUT 0x3
60
61#define WM8350_GPIO3_GPIO_IN 0x0
62#define WM8350_GPIO3_GPIO_OUT 0x0
63#define WM8350_GPIO3_PWR_ON_IN 0x1
64#define WM8350_GPIO3_P_CLK_OUT 0x1
65#define WM8350_GPIO3_LDO_EN_IN 0x2
66#define WM8350_GPIO3_VRTC_OUT 0x2
67#define WM8350_GPIO3_PWR_OFF_IN 0x3
68#define WM8350_GPIO3_32KHZ_OUT 0x3
69
70#define WM8350_GPIO4_GPIO_IN 0x0
71#define WM8350_GPIO4_GPIO_OUT 0x0
72#define WM8350_GPIO4_MR_IN 0x1
73#define WM8350_GPIO4_MEM_RST_OUT 0x1
74#define WM8350_GPIO4_FLASH_IN 0x2
75#define WM8350_GPIO4_ADA_OUT 0x2
76#define WM8350_GPIO4_HIBERNATE_IN 0x3
77#define WM8350_GPIO4_FLASH_OUT 0x3
78#define WM8350_GPIO4_MICDET_OUT 0x4
79#define WM8350_GPIO4_MICSHT_OUT 0x5
80
81#define WM8350_GPIO5_GPIO_IN 0x0
82#define WM8350_GPIO5_GPIO_OUT 0x0
83#define WM8350_GPIO5_LPWR1_IN 0x1
84#define WM8350_GPIO5_P_CLK_OUT 0x1
85#define WM8350_GPIO5_ADCLRCLK_IN 0x2
86#define WM8350_GPIO5_ADCLRCLK_OUT 0x2
87#define WM8350_GPIO5_HIBERNATE_IN 0x3
88#define WM8350_GPIO5_32KHZ_OUT 0x3
89#define WM8350_GPIO5_MICDET_OUT 0x4
90#define WM8350_GPIO5_MICSHT_OUT 0x5
91#define WM8350_GPIO5_ADA_OUT 0x6
92#define WM8350_GPIO5_OPCLK_OUT 0x7
93
94#define WM8350_GPIO6_GPIO_IN 0x0
95#define WM8350_GPIO6_GPIO_OUT 0x0
96#define WM8350_GPIO6_LPWR2_IN 0x1
97#define WM8350_GPIO6_MEMRST_OUT 0x1
98#define WM8350_GPIO6_FLASH_IN 0x2
99#define WM8350_GPIO6_ADA_OUT 0x2
100#define WM8350_GPIO6_HIBERNATE_IN 0x3
101#define WM8350_GPIO6_RTC_OUT 0x3
102#define WM8350_GPIO6_MICDET_OUT 0x4
103#define WM8350_GPIO6_MICSHT_OUT 0x5
104#define WM8350_GPIO6_ADCLRCLKB_OUT 0x6
105#define WM8350_GPIO6_SDOUT_OUT 0x7
106
107#define WM8350_GPIO7_GPIO_IN 0x0
108#define WM8350_GPIO7_GPIO_OUT 0x0
109#define WM8350_GPIO7_LPWR3_IN 0x1
110#define WM8350_GPIO7_P_CLK_OUT 0x1
111#define WM8350_GPIO7_MASK_IN 0x2
112#define WM8350_GPIO7_VCC_FAULT_OUT 0x2
113#define WM8350_GPIO7_HIBERNATE_IN 0x3
114#define WM8350_GPIO7_BATT_FAULT_OUT 0x3
115#define WM8350_GPIO7_MICDET_OUT 0x4
116#define WM8350_GPIO7_MICSHT_OUT 0x5
117#define WM8350_GPIO7_ADA_OUT 0x6
118#define WM8350_GPIO7_CSB_IN 0x7
119
120#define WM8350_GPIO8_GPIO_IN 0x0
121#define WM8350_GPIO8_GPIO_OUT 0x0
122#define WM8350_GPIO8_MR_IN 0x1
123#define WM8350_GPIO8_VCC_FAULT_OUT 0x1
124#define WM8350_GPIO8_ADCBCLK_IN 0x2
125#define WM8350_GPIO8_ADCBCLK_OUT 0x2
126#define WM8350_GPIO8_PWR_OFF_IN 0x3
127#define WM8350_GPIO8_BATT_FAULT_OUT 0x3
128#define WM8350_GPIO8_ALTSCL_IN 0xf
129
130#define WM8350_GPIO9_GPIO_IN 0x0
131#define WM8350_GPIO9_GPIO_OUT 0x0
132#define WM8350_GPIO9_HEARTBEAT_IN 0x1
133#define WM8350_GPIO9_VCC_FAULT_OUT 0x1
134#define WM8350_GPIO9_MASK_IN 0x2
135#define WM8350_GPIO9_LINE_GT_BATT_OUT 0x2
136#define WM8350_GPIO9_PWR_OFF_IN 0x3
137#define WM8350_GPIO9_BATT_FAULT_OUT 0x3
138#define WM8350_GPIO9_ALTSDA_OUT 0xf
139
140#define WM8350_GPIO10_GPIO_IN 0x0
141#define WM8350_GPIO10_GPIO_OUT 0x0
142#define WM8350_GPIO10_ISINKC_OUT 0x1
143#define WM8350_GPIO10_PWR_OFF_IN 0x2
144#define WM8350_GPIO10_LINE_GT_BATT_OUT 0x2
145#define WM8350_GPIO10_CHD_IND_IN 0x3
146
147#define WM8350_GPIO11_GPIO_IN 0x0
148#define WM8350_GPIO11_GPIO_OUT 0x0
149#define WM8350_GPIO11_ISINKD_OUT 0x1
150#define WM8350_GPIO11_WAKEUP_IN 0x2
151#define WM8350_GPIO11_LINE_GT_BATT_OUT 0x2
152#define WM8350_GPIO11_CHD_IND_IN 0x3
153
154#define WM8350_GPIO12_GPIO_IN 0x0
155#define WM8350_GPIO12_GPIO_OUT 0x0
156#define WM8350_GPIO12_ISINKE_OUT 0x1
157#define WM8350_GPIO12_LINE_GT_BATT_OUT 0x2
158#define WM8350_GPIO12_LINE_EN_OUT 0x3
159#define WM8350_GPIO12_32KHZ_OUT 0x4
160
161#define WM8350_GPIO_DIR_IN 0
162#define WM8350_GPIO_DIR_OUT 1
163#define WM8350_GPIO_ACTIVE_LOW 0
164#define WM8350_GPIO_ACTIVE_HIGH 1
165#define WM8350_GPIO_PULL_NONE 0
166#define WM8350_GPIO_PULL_UP 1
167#define WM8350_GPIO_PULL_DOWN 2
168#define WM8350_GPIO_INVERT_OFF 0
169#define WM8350_GPIO_INVERT_ON 1
170#define WM8350_GPIO_DEBOUNCE_OFF 0
171#define WM8350_GPIO_DEBOUNCE_ON 1
172
173/*
174 * R128 (0x80) - GPIO Debounce
175 */
176#define WM8350_GP12_DB 0x1000
177#define WM8350_GP11_DB 0x0800
178#define WM8350_GP10_DB 0x0400
179#define WM8350_GP9_DB 0x0200
180#define WM8350_GP8_DB 0x0100
181#define WM8350_GP7_DB 0x0080
182#define WM8350_GP6_DB 0x0040
183#define WM8350_GP5_DB 0x0020
184#define WM8350_GP4_DB 0x0010