aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mfd
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2012-02-20 15:42:24 -0500
committerSamuel Ortiz <sameo@linux.intel.com>2012-03-06 12:46:43 -0500
commitd6255529b2639de542324f314b93939b7996a7c5 (patch)
tree42230a2b9e8f02382735be716973677545e204b9 /include/linux/mfd
parent2ced445e2ddf65f484a489161accddf475676965 (diff)
mfd: Support AB9540 ab8500 variant
The AB9540 variant of the AB8500 is basically close enough to use the same driver. This adds the new registers and deviations for this new chip variant. Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Maxime Coquelin <maxime.coquelin@stericsson.com> Signed-off-by: Alex Macro <alex.macro@stericsson.com> Signed-off-by: Michel Jaouen <michel.jaouen@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'include/linux/mfd')
-rw-r--r--include/linux/mfd/abx500/ab8500-gpio.h4
-rw-r--r--include/linux/mfd/abx500/ab8500-sysctrl.h43
-rw-r--r--include/linux/mfd/abx500/ab8500.h46
3 files changed, 91 insertions, 2 deletions
diff --git a/include/linux/mfd/abx500/ab8500-gpio.h b/include/linux/mfd/abx500/ab8500-gpio.h
index 488a8c920a29..2387c207ea86 100644
--- a/include/linux/mfd/abx500/ab8500-gpio.h
+++ b/include/linux/mfd/abx500/ab8500-gpio.h
@@ -10,12 +10,14 @@
10 10
11/* 11/*
12 * Platform data to register a block: only the initial gpio/irq number. 12 * Platform data to register a block: only the initial gpio/irq number.
13 * Array sizes are large enough to contain all AB8500 and AB9540 GPIO
14 * registers.
13 */ 15 */
14 16
15struct ab8500_gpio_platform_data { 17struct ab8500_gpio_platform_data {
16 int gpio_base; 18 int gpio_base;
17 u32 irq_base; 19 u32 irq_base;
18 u8 config_reg[7]; 20 u8 config_reg[8];
19}; 21};
20 22
21#endif /* _AB8500_GPIO_H */ 23#endif /* _AB8500_GPIO_H */
diff --git a/include/linux/mfd/abx500/ab8500-sysctrl.h b/include/linux/mfd/abx500/ab8500-sysctrl.h
index 10da0291f8f8..10eb50973c39 100644
--- a/include/linux/mfd/abx500/ab8500-sysctrl.h
+++ b/include/linux/mfd/abx500/ab8500-sysctrl.h
@@ -71,6 +71,13 @@ static inline int ab8500_sysctrl_clear(u16 reg, u8 bits)
71#define AB8500_SWATCTRL 0x230 71#define AB8500_SWATCTRL 0x230
72#define AB8500_HIQCLKCTRL 0x232 72#define AB8500_HIQCLKCTRL 0x232
73#define AB8500_VSIMSYSCLKCTRL 0x233 73#define AB8500_VSIMSYSCLKCTRL 0x233
74#define AB9540_SYSCLK12BUFCTRL 0x234
75#define AB9540_SYSCLK12CONFCTRL 0x235
76#define AB9540_SYSCLK12BUFCTRL2 0x236
77#define AB9540_SYSCLK12BUF1VALID 0x237
78#define AB9540_SYSCLK12BUF2VALID 0x238
79#define AB9540_SYSCLK12BUF3VALID 0x239
80#define AB9540_SYSCLK12BUF4VALID 0x23A
74 81
75/* Bits */ 82/* Bits */
76#define AB8500_TURNONSTATUS_PORNVBAT BIT(0) 83#define AB8500_TURNONSTATUS_PORNVBAT BIT(0)
@@ -251,4 +258,40 @@ static inline int ab8500_sysctrl_clear(u16 reg, u8 bits)
251#define AB8500_VSIMSYSCLKCTRL_VSIMSYSCLKREQ7VALID BIT(6) 258#define AB8500_VSIMSYSCLKCTRL_VSIMSYSCLKREQ7VALID BIT(6)
252#define AB8500_VSIMSYSCLKCTRL_VSIMSYSCLKREQ8VALID BIT(7) 259#define AB8500_VSIMSYSCLKCTRL_VSIMSYSCLKREQ8VALID BIT(7)
253 260
261#define AB9540_SYSCLK12BUFCTRL_SYSCLK12BUF1ENA BIT(0)
262#define AB9540_SYSCLK12BUFCTRL_SYSCLK12BUF2ENA BIT(1)
263#define AB9540_SYSCLK12BUFCTRL_SYSCLK12BUF3ENA BIT(2)
264#define AB9540_SYSCLK12BUFCTRL_SYSCLK12BUF4ENA BIT(3)
265#define AB9540_SYSCLK12BUFCTRL_SYSCLK12BUFENA_MASK 0x0F
266#define AB9540_SYSCLK12BUFCTRL_SYSCLK12BUF1STRE BIT(4)
267#define AB9540_SYSCLK12BUFCTRL_SYSCLK12BUF2STRE BIT(5)
268#define AB9540_SYSCLK12BUFCTRL_SYSCLK12BUF3STRE BIT(6)
269#define AB9540_SYSCLK12BUFCTRL_SYSCLK12BUF4STRE BIT(7)
270#define AB9540_SYSCLK12BUFCTRL_SYSCLK12BUFSTRE_MASK 0xF0
271
272#define AB9540_SYSCLK12CONFCTRL_PLL26TO38ENA BIT(0)
273#define AB9540_SYSCLK12CONFCTRL_SYSCLK12USBMUXSEL BIT(1)
274#define AB9540_SYSCLK12CONFCTRL_INT384MHZMUXSEL_MASK 0x0C
275#define AB9540_SYSCLK12CONFCTRL_INT384MHZMUXSEL_SHIFT 2
276#define AB9540_SYSCLK12CONFCTRL_SYSCLK12BUFMUX BIT(4)
277#define AB9540_SYSCLK12CONFCTRL_SYSCLK12PLLMUX BIT(5)
278#define AB9540_SYSCLK12CONFCTRL_SYSCLK2MUXVALID BIT(6)
279
280#define AB9540_SYSCLK12BUFCTRL2_SYSCLK12BUF1PDENA BIT(0)
281#define AB9540_SYSCLK12BUFCTRL2_SYSCLK12BUF2PDENA BIT(1)
282#define AB9540_SYSCLK12BUFCTRL2_SYSCLK12BUF3PDENA BIT(2)
283#define AB9540_SYSCLK12BUFCTRL2_SYSCLK12BUF4PDENA BIT(3)
284
285#define AB9540_SYSCLK12BUF1VALID_SYSCLK12BUF1VALID_MASK 0xFF
286#define AB9540_SYSCLK12BUF1VALID_SYSCLK12BUF1VALID_SHIFT 0
287
288#define AB9540_SYSCLK12BUF2VALID_SYSCLK12BUF2VALID_MASK 0xFF
289#define AB9540_SYSCLK12BUF2VALID_SYSCLK12BUF2VALID_SHIFT 0
290
291#define AB9540_SYSCLK12BUF3VALID_SYSCLK12BUF3VALID_MASK 0xFF
292#define AB9540_SYSCLK12BUF3VALID_SYSCLK12BUF3VALID_SHIFT 0
293
294#define AB9540_SYSCLK12BUF4VALID_SYSCLK12BUF4VALID_MASK 0xFF
295#define AB9540_SYSCLK12BUF4VALID_SYSCLK12BUF4VALID_SHIFT 0
296
254#endif /* __AB8500_SYSCTRL_H */ 297#endif /* __AB8500_SYSCTRL_H */
diff --git a/include/linux/mfd/abx500/ab8500.h b/include/linux/mfd/abx500/ab8500.h
index 55eabe8b6ce6..4b2df29fb858 100644
--- a/include/linux/mfd/abx500/ab8500.h
+++ b/include/linux/mfd/abx500/ab8500.h
@@ -57,8 +57,11 @@ enum ab8500_version {
57 57
58/* 58/*
59 * Interrupts 59 * Interrupts
60 * Values used to index into array ab8500_irq_regoffset[] defined in
61 * drivers/mdf/ab8500-core.c
60 */ 62 */
61 63/* Definitions for AB8500 and AB9540 */
64/* ab8500_irq_regoffset[0] -> IT[Source|Latch|Mask]1 */
62#define AB8500_INT_MAIN_EXT_CH_NOT_OK 0 65#define AB8500_INT_MAIN_EXT_CH_NOT_OK 0
63#define AB8500_INT_UN_PLUG_TV_DET 1 66#define AB8500_INT_UN_PLUG_TV_DET 1
64#define AB8500_INT_PLUG_TV_DET 2 67#define AB8500_INT_PLUG_TV_DET 2
@@ -67,6 +70,7 @@ enum ab8500_version {
67#define AB8500_INT_PON_KEY2DB_R 5 70#define AB8500_INT_PON_KEY2DB_R 5
68#define AB8500_INT_PON_KEY1DB_F 6 71#define AB8500_INT_PON_KEY1DB_F 6
69#define AB8500_INT_PON_KEY1DB_R 7 72#define AB8500_INT_PON_KEY1DB_R 7
73/* ab8500_irq_regoffset[1] -> IT[Source|Latch|Mask]2 */
70#define AB8500_INT_BATT_OVV 8 74#define AB8500_INT_BATT_OVV 8
71#define AB8500_INT_MAIN_CH_UNPLUG_DET 10 75#define AB8500_INT_MAIN_CH_UNPLUG_DET 10
72#define AB8500_INT_MAIN_CH_PLUG_DET 11 76#define AB8500_INT_MAIN_CH_PLUG_DET 11
@@ -74,6 +78,7 @@ enum ab8500_version {
74#define AB8500_INT_USB_ID_DET_R 13 78#define AB8500_INT_USB_ID_DET_R 13
75#define AB8500_INT_VBUS_DET_F 14 79#define AB8500_INT_VBUS_DET_F 14
76#define AB8500_INT_VBUS_DET_R 15 80#define AB8500_INT_VBUS_DET_R 15
81/* ab8500_irq_regoffset[2] -> IT[Source|Latch|Mask]3 */
77#define AB8500_INT_VBUS_CH_DROP_END 16 82#define AB8500_INT_VBUS_CH_DROP_END 16
78#define AB8500_INT_RTC_60S 17 83#define AB8500_INT_RTC_60S 17
79#define AB8500_INT_RTC_ALARM 18 84#define AB8500_INT_RTC_ALARM 18
@@ -81,6 +86,7 @@ enum ab8500_version {
81#define AB8500_INT_CH_WD_EXP 21 86#define AB8500_INT_CH_WD_EXP 21
82#define AB8500_INT_VBUS_OVV 22 87#define AB8500_INT_VBUS_OVV 22
83#define AB8500_INT_MAIN_CH_DROP_END 23 88#define AB8500_INT_MAIN_CH_DROP_END 23
89/* ab8500_irq_regoffset[3] -> IT[Source|Latch|Mask]4 */
84#define AB8500_INT_CCN_CONV_ACC 24 90#define AB8500_INT_CCN_CONV_ACC 24
85#define AB8500_INT_INT_AUD 25 91#define AB8500_INT_INT_AUD 25
86#define AB8500_INT_CCEOC 26 92#define AB8500_INT_CCEOC 26
@@ -89,6 +95,7 @@ enum ab8500_version {
89#define AB8500_INT_LOW_BAT_R 29 95#define AB8500_INT_LOW_BAT_R 29
90#define AB8500_INT_BUP_CHG_NOT_OK 30 96#define AB8500_INT_BUP_CHG_NOT_OK 30
91#define AB8500_INT_BUP_CHG_OK 31 97#define AB8500_INT_BUP_CHG_OK 31
98/* ab8500_irq_regoffset[4] -> IT[Source|Latch|Mask]5 */
92#define AB8500_INT_GP_HW_ADC_CONV_END 32 99#define AB8500_INT_GP_HW_ADC_CONV_END 32
93#define AB8500_INT_ACC_DETECT_1DB_F 33 100#define AB8500_INT_ACC_DETECT_1DB_F 33
94#define AB8500_INT_ACC_DETECT_1DB_R 34 101#define AB8500_INT_ACC_DETECT_1DB_R 34
@@ -97,6 +104,7 @@ enum ab8500_version {
97#define AB8500_INT_ACC_DETECT_21DB_F 37 104#define AB8500_INT_ACC_DETECT_21DB_F 37
98#define AB8500_INT_ACC_DETECT_21DB_R 38 105#define AB8500_INT_ACC_DETECT_21DB_R 38
99#define AB8500_INT_GP_SW_ADC_CONV_END 39 106#define AB8500_INT_GP_SW_ADC_CONV_END 39
107/* ab8500_irq_regoffset[5] -> IT[Source|Latch|Mask]7 */
100#define AB8500_INT_GPIO6R 40 108#define AB8500_INT_GPIO6R 40
101#define AB8500_INT_GPIO7R 41 109#define AB8500_INT_GPIO7R 41
102#define AB8500_INT_GPIO8R 42 110#define AB8500_INT_GPIO8R 42
@@ -105,6 +113,7 @@ enum ab8500_version {
105#define AB8500_INT_GPIO11R 45 113#define AB8500_INT_GPIO11R 45
106#define AB8500_INT_GPIO12R 46 114#define AB8500_INT_GPIO12R 46
107#define AB8500_INT_GPIO13R 47 115#define AB8500_INT_GPIO13R 47
116/* ab8500_irq_regoffset[6] -> IT[Source|Latch|Mask]8 */
108#define AB8500_INT_GPIO24R 48 117#define AB8500_INT_GPIO24R 48
109#define AB8500_INT_GPIO25R 49 118#define AB8500_INT_GPIO25R 49
110#define AB8500_INT_GPIO36R 50 119#define AB8500_INT_GPIO36R 50
@@ -113,6 +122,7 @@ enum ab8500_version {
113#define AB8500_INT_GPIO39R 53 122#define AB8500_INT_GPIO39R 53
114#define AB8500_INT_GPIO40R 54 123#define AB8500_INT_GPIO40R 54
115#define AB8500_INT_GPIO41R 55 124#define AB8500_INT_GPIO41R 55
125/* ab8500_irq_regoffset[7] -> IT[Source|Latch|Mask]9 */
116#define AB8500_INT_GPIO6F 56 126#define AB8500_INT_GPIO6F 56
117#define AB8500_INT_GPIO7F 57 127#define AB8500_INT_GPIO7F 57
118#define AB8500_INT_GPIO8F 58 128#define AB8500_INT_GPIO8F 58
@@ -121,6 +131,7 @@ enum ab8500_version {
121#define AB8500_INT_GPIO11F 61 131#define AB8500_INT_GPIO11F 61
122#define AB8500_INT_GPIO12F 62 132#define AB8500_INT_GPIO12F 62
123#define AB8500_INT_GPIO13F 63 133#define AB8500_INT_GPIO13F 63
134/* ab8500_irq_regoffset[8] -> IT[Source|Latch|Mask]10 */
124#define AB8500_INT_GPIO24F 64 135#define AB8500_INT_GPIO24F 64
125#define AB8500_INT_GPIO25F 65 136#define AB8500_INT_GPIO25F 65
126#define AB8500_INT_GPIO36F 66 137#define AB8500_INT_GPIO36F 66
@@ -129,6 +140,7 @@ enum ab8500_version {
129#define AB8500_INT_GPIO39F 69 140#define AB8500_INT_GPIO39F 69
130#define AB8500_INT_GPIO40F 70 141#define AB8500_INT_GPIO40F 70
131#define AB8500_INT_GPIO41F 71 142#define AB8500_INT_GPIO41F 71
143/* ab8500_irq_regoffset[9] -> IT[Source|Latch|Mask]12 */
132#define AB8500_INT_ADP_SOURCE_ERROR 72 144#define AB8500_INT_ADP_SOURCE_ERROR 72
133#define AB8500_INT_ADP_SINK_ERROR 73 145#define AB8500_INT_ADP_SINK_ERROR 73
134#define AB8500_INT_ADP_PROBE_PLUG 74 146#define AB8500_INT_ADP_PROBE_PLUG 74
@@ -136,30 +148,62 @@ enum ab8500_version {
136#define AB8500_INT_ADP_SENSE_OFF 76 148#define AB8500_INT_ADP_SENSE_OFF 76
137#define AB8500_INT_USB_PHY_POWER_ERR 78 149#define AB8500_INT_USB_PHY_POWER_ERR 78
138#define AB8500_INT_USB_LINK_STATUS 79 150#define AB8500_INT_USB_LINK_STATUS 79
151/* ab8500_irq_regoffset[10] -> IT[Source|Latch|Mask]19 */
139#define AB8500_INT_BTEMP_LOW 80 152#define AB8500_INT_BTEMP_LOW 80
140#define AB8500_INT_BTEMP_LOW_MEDIUM 81 153#define AB8500_INT_BTEMP_LOW_MEDIUM 81
141#define AB8500_INT_BTEMP_MEDIUM_HIGH 82 154#define AB8500_INT_BTEMP_MEDIUM_HIGH 82
142#define AB8500_INT_BTEMP_HIGH 83 155#define AB8500_INT_BTEMP_HIGH 83
156/* ab8500_irq_regoffset[11] -> IT[Source|Latch|Mask]20 */
143#define AB8500_INT_USB_CHARGER_NOT_OK 89 157#define AB8500_INT_USB_CHARGER_NOT_OK 89
144#define AB8500_INT_ID_WAKEUP_R 90 158#define AB8500_INT_ID_WAKEUP_R 90
145#define AB8500_INT_ID_DET_R1R 92 159#define AB8500_INT_ID_DET_R1R 92
146#define AB8500_INT_ID_DET_R2R 93 160#define AB8500_INT_ID_DET_R2R 93
147#define AB8500_INT_ID_DET_R3R 94 161#define AB8500_INT_ID_DET_R3R 94
148#define AB8500_INT_ID_DET_R4R 95 162#define AB8500_INT_ID_DET_R4R 95
163/* ab8500_irq_regoffset[12] -> IT[Source|Latch|Mask]21 */
149#define AB8500_INT_ID_WAKEUP_F 96 164#define AB8500_INT_ID_WAKEUP_F 96
150#define AB8500_INT_ID_DET_R1F 98 165#define AB8500_INT_ID_DET_R1F 98
151#define AB8500_INT_ID_DET_R2F 99 166#define AB8500_INT_ID_DET_R2F 99
152#define AB8500_INT_ID_DET_R3F 100 167#define AB8500_INT_ID_DET_R3F 100
153#define AB8500_INT_ID_DET_R4F 101 168#define AB8500_INT_ID_DET_R4F 101
154#define AB8500_INT_USB_CHG_DET_DONE 102 169#define AB8500_INT_USB_CHG_DET_DONE 102
170/* ab8500_irq_regoffset[13] -> IT[Source|Latch|Mask]22 */
155#define AB8500_INT_USB_CH_TH_PROT_F 104 171#define AB8500_INT_USB_CH_TH_PROT_F 104
156#define AB8500_INT_USB_CH_TH_PROT_R 105 172#define AB8500_INT_USB_CH_TH_PROT_R 105
157#define AB8500_INT_MAIN_CH_TH_PROT_F 106 173#define AB8500_INT_MAIN_CH_TH_PROT_F 106
158#define AB8500_INT_MAIN_CH_TH_PROT_R 107 174#define AB8500_INT_MAIN_CH_TH_PROT_R 107
159#define AB8500_INT_USB_CHARGER_NOT_OKF 111 175#define AB8500_INT_USB_CHARGER_NOT_OKF 111
160 176
177/* Definitions for AB9540 */
178/* ab8500_irq_regoffset[14] -> IT[Source|Latch|Mask]13 */
179#define AB9540_INT_GPIO50R 113
180#define AB9540_INT_GPIO51R 114
181#define AB9540_INT_GPIO52R 115
182#define AB9540_INT_GPIO53R 116
183#define AB9540_INT_GPIO54R 117
184#define AB9540_INT_IEXT_CH_RF_BFN_R 118
185#define AB9540_INT_IEXT_CH_RF_BFN_F 119
186/* ab8500_irq_regoffset[15] -> IT[Source|Latch|Mask]14 */
187#define AB9540_INT_GPIO50F 121
188#define AB9540_INT_GPIO51F 122
189#define AB9540_INT_GPIO52F 123
190#define AB9540_INT_GPIO53F 124
191#define AB9540_INT_GPIO54F 125
192
193/*
194 * AB8500_AB9540_NR_IRQS is used when configuring the IRQ numbers for the
195 * entire platform. This is a "compile time" constant so this must be set to
196 * the largest possible value that may be encountered with different AB SOCs.
197 * Of the currently supported AB devices, AB8500 and AB9540, it is the AB9540
198 * which is larger.
199 */
161#define AB8500_NR_IRQS 112 200#define AB8500_NR_IRQS 112
201#define AB9540_NR_IRQS 128
202/* This is set to the roof of any AB8500 chip variant IRQ counts */
203#define AB8500_MAX_NR_IRQS AB9540_NR_IRQS
204
162#define AB8500_NUM_IRQ_REGS 14 205#define AB8500_NUM_IRQ_REGS 14
206#define AB9540_NUM_IRQ_REGS 17
163 207
164/** 208/**
165 * struct ab8500 - ab8500 internal structure 209 * struct ab8500 - ab8500 internal structure