Commit 8ab30691826fc05efa47c4ffba19b80496bb3a2c

Authored by Mark Brown
1 parent e292b578c9

mfd: Convert wm8994 to use generic regmap irq_chip

Factor out the irq_chip implementation, substantially reducing the code
size for the driver.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>

Showing 3 changed files with 35 additions and 165 deletions Inline Diff

1 # 1 #
2 # Multifunction miscellaneous devices 2 # Multifunction miscellaneous devices
3 # 3 #
4 4
5 if HAS_IOMEM 5 if HAS_IOMEM
6 menu "Multifunction device drivers" 6 menu "Multifunction device drivers"
7 7
8 config MFD_CORE 8 config MFD_CORE
9 tristate 9 tristate
10 default n 10 default n
11 11
12 config MFD_88PM860X 12 config MFD_88PM860X
13 bool "Support Marvell 88PM8606/88PM8607" 13 bool "Support Marvell 88PM8606/88PM8607"
14 depends on I2C=y && GENERIC_HARDIRQS 14 depends on I2C=y && GENERIC_HARDIRQS
15 select MFD_CORE 15 select MFD_CORE
16 help 16 help
17 This supports for Marvell 88PM8606/88PM8607 Power Management IC. 17 This supports for Marvell 88PM8606/88PM8607 Power Management IC.
18 This includes the I2C driver and the core APIs _only_, you have to 18 This includes the I2C driver and the core APIs _only_, you have to
19 select individual components like voltage regulators, RTC and 19 select individual components like voltage regulators, RTC and
20 battery-charger under the corresponding menus. 20 battery-charger under the corresponding menus.
21 21
22 config MFD_SM501 22 config MFD_SM501
23 tristate "Support for Silicon Motion SM501" 23 tristate "Support for Silicon Motion SM501"
24 ---help--- 24 ---help---
25 This is the core driver for the Silicon Motion SM501 multimedia 25 This is the core driver for the Silicon Motion SM501 multimedia
26 companion chip. This device is a multifunction device which may 26 companion chip. This device is a multifunction device which may
27 provide numerous interfaces including USB host controller, USB gadget, 27 provide numerous interfaces including USB host controller, USB gadget,
28 asynchronous serial ports, audio functions, and a dual display video 28 asynchronous serial ports, audio functions, and a dual display video
29 interface. The device may be connected by PCI or local bus with 29 interface. The device may be connected by PCI or local bus with
30 varying functions enabled. 30 varying functions enabled.
31 31
32 config MFD_SM501_GPIO 32 config MFD_SM501_GPIO
33 bool "Export GPIO via GPIO layer" 33 bool "Export GPIO via GPIO layer"
34 depends on MFD_SM501 && GPIOLIB 34 depends on MFD_SM501 && GPIOLIB
35 ---help--- 35 ---help---
36 This option uses the gpio library layer to export the 64 GPIO 36 This option uses the gpio library layer to export the 64 GPIO
37 lines on the SM501. The platform data is used to supply the 37 lines on the SM501. The platform data is used to supply the
38 base number for the first GPIO line to register. 38 base number for the first GPIO line to register.
39 39
40 config MFD_ASIC3 40 config MFD_ASIC3
41 bool "Support for Compaq ASIC3" 41 bool "Support for Compaq ASIC3"
42 depends on GENERIC_HARDIRQS && GPIOLIB && ARM 42 depends on GENERIC_HARDIRQS && GPIOLIB && ARM
43 select MFD_CORE 43 select MFD_CORE
44 ---help--- 44 ---help---
45 This driver supports the ASIC3 multifunction chip found on many 45 This driver supports the ASIC3 multifunction chip found on many
46 PDAs (mainly iPAQ and HTC based ones) 46 PDAs (mainly iPAQ and HTC based ones)
47 47
48 config MFD_DAVINCI_VOICECODEC 48 config MFD_DAVINCI_VOICECODEC
49 tristate 49 tristate
50 select MFD_CORE 50 select MFD_CORE
51 51
52 config MFD_DM355EVM_MSP 52 config MFD_DM355EVM_MSP
53 bool "DaVinci DM355 EVM microcontroller" 53 bool "DaVinci DM355 EVM microcontroller"
54 depends on I2C=y && MACH_DAVINCI_DM355_EVM 54 depends on I2C=y && MACH_DAVINCI_DM355_EVM
55 help 55 help
56 This driver supports the MSP430 microcontroller used on these 56 This driver supports the MSP430 microcontroller used on these
57 boards. MSP430 firmware manages resets and power sequencing, 57 boards. MSP430 firmware manages resets and power sequencing,
58 inputs from buttons and the IR remote, LEDs, an RTC, and more. 58 inputs from buttons and the IR remote, LEDs, an RTC, and more.
59 59
60 config MFD_TI_SSP 60 config MFD_TI_SSP
61 tristate "TI Sequencer Serial Port support" 61 tristate "TI Sequencer Serial Port support"
62 depends on ARCH_DAVINCI_TNETV107X 62 depends on ARCH_DAVINCI_TNETV107X
63 select MFD_CORE 63 select MFD_CORE
64 ---help--- 64 ---help---
65 Say Y here if you want support for the Sequencer Serial Port 65 Say Y here if you want support for the Sequencer Serial Port
66 in a Texas Instruments TNETV107X SoC. 66 in a Texas Instruments TNETV107X SoC.
67 67
68 To compile this driver as a module, choose M here: the 68 To compile this driver as a module, choose M here: the
69 module will be called ti-ssp. 69 module will be called ti-ssp.
70 70
71 config HTC_EGPIO 71 config HTC_EGPIO
72 bool "HTC EGPIO support" 72 bool "HTC EGPIO support"
73 depends on GENERIC_HARDIRQS && GPIOLIB && ARM 73 depends on GENERIC_HARDIRQS && GPIOLIB && ARM
74 help 74 help
75 This driver supports the CPLD egpio chip present on 75 This driver supports the CPLD egpio chip present on
76 several HTC phones. It provides basic support for input 76 several HTC phones. It provides basic support for input
77 pins, output pins, and irqs. 77 pins, output pins, and irqs.
78 78
79 config HTC_PASIC3 79 config HTC_PASIC3
80 tristate "HTC PASIC3 LED/DS1WM chip support" 80 tristate "HTC PASIC3 LED/DS1WM chip support"
81 select MFD_CORE 81 select MFD_CORE
82 help 82 help
83 This core driver provides register access for the LED/DS1WM 83 This core driver provides register access for the LED/DS1WM
84 chips labeled "AIC2" and "AIC3", found on HTC Blueangel and 84 chips labeled "AIC2" and "AIC3", found on HTC Blueangel and
85 HTC Magician devices, respectively. Actual functionality is 85 HTC Magician devices, respectively. Actual functionality is
86 handled by the leds-pasic3 and ds1wm drivers. 86 handled by the leds-pasic3 and ds1wm drivers.
87 87
88 config HTC_I2CPLD 88 config HTC_I2CPLD
89 bool "HTC I2C PLD chip support" 89 bool "HTC I2C PLD chip support"
90 depends on I2C=y && GPIOLIB 90 depends on I2C=y && GPIOLIB
91 help 91 help
92 If you say yes here you get support for the supposed CPLD 92 If you say yes here you get support for the supposed CPLD
93 found on omap850 HTC devices like the HTC Wizard and HTC Herald. 93 found on omap850 HTC devices like the HTC Wizard and HTC Herald.
94 This device provides input and output GPIOs through an I2C 94 This device provides input and output GPIOs through an I2C
95 interface to one or more sub-chips. 95 interface to one or more sub-chips.
96 96
97 config UCB1400_CORE 97 config UCB1400_CORE
98 tristate "Philips UCB1400 Core driver" 98 tristate "Philips UCB1400 Core driver"
99 depends on AC97_BUS 99 depends on AC97_BUS
100 depends on GPIOLIB 100 depends on GPIOLIB
101 help 101 help
102 This enables support for the Philips UCB1400 core functions. 102 This enables support for the Philips UCB1400 core functions.
103 The UCB1400 is an AC97 audio codec. 103 The UCB1400 is an AC97 audio codec.
104 104
105 To compile this driver as a module, choose M here: the 105 To compile this driver as a module, choose M here: the
106 module will be called ucb1400_core. 106 module will be called ucb1400_core.
107 107
108 config TPS6105X 108 config TPS6105X
109 tristate "TPS61050/61052 Boost Converters" 109 tristate "TPS61050/61052 Boost Converters"
110 depends on I2C 110 depends on I2C
111 select REGULATOR 111 select REGULATOR
112 select MFD_CORE 112 select MFD_CORE
113 select REGULATOR_FIXED_VOLTAGE 113 select REGULATOR_FIXED_VOLTAGE
114 help 114 help
115 This option enables a driver for the TP61050/TPS61052 115 This option enables a driver for the TP61050/TPS61052
116 high-power "white LED driver". This boost converter is 116 high-power "white LED driver". This boost converter is
117 sometimes used for other things than white LEDs, and 117 sometimes used for other things than white LEDs, and
118 also contains a GPIO pin. 118 also contains a GPIO pin.
119 119
120 config TPS65010 120 config TPS65010
121 tristate "TPS6501x Power Management chips" 121 tristate "TPS6501x Power Management chips"
122 depends on I2C && GPIOLIB 122 depends on I2C && GPIOLIB
123 default y if MACH_OMAP_H2 || MACH_OMAP_H3 || MACH_OMAP_OSK 123 default y if MACH_OMAP_H2 || MACH_OMAP_H3 || MACH_OMAP_OSK
124 help 124 help
125 If you say yes here you get support for the TPS6501x series of 125 If you say yes here you get support for the TPS6501x series of
126 Power Management chips. These include voltage regulators, 126 Power Management chips. These include voltage regulators,
127 lithium ion/polymer battery charging, and other features that 127 lithium ion/polymer battery charging, and other features that
128 are often used in portable devices like cell phones and cameras. 128 are often used in portable devices like cell phones and cameras.
129 129
130 This driver can also be built as a module. If so, the module 130 This driver can also be built as a module. If so, the module
131 will be called tps65010. 131 will be called tps65010.
132 132
133 config TPS6507X 133 config TPS6507X
134 tristate "TPS6507x Power Management / Touch Screen chips" 134 tristate "TPS6507x Power Management / Touch Screen chips"
135 select MFD_CORE 135 select MFD_CORE
136 depends on I2C 136 depends on I2C
137 help 137 help
138 If you say yes here you get support for the TPS6507x series of 138 If you say yes here you get support for the TPS6507x series of
139 Power Management / Touch Screen chips. These include voltage 139 Power Management / Touch Screen chips. These include voltage
140 regulators, lithium ion/polymer battery charging, touch screen 140 regulators, lithium ion/polymer battery charging, touch screen
141 and other features that are often used in portable devices. 141 and other features that are often used in portable devices.
142 This driver can also be built as a module. If so, the module 142 This driver can also be built as a module. If so, the module
143 will be called tps6507x. 143 will be called tps6507x.
144 144
145 config MFD_TPS6586X 145 config MFD_TPS6586X
146 bool "TPS6586x Power Management chips" 146 bool "TPS6586x Power Management chips"
147 depends on I2C=y && GPIOLIB && GENERIC_HARDIRQS 147 depends on I2C=y && GPIOLIB && GENERIC_HARDIRQS
148 select MFD_CORE 148 select MFD_CORE
149 help 149 help
150 If you say yes here you get support for the TPS6586X series of 150 If you say yes here you get support for the TPS6586X series of
151 Power Management chips. 151 Power Management chips.
152 This driver provides common support for accessing the device, 152 This driver provides common support for accessing the device,
153 additional drivers must be enabled in order to use the 153 additional drivers must be enabled in order to use the
154 functionality of the device. 154 functionality of the device.
155 155
156 This driver can also be built as a module. If so, the module 156 This driver can also be built as a module. If so, the module
157 will be called tps6586x. 157 will be called tps6586x.
158 158
159 config MFD_TPS65910 159 config MFD_TPS65910
160 bool "TPS65910 Power Management chip" 160 bool "TPS65910 Power Management chip"
161 depends on I2C=y && GPIOLIB 161 depends on I2C=y && GPIOLIB
162 select MFD_CORE 162 select MFD_CORE
163 select GPIO_TPS65910 163 select GPIO_TPS65910
164 help 164 help
165 if you say yes here you get support for the TPS65910 series of 165 if you say yes here you get support for the TPS65910 series of
166 Power Management chips. 166 Power Management chips.
167 167
168 config MFD_TPS65912 168 config MFD_TPS65912
169 bool 169 bool
170 depends on GPIOLIB 170 depends on GPIOLIB
171 171
172 config MFD_TPS65912_I2C 172 config MFD_TPS65912_I2C
173 bool "TPS95612 Power Management chip with I2C" 173 bool "TPS95612 Power Management chip with I2C"
174 select MFD_CORE 174 select MFD_CORE
175 select MFD_TPS65912 175 select MFD_TPS65912
176 depends on I2C=y && GPIOLIB 176 depends on I2C=y && GPIOLIB
177 help 177 help
178 If you say yes here you get support for the TPS65912 series of 178 If you say yes here you get support for the TPS65912 series of
179 PM chips with I2C interface. 179 PM chips with I2C interface.
180 180
181 config MFD_TPS65912_SPI 181 config MFD_TPS65912_SPI
182 bool "TPS65912 Power Management chip with SPI" 182 bool "TPS65912 Power Management chip with SPI"
183 select MFD_CORE 183 select MFD_CORE
184 select MFD_TPS65912 184 select MFD_TPS65912
185 depends on SPI_MASTER && GPIOLIB 185 depends on SPI_MASTER && GPIOLIB
186 help 186 help
187 If you say yes here you get support for the TPS65912 series of 187 If you say yes here you get support for the TPS65912 series of
188 PM chips with SPI interface. 188 PM chips with SPI interface.
189 189
190 config MENELAUS 190 config MENELAUS
191 bool "Texas Instruments TWL92330/Menelaus PM chip" 191 bool "Texas Instruments TWL92330/Menelaus PM chip"
192 depends on I2C=y && ARCH_OMAP2 192 depends on I2C=y && ARCH_OMAP2
193 help 193 help
194 If you say yes here you get support for the Texas Instruments 194 If you say yes here you get support for the Texas Instruments
195 TWL92330/Menelaus Power Management chip. This include voltage 195 TWL92330/Menelaus Power Management chip. This include voltage
196 regulators, Dual slot memory card transceivers, real-time clock 196 regulators, Dual slot memory card transceivers, real-time clock
197 and other features that are often used in portable devices like 197 and other features that are often used in portable devices like
198 cell phones and PDAs. 198 cell phones and PDAs.
199 199
200 config TWL4030_CORE 200 config TWL4030_CORE
201 bool "Texas Instruments TWL4030/TWL5030/TWL6030/TPS659x0 Support" 201 bool "Texas Instruments TWL4030/TWL5030/TWL6030/TPS659x0 Support"
202 depends on I2C=y && GENERIC_HARDIRQS 202 depends on I2C=y && GENERIC_HARDIRQS
203 help 203 help
204 Say yes here if you have TWL4030 / TWL6030 family chip on your board. 204 Say yes here if you have TWL4030 / TWL6030 family chip on your board.
205 This core driver provides register access and IRQ handling 205 This core driver provides register access and IRQ handling
206 facilities, and registers devices for the various functions 206 facilities, and registers devices for the various functions
207 so that function-specific drivers can bind to them. 207 so that function-specific drivers can bind to them.
208 208
209 These multi-function chips are found on many OMAP2 and OMAP3 209 These multi-function chips are found on many OMAP2 and OMAP3
210 boards, providing power management, RTC, GPIO, keypad, a 210 boards, providing power management, RTC, GPIO, keypad, a
211 high speed USB OTG transceiver, an audio codec (on most 211 high speed USB OTG transceiver, an audio codec (on most
212 versions) and many other features. 212 versions) and many other features.
213 213
214 config TWL4030_MADC 214 config TWL4030_MADC
215 tristate "Texas Instruments TWL4030 MADC" 215 tristate "Texas Instruments TWL4030 MADC"
216 depends on TWL4030_CORE 216 depends on TWL4030_CORE
217 help 217 help
218 This driver provides support for triton TWL4030-MADC. The 218 This driver provides support for triton TWL4030-MADC. The
219 driver supports both RT and SW conversion methods. 219 driver supports both RT and SW conversion methods.
220 220
221 This driver can be built as a module. If so it will be 221 This driver can be built as a module. If so it will be
222 named twl4030-madc 222 named twl4030-madc
223 223
224 config TWL4030_POWER 224 config TWL4030_POWER
225 bool "Support power resources on TWL4030 family chips" 225 bool "Support power resources on TWL4030 family chips"
226 depends on TWL4030_CORE && ARM 226 depends on TWL4030_CORE && ARM
227 help 227 help
228 Say yes here if you want to use the power resources on the 228 Say yes here if you want to use the power resources on the
229 TWL4030 family chips. Most of these resources are regulators, 229 TWL4030 family chips. Most of these resources are regulators,
230 which have a separate driver; some are control signals, such 230 which have a separate driver; some are control signals, such
231 as clock request handshaking. 231 as clock request handshaking.
232 232
233 This driver uses board-specific data to initialize the resources 233 This driver uses board-specific data to initialize the resources
234 and load scripts controlling which resources are switched off/on 234 and load scripts controlling which resources are switched off/on
235 or reset when a sleep, wakeup or warm reset event occurs. 235 or reset when a sleep, wakeup or warm reset event occurs.
236 236
237 config MFD_TWL4030_AUDIO 237 config MFD_TWL4030_AUDIO
238 bool 238 bool
239 depends on TWL4030_CORE 239 depends on TWL4030_CORE
240 select MFD_CORE 240 select MFD_CORE
241 default n 241 default n
242 242
243 config TWL6030_PWM 243 config TWL6030_PWM
244 tristate "TWL6030 PWM (Pulse Width Modulator) Support" 244 tristate "TWL6030 PWM (Pulse Width Modulator) Support"
245 depends on TWL4030_CORE 245 depends on TWL4030_CORE
246 select HAVE_PWM 246 select HAVE_PWM
247 default n 247 default n
248 help 248 help
249 Say yes here if you want support for TWL6030 PWM. 249 Say yes here if you want support for TWL6030 PWM.
250 This is used to control charging LED brightness. 250 This is used to control charging LED brightness.
251 251
252 config TWL6040_CORE 252 config TWL6040_CORE
253 bool 253 bool
254 depends on TWL4030_CORE && GENERIC_HARDIRQS 254 depends on TWL4030_CORE && GENERIC_HARDIRQS
255 select MFD_CORE 255 select MFD_CORE
256 default n 256 default n
257 257
258 config MFD_STMPE 258 config MFD_STMPE
259 bool "Support STMicroelectronics STMPE" 259 bool "Support STMicroelectronics STMPE"
260 depends on I2C=y && GENERIC_HARDIRQS 260 depends on I2C=y && GENERIC_HARDIRQS
261 select MFD_CORE 261 select MFD_CORE
262 help 262 help
263 Support for the STMPE family of I/O Expanders from 263 Support for the STMPE family of I/O Expanders from
264 STMicroelectronics. 264 STMicroelectronics.
265 265
266 Currently supported devices are: 266 Currently supported devices are:
267 267
268 STMPE811: GPIO, Touchscreen 268 STMPE811: GPIO, Touchscreen
269 STMPE1601: GPIO, Keypad 269 STMPE1601: GPIO, Keypad
270 STMPE2401: GPIO, Keypad 270 STMPE2401: GPIO, Keypad
271 STMPE2403: GPIO, Keypad 271 STMPE2403: GPIO, Keypad
272 272
273 This driver provides common support for accessing the device, 273 This driver provides common support for accessing the device,
274 additional drivers must be enabled in order to use the functionality 274 additional drivers must be enabled in order to use the functionality
275 of the device. Currently available sub drivers are: 275 of the device. Currently available sub drivers are:
276 276
277 GPIO: stmpe-gpio 277 GPIO: stmpe-gpio
278 Keypad: stmpe-keypad 278 Keypad: stmpe-keypad
279 Touchscreen: stmpe-ts 279 Touchscreen: stmpe-ts
280 280
281 config MFD_TC3589X 281 config MFD_TC3589X
282 bool "Support Toshiba TC35892 and variants" 282 bool "Support Toshiba TC35892 and variants"
283 depends on I2C=y && GENERIC_HARDIRQS 283 depends on I2C=y && GENERIC_HARDIRQS
284 select MFD_CORE 284 select MFD_CORE
285 help 285 help
286 Support for the Toshiba TC35892 and variants I/O Expander. 286 Support for the Toshiba TC35892 and variants I/O Expander.
287 287
288 This driver provides common support for accessing the device, 288 This driver provides common support for accessing the device,
289 additional drivers must be enabled in order to use the 289 additional drivers must be enabled in order to use the
290 functionality of the device. 290 functionality of the device.
291 291
292 config MFD_TMIO 292 config MFD_TMIO
293 bool 293 bool
294 default n 294 default n
295 295
296 config MFD_T7L66XB 296 config MFD_T7L66XB
297 bool "Support Toshiba T7L66XB" 297 bool "Support Toshiba T7L66XB"
298 depends on ARM && HAVE_CLK 298 depends on ARM && HAVE_CLK
299 select MFD_CORE 299 select MFD_CORE
300 select MFD_TMIO 300 select MFD_TMIO
301 help 301 help
302 Support for Toshiba Mobile IO Controller T7L66XB 302 Support for Toshiba Mobile IO Controller T7L66XB
303 303
304 config MFD_TC6387XB 304 config MFD_TC6387XB
305 bool "Support Toshiba TC6387XB" 305 bool "Support Toshiba TC6387XB"
306 depends on ARM && HAVE_CLK 306 depends on ARM && HAVE_CLK
307 select MFD_CORE 307 select MFD_CORE
308 select MFD_TMIO 308 select MFD_TMIO
309 help 309 help
310 Support for Toshiba Mobile IO Controller TC6387XB 310 Support for Toshiba Mobile IO Controller TC6387XB
311 311
312 config MFD_TC6393XB 312 config MFD_TC6393XB
313 bool "Support Toshiba TC6393XB" 313 bool "Support Toshiba TC6393XB"
314 depends on GPIOLIB && ARM 314 depends on GPIOLIB && ARM
315 select MFD_CORE 315 select MFD_CORE
316 select MFD_TMIO 316 select MFD_TMIO
317 help 317 help
318 Support for Toshiba Mobile IO Controller TC6393XB 318 Support for Toshiba Mobile IO Controller TC6393XB
319 319
320 config PMIC_DA903X 320 config PMIC_DA903X
321 bool "Dialog Semiconductor DA9030/DA9034 PMIC Support" 321 bool "Dialog Semiconductor DA9030/DA9034 PMIC Support"
322 depends on I2C=y 322 depends on I2C=y
323 help 323 help
324 Say yes here to support for Dialog Semiconductor DA9030 (a.k.a 324 Say yes here to support for Dialog Semiconductor DA9030 (a.k.a
325 ARAVA) and DA9034 (a.k.a MICCO), these are Power Management IC 325 ARAVA) and DA9034 (a.k.a MICCO), these are Power Management IC
326 usually found on PXA processors-based platforms. This includes 326 usually found on PXA processors-based platforms. This includes
327 the I2C driver and the core APIs _only_, you have to select 327 the I2C driver and the core APIs _only_, you have to select
328 individual components like LCD backlight, voltage regulators, 328 individual components like LCD backlight, voltage regulators,
329 LEDs and battery-charger under the corresponding menus. 329 LEDs and battery-charger under the corresponding menus.
330 330
331 config PMIC_ADP5520 331 config PMIC_ADP5520
332 bool "Analog Devices ADP5520/01 MFD PMIC Core Support" 332 bool "Analog Devices ADP5520/01 MFD PMIC Core Support"
333 depends on I2C=y 333 depends on I2C=y
334 help 334 help
335 Say yes here to add support for Analog Devices AD5520 and ADP5501, 335 Say yes here to add support for Analog Devices AD5520 and ADP5501,
336 Multifunction Power Management IC. This includes 336 Multifunction Power Management IC. This includes
337 the I2C driver and the core APIs _only_, you have to select 337 the I2C driver and the core APIs _only_, you have to select
338 individual components like LCD backlight, LEDs, GPIOs and Kepad 338 individual components like LCD backlight, LEDs, GPIOs and Kepad
339 under the corresponding menus. 339 under the corresponding menus.
340 340
341 config MFD_MAX8925 341 config MFD_MAX8925
342 bool "Maxim Semiconductor MAX8925 PMIC Support" 342 bool "Maxim Semiconductor MAX8925 PMIC Support"
343 depends on I2C=y && GENERIC_HARDIRQS 343 depends on I2C=y && GENERIC_HARDIRQS
344 select MFD_CORE 344 select MFD_CORE
345 help 345 help
346 Say yes here to support for Maxim Semiconductor MAX8925. This is 346 Say yes here to support for Maxim Semiconductor MAX8925. This is
347 a Power Management IC. This driver provies common support for 347 a Power Management IC. This driver provies common support for
348 accessing the device, additional drivers must be enabled in order 348 accessing the device, additional drivers must be enabled in order
349 to use the functionality of the device. 349 to use the functionality of the device.
350 350
351 config MFD_MAX8997 351 config MFD_MAX8997
352 bool "Maxim Semiconductor MAX8997/8966 PMIC Support" 352 bool "Maxim Semiconductor MAX8997/8966 PMIC Support"
353 depends on I2C=y && GENERIC_HARDIRQS 353 depends on I2C=y && GENERIC_HARDIRQS
354 select MFD_CORE 354 select MFD_CORE
355 help 355 help
356 Say yes here to support for Maxim Semiconductor MAX8998/8966. 356 Say yes here to support for Maxim Semiconductor MAX8998/8966.
357 This is a Power Management IC with RTC, Flash, Fuel Gauge, Haptic, 357 This is a Power Management IC with RTC, Flash, Fuel Gauge, Haptic,
358 MUIC controls on chip. 358 MUIC controls on chip.
359 This driver provides common support for accessing the device; 359 This driver provides common support for accessing the device;
360 additional drivers must be enabled in order to use the functionality 360 additional drivers must be enabled in order to use the functionality
361 of the device. 361 of the device.
362 362
363 config MFD_MAX8998 363 config MFD_MAX8998
364 bool "Maxim Semiconductor MAX8998/National LP3974 PMIC Support" 364 bool "Maxim Semiconductor MAX8998/National LP3974 PMIC Support"
365 depends on I2C=y && GENERIC_HARDIRQS 365 depends on I2C=y && GENERIC_HARDIRQS
366 select MFD_CORE 366 select MFD_CORE
367 help 367 help
368 Say yes here to support for Maxim Semiconductor MAX8998 and 368 Say yes here to support for Maxim Semiconductor MAX8998 and
369 National Semiconductor LP3974. This is a Power Management IC. 369 National Semiconductor LP3974. This is a Power Management IC.
370 This driver provies common support for accessing the device, 370 This driver provies common support for accessing the device,
371 additional drivers must be enabled in order to use the functionality 371 additional drivers must be enabled in order to use the functionality
372 of the device. 372 of the device.
373 373
374 config MFD_WM8400 374 config MFD_WM8400
375 tristate "Support Wolfson Microelectronics WM8400" 375 tristate "Support Wolfson Microelectronics WM8400"
376 select MFD_CORE 376 select MFD_CORE
377 depends on I2C 377 depends on I2C
378 select REGMAP_I2C 378 select REGMAP_I2C
379 help 379 help
380 Support for the Wolfson Microelecronics WM8400 PMIC and audio 380 Support for the Wolfson Microelecronics WM8400 PMIC and audio
381 CODEC. This driver provides common support for accessing 381 CODEC. This driver provides common support for accessing
382 the device, additional drivers must be enabled in order to use 382 the device, additional drivers must be enabled in order to use
383 the functionality of the device. 383 the functionality of the device.
384 384
385 config MFD_WM831X 385 config MFD_WM831X
386 bool 386 bool
387 depends on GENERIC_HARDIRQS 387 depends on GENERIC_HARDIRQS
388 388
389 config MFD_WM831X_I2C 389 config MFD_WM831X_I2C
390 bool "Support Wolfson Microelectronics WM831x/2x PMICs with I2C" 390 bool "Support Wolfson Microelectronics WM831x/2x PMICs with I2C"
391 select MFD_CORE 391 select MFD_CORE
392 select MFD_WM831X 392 select MFD_WM831X
393 select REGMAP_I2C 393 select REGMAP_I2C
394 depends on I2C=y && GENERIC_HARDIRQS 394 depends on I2C=y && GENERIC_HARDIRQS
395 help 395 help
396 Support for the Wolfson Microelecronics WM831x and WM832x PMICs 396 Support for the Wolfson Microelecronics WM831x and WM832x PMICs
397 when controlled using I2C. This driver provides common support 397 when controlled using I2C. This driver provides common support
398 for accessing the device, additional drivers must be enabled in 398 for accessing the device, additional drivers must be enabled in
399 order to use the functionality of the device. 399 order to use the functionality of the device.
400 400
401 config MFD_WM831X_SPI 401 config MFD_WM831X_SPI
402 bool "Support Wolfson Microelectronics WM831x/2x PMICs with SPI" 402 bool "Support Wolfson Microelectronics WM831x/2x PMICs with SPI"
403 select MFD_CORE 403 select MFD_CORE
404 select MFD_WM831X 404 select MFD_WM831X
405 select REGMAP_SPI 405 select REGMAP_SPI
406 depends on SPI_MASTER && GENERIC_HARDIRQS 406 depends on SPI_MASTER && GENERIC_HARDIRQS
407 help 407 help
408 Support for the Wolfson Microelecronics WM831x and WM832x PMICs 408 Support for the Wolfson Microelecronics WM831x and WM832x PMICs
409 when controlled using SPI. This driver provides common support 409 when controlled using SPI. This driver provides common support
410 for accessing the device, additional drivers must be enabled in 410 for accessing the device, additional drivers must be enabled in
411 order to use the functionality of the device. 411 order to use the functionality of the device.
412 412
413 config MFD_WM8350 413 config MFD_WM8350
414 bool 414 bool
415 depends on GENERIC_HARDIRQS 415 depends on GENERIC_HARDIRQS
416 416
417 config MFD_WM8350_CONFIG_MODE_0 417 config MFD_WM8350_CONFIG_MODE_0
418 bool 418 bool
419 depends on MFD_WM8350 419 depends on MFD_WM8350
420 420
421 config MFD_WM8350_CONFIG_MODE_1 421 config MFD_WM8350_CONFIG_MODE_1
422 bool 422 bool
423 depends on MFD_WM8350 423 depends on MFD_WM8350
424 424
425 config MFD_WM8350_CONFIG_MODE_2 425 config MFD_WM8350_CONFIG_MODE_2
426 bool 426 bool
427 depends on MFD_WM8350 427 depends on MFD_WM8350
428 428
429 config MFD_WM8350_CONFIG_MODE_3 429 config MFD_WM8350_CONFIG_MODE_3
430 bool 430 bool
431 depends on MFD_WM8350 431 depends on MFD_WM8350
432 432
433 config MFD_WM8351_CONFIG_MODE_0 433 config MFD_WM8351_CONFIG_MODE_0
434 bool 434 bool
435 depends on MFD_WM8350 435 depends on MFD_WM8350
436 436
437 config MFD_WM8351_CONFIG_MODE_1 437 config MFD_WM8351_CONFIG_MODE_1
438 bool 438 bool
439 depends on MFD_WM8350 439 depends on MFD_WM8350
440 440
441 config MFD_WM8351_CONFIG_MODE_2 441 config MFD_WM8351_CONFIG_MODE_2
442 bool 442 bool
443 depends on MFD_WM8350 443 depends on MFD_WM8350
444 444
445 config MFD_WM8351_CONFIG_MODE_3 445 config MFD_WM8351_CONFIG_MODE_3
446 bool 446 bool
447 depends on MFD_WM8350 447 depends on MFD_WM8350
448 448
449 config MFD_WM8352_CONFIG_MODE_0 449 config MFD_WM8352_CONFIG_MODE_0
450 bool 450 bool
451 depends on MFD_WM8350 451 depends on MFD_WM8350
452 452
453 config MFD_WM8352_CONFIG_MODE_1 453 config MFD_WM8352_CONFIG_MODE_1
454 bool 454 bool
455 depends on MFD_WM8350 455 depends on MFD_WM8350
456 456
457 config MFD_WM8352_CONFIG_MODE_2 457 config MFD_WM8352_CONFIG_MODE_2
458 bool 458 bool
459 depends on MFD_WM8350 459 depends on MFD_WM8350
460 460
461 config MFD_WM8352_CONFIG_MODE_3 461 config MFD_WM8352_CONFIG_MODE_3
462 bool 462 bool
463 depends on MFD_WM8350 463 depends on MFD_WM8350
464 464
465 config MFD_WM8350_I2C 465 config MFD_WM8350_I2C
466 bool "Support Wolfson Microelectronics WM8350 with I2C" 466 bool "Support Wolfson Microelectronics WM8350 with I2C"
467 select MFD_WM8350 467 select MFD_WM8350
468 depends on I2C=y && GENERIC_HARDIRQS 468 depends on I2C=y && GENERIC_HARDIRQS
469 help 469 help
470 The WM8350 is an integrated audio and power management 470 The WM8350 is an integrated audio and power management
471 subsystem with watchdog and RTC functionality for embedded 471 subsystem with watchdog and RTC functionality for embedded
472 systems. This option enables core support for the WM8350 with 472 systems. This option enables core support for the WM8350 with
473 I2C as the control interface. Additional options must be 473 I2C as the control interface. Additional options must be
474 selected to enable support for the functionality of the chip. 474 selected to enable support for the functionality of the chip.
475 475
476 config MFD_WM8994 476 config MFD_WM8994
477 bool "Support Wolfson Microelectronics WM8994" 477 bool "Support Wolfson Microelectronics WM8994"
478 select MFD_CORE 478 select MFD_CORE
479 select REGMAP_I2C 479 select REGMAP_I2C
480 select REGMAP_IRQ
480 depends on I2C=y && GENERIC_HARDIRQS 481 depends on I2C=y && GENERIC_HARDIRQS
481 help 482 help
482 The WM8994 is a highly integrated hi-fi CODEC designed for 483 The WM8994 is a highly integrated hi-fi CODEC designed for
483 smartphone applicatiosn. As well as audio functionality it 484 smartphone applicatiosn. As well as audio functionality it
484 has on board GPIO and regulator functionality which is 485 has on board GPIO and regulator functionality which is
485 supported via the relevant subsystems. This driver provides 486 supported via the relevant subsystems. This driver provides
486 core support for the WM8994, in order to use the actual 487 core support for the WM8994, in order to use the actual
487 functionaltiy of the device other drivers must be enabled. 488 functionaltiy of the device other drivers must be enabled.
488 489
489 config MFD_PCF50633 490 config MFD_PCF50633
490 tristate "Support for NXP PCF50633" 491 tristate "Support for NXP PCF50633"
491 depends on I2C 492 depends on I2C
492 select REGMAP_I2C 493 select REGMAP_I2C
493 help 494 help
494 Say yes here if you have NXP PCF50633 chip on your board. 495 Say yes here if you have NXP PCF50633 chip on your board.
495 This core driver provides register access and IRQ handling 496 This core driver provides register access and IRQ handling
496 facilities, and registers devices for the various functions 497 facilities, and registers devices for the various functions
497 so that function-specific drivers can bind to them. 498 so that function-specific drivers can bind to them.
498 499
499 config PCF50633_ADC 500 config PCF50633_ADC
500 tristate "Support for NXP PCF50633 ADC" 501 tristate "Support for NXP PCF50633 ADC"
501 depends on MFD_PCF50633 502 depends on MFD_PCF50633
502 help 503 help
503 Say yes here if you want to include support for ADC in the 504 Say yes here if you want to include support for ADC in the
504 NXP PCF50633 chip. 505 NXP PCF50633 chip.
505 506
506 config PCF50633_GPIO 507 config PCF50633_GPIO
507 tristate "Support for NXP PCF50633 GPIO" 508 tristate "Support for NXP PCF50633 GPIO"
508 depends on MFD_PCF50633 509 depends on MFD_PCF50633
509 help 510 help
510 Say yes here if you want to include support GPIO for pins on 511 Say yes here if you want to include support GPIO for pins on
511 the PCF50633 chip. 512 the PCF50633 chip.
512 513
513 config MFD_MC13783 514 config MFD_MC13783
514 tristate 515 tristate
515 516
516 config MFD_MC13XXX 517 config MFD_MC13XXX
517 tristate "Support Freescale MC13783 and MC13892" 518 tristate "Support Freescale MC13783 and MC13892"
518 depends on SPI_MASTER 519 depends on SPI_MASTER
519 select MFD_CORE 520 select MFD_CORE
520 select MFD_MC13783 521 select MFD_MC13783
521 help 522 help
522 Support for the Freescale (Atlas) PMIC and audio CODECs 523 Support for the Freescale (Atlas) PMIC and audio CODECs
523 MC13783 and MC13892. 524 MC13783 and MC13892.
524 This driver provides common support for accessing the device, 525 This driver provides common support for accessing the device,
525 additional drivers must be enabled in order to use the 526 additional drivers must be enabled in order to use the
526 functionality of the device. 527 functionality of the device.
527 528
528 config ABX500_CORE 529 config ABX500_CORE
529 bool "ST-Ericsson ABX500 Mixed Signal Circuit register functions" 530 bool "ST-Ericsson ABX500 Mixed Signal Circuit register functions"
530 default y if ARCH_U300 || ARCH_U8500 531 default y if ARCH_U300 || ARCH_U8500
531 help 532 help
532 Say yes here if you have the ABX500 Mixed Signal IC family 533 Say yes here if you have the ABX500 Mixed Signal IC family
533 chips. This core driver expose register access functions. 534 chips. This core driver expose register access functions.
534 Functionality specific drivers using these functions can 535 Functionality specific drivers using these functions can
535 remain unchanged when IC changes. Binding of the functions to 536 remain unchanged when IC changes. Binding of the functions to
536 actual register access is done by the IC core driver. 537 actual register access is done by the IC core driver.
537 538
538 config AB3100_CORE 539 config AB3100_CORE
539 bool "ST-Ericsson AB3100 Mixed Signal Circuit core functions" 540 bool "ST-Ericsson AB3100 Mixed Signal Circuit core functions"
540 depends on I2C=y && ABX500_CORE 541 depends on I2C=y && ABX500_CORE
541 select MFD_CORE 542 select MFD_CORE
542 default y if ARCH_U300 543 default y if ARCH_U300
543 help 544 help
544 Select this to enable the AB3100 Mixed Signal IC core 545 Select this to enable the AB3100 Mixed Signal IC core
545 functionality. This connects to a AB3100 on the I2C bus 546 functionality. This connects to a AB3100 on the I2C bus
546 and expose a number of symbols needed for dependent devices 547 and expose a number of symbols needed for dependent devices
547 to read and write registers and subscribe to events from 548 to read and write registers and subscribe to events from
548 this multi-functional IC. This is needed to use other features 549 this multi-functional IC. This is needed to use other features
549 of the AB3100 such as battery-backed RTC, charging control, 550 of the AB3100 such as battery-backed RTC, charging control,
550 LEDs, vibrator, system power and temperature, power management 551 LEDs, vibrator, system power and temperature, power management
551 and ALSA sound. 552 and ALSA sound.
552 553
553 config AB3100_OTP 554 config AB3100_OTP
554 tristate "ST-Ericsson AB3100 OTP functions" 555 tristate "ST-Ericsson AB3100 OTP functions"
555 depends on AB3100_CORE 556 depends on AB3100_CORE
556 default y if AB3100_CORE 557 default y if AB3100_CORE
557 help 558 help
558 Select this to enable the AB3100 Mixed Signal IC OTP (one-time 559 Select this to enable the AB3100 Mixed Signal IC OTP (one-time
559 programmable memory) support. This exposes a sysfs file to read 560 programmable memory) support. This exposes a sysfs file to read
560 out OTP values. 561 out OTP values.
561 562
562 config EZX_PCAP 563 config EZX_PCAP
563 bool "PCAP Support" 564 bool "PCAP Support"
564 depends on GENERIC_HARDIRQS && SPI_MASTER 565 depends on GENERIC_HARDIRQS && SPI_MASTER
565 help 566 help
566 This enables the PCAP ASIC present on EZX Phones. This is 567 This enables the PCAP ASIC present on EZX Phones. This is
567 needed for MMC, TouchScreen, Sound, USB, etc.. 568 needed for MMC, TouchScreen, Sound, USB, etc..
568 569
569 config AB5500_CORE 570 config AB5500_CORE
570 bool "ST-Ericsson AB5500 Mixed Signal Power Management chip" 571 bool "ST-Ericsson AB5500 Mixed Signal Power Management chip"
571 depends on ABX500_CORE && MFD_DB5500_PRCMU 572 depends on ABX500_CORE && MFD_DB5500_PRCMU
572 select MFD_CORE 573 select MFD_CORE
573 help 574 help
574 Select this option to enable access to AB5500 power management 575 Select this option to enable access to AB5500 power management
575 chip. This connects to the db5500 chip via the I2C bus via PRCMU. 576 chip. This connects to the db5500 chip via the I2C bus via PRCMU.
576 This chip embeds various other multimedia funtionalities as well. 577 This chip embeds various other multimedia funtionalities as well.
577 578
578 config AB5500_DEBUG 579 config AB5500_DEBUG
579 bool "Enable debug info via debugfs" 580 bool "Enable debug info via debugfs"
580 depends on AB5500_CORE && DEBUG_FS 581 depends on AB5500_CORE && DEBUG_FS
581 default y if DEBUG_FS 582 default y if DEBUG_FS
582 help 583 help
583 Select this option if you want debug information from the AB5500 584 Select this option if you want debug information from the AB5500
584 using the debug filesystem, debugfs. 585 using the debug filesystem, debugfs.
585 586
586 config AB8500_CORE 587 config AB8500_CORE
587 bool "ST-Ericsson AB8500 Mixed Signal Power Management chip" 588 bool "ST-Ericsson AB8500 Mixed Signal Power Management chip"
588 depends on GENERIC_HARDIRQS && ABX500_CORE 589 depends on GENERIC_HARDIRQS && ABX500_CORE
589 select MFD_CORE 590 select MFD_CORE
590 help 591 help
591 Select this option to enable access to AB8500 power management 592 Select this option to enable access to AB8500 power management
592 chip. This connects to U8500 either on the SSP/SPI bus (deprecated 593 chip. This connects to U8500 either on the SSP/SPI bus (deprecated
593 since hardware version v1.0) or the I2C bus via PRCMU. It also adds 594 since hardware version v1.0) or the I2C bus via PRCMU. It also adds
594 the irq_chip parts for handling the Mixed Signal chip events. 595 the irq_chip parts for handling the Mixed Signal chip events.
595 This chip embeds various other multimedia funtionalities as well. 596 This chip embeds various other multimedia funtionalities as well.
596 597
597 config AB8500_I2C_CORE 598 config AB8500_I2C_CORE
598 bool "AB8500 register access via PRCMU I2C" 599 bool "AB8500 register access via PRCMU I2C"
599 depends on AB8500_CORE && MFD_DB8500_PRCMU 600 depends on AB8500_CORE && MFD_DB8500_PRCMU
600 default y 601 default y
601 help 602 help
602 This enables register access to the AB8500 chip via PRCMU I2C. 603 This enables register access to the AB8500 chip via PRCMU I2C.
603 The AB8500 chip can be accessed via SPI or I2C. On DB8500 hardware 604 The AB8500 chip can be accessed via SPI or I2C. On DB8500 hardware
604 the I2C bus is connected to the Power Reset 605 the I2C bus is connected to the Power Reset
605 and Mangagement Unit, PRCMU. 606 and Mangagement Unit, PRCMU.
606 607
607 config AB8500_DEBUG 608 config AB8500_DEBUG
608 bool "Enable debug info via debugfs" 609 bool "Enable debug info via debugfs"
609 depends on AB8500_CORE && DEBUG_FS 610 depends on AB8500_CORE && DEBUG_FS
610 default y if DEBUG_FS 611 default y if DEBUG_FS
611 help 612 help
612 Select this option if you want debug information using the debug 613 Select this option if you want debug information using the debug
613 filesystem, debugfs. 614 filesystem, debugfs.
614 615
615 config AB8500_GPADC 616 config AB8500_GPADC
616 bool "AB8500 GPADC driver" 617 bool "AB8500 GPADC driver"
617 depends on AB8500_CORE && REGULATOR_AB8500 618 depends on AB8500_CORE && REGULATOR_AB8500
618 default y 619 default y
619 help 620 help
620 AB8500 GPADC driver used to convert Acc and battery/ac/usb voltage 621 AB8500 GPADC driver used to convert Acc and battery/ac/usb voltage
621 622
622 config MFD_DB8500_PRCMU 623 config MFD_DB8500_PRCMU
623 bool "ST-Ericsson DB8500 Power Reset Control Management Unit" 624 bool "ST-Ericsson DB8500 Power Reset Control Management Unit"
624 depends on UX500_SOC_DB8500 625 depends on UX500_SOC_DB8500
625 select MFD_CORE 626 select MFD_CORE
626 help 627 help
627 Select this option to enable support for the DB8500 Power Reset 628 Select this option to enable support for the DB8500 Power Reset
628 and Control Management Unit. This is basically an autonomous 629 and Control Management Unit. This is basically an autonomous
629 system controller running an XP70 microprocessor, which is accessed 630 system controller running an XP70 microprocessor, which is accessed
630 through a register map. 631 through a register map.
631 632
632 config MFD_DB5500_PRCMU 633 config MFD_DB5500_PRCMU
633 bool "ST-Ericsson DB5500 Power Reset Control Management Unit" 634 bool "ST-Ericsson DB5500 Power Reset Control Management Unit"
634 depends on UX500_SOC_DB5500 635 depends on UX500_SOC_DB5500
635 select MFD_CORE 636 select MFD_CORE
636 help 637 help
637 Select this option to enable support for the DB5500 Power Reset 638 Select this option to enable support for the DB5500 Power Reset
638 and Control Management Unit. This is basically an autonomous 639 and Control Management Unit. This is basically an autonomous
639 system controller running an XP70 microprocessor, which is accessed 640 system controller running an XP70 microprocessor, which is accessed
640 through a register map. 641 through a register map.
641 642
642 config MFD_CS5535 643 config MFD_CS5535
643 tristate "Support for CS5535 and CS5536 southbridge core functions" 644 tristate "Support for CS5535 and CS5536 southbridge core functions"
644 select MFD_CORE 645 select MFD_CORE
645 depends on PCI && X86 646 depends on PCI && X86
646 ---help--- 647 ---help---
647 This is the core driver for CS5535/CS5536 MFD functions. This is 648 This is the core driver for CS5535/CS5536 MFD functions. This is
648 necessary for using the board's GPIO and MFGPT functionality. 649 necessary for using the board's GPIO and MFGPT functionality.
649 650
650 config MFD_TIMBERDALE 651 config MFD_TIMBERDALE
651 tristate "Support for the Timberdale FPGA" 652 tristate "Support for the Timberdale FPGA"
652 select MFD_CORE 653 select MFD_CORE
653 depends on PCI && GPIOLIB 654 depends on PCI && GPIOLIB
654 ---help--- 655 ---help---
655 This is the core driver for the timberdale FPGA. This device is a 656 This is the core driver for the timberdale FPGA. This device is a
656 multifunction device which exposes numerous platform devices. 657 multifunction device which exposes numerous platform devices.
657 658
658 The timberdale FPGA can be found on the Intel Atom development board 659 The timberdale FPGA can be found on the Intel Atom development board
659 for in-vehicle infontainment, called Russellville. 660 for in-vehicle infontainment, called Russellville.
660 661
661 config LPC_SCH 662 config LPC_SCH
662 tristate "Intel SCH LPC" 663 tristate "Intel SCH LPC"
663 depends on PCI 664 depends on PCI
664 select MFD_CORE 665 select MFD_CORE
665 help 666 help
666 LPC bridge function of the Intel SCH provides support for 667 LPC bridge function of the Intel SCH provides support for
667 System Management Bus and General Purpose I/O. 668 System Management Bus and General Purpose I/O.
668 669
669 config MFD_RDC321X 670 config MFD_RDC321X
670 tristate "Support for RDC-R321x southbridge" 671 tristate "Support for RDC-R321x southbridge"
671 select MFD_CORE 672 select MFD_CORE
672 depends on PCI 673 depends on PCI
673 help 674 help
674 Say yes here if you want to have support for the RDC R-321x SoC 675 Say yes here if you want to have support for the RDC R-321x SoC
675 southbridge which provides access to GPIOs and Watchdog using the 676 southbridge which provides access to GPIOs and Watchdog using the
676 southbridge PCI device configuration space. 677 southbridge PCI device configuration space.
677 678
678 config MFD_JANZ_CMODIO 679 config MFD_JANZ_CMODIO
679 tristate "Support for Janz CMOD-IO PCI MODULbus Carrier Board" 680 tristate "Support for Janz CMOD-IO PCI MODULbus Carrier Board"
680 select MFD_CORE 681 select MFD_CORE
681 depends on PCI 682 depends on PCI
682 help 683 help
683 This is the core driver for the Janz CMOD-IO PCI MODULbus 684 This is the core driver for the Janz CMOD-IO PCI MODULbus
684 carrier board. This device is a PCI to MODULbus bridge which may 685 carrier board. This device is a PCI to MODULbus bridge which may
685 host many different types of MODULbus daughterboards, including 686 host many different types of MODULbus daughterboards, including
686 CAN and GPIO controllers. 687 CAN and GPIO controllers.
687 688
688 config MFD_JZ4740_ADC 689 config MFD_JZ4740_ADC
689 bool "Support for the JZ4740 SoC ADC core" 690 bool "Support for the JZ4740 SoC ADC core"
690 select MFD_CORE 691 select MFD_CORE
691 select GENERIC_IRQ_CHIP 692 select GENERIC_IRQ_CHIP
692 depends on MACH_JZ4740 693 depends on MACH_JZ4740
693 help 694 help
694 Say yes here if you want support for the ADC unit in the JZ4740 SoC. 695 Say yes here if you want support for the ADC unit in the JZ4740 SoC.
695 This driver is necessary for jz4740-battery and jz4740-hwmon driver. 696 This driver is necessary for jz4740-battery and jz4740-hwmon driver.
696 697
697 config MFD_VX855 698 config MFD_VX855
698 tristate "Support for VIA VX855/VX875 integrated south bridge" 699 tristate "Support for VIA VX855/VX875 integrated south bridge"
699 depends on PCI 700 depends on PCI
700 select MFD_CORE 701 select MFD_CORE
701 help 702 help
702 Say yes here to enable support for various functions of the 703 Say yes here to enable support for various functions of the
703 VIA VX855/VX875 south bridge. You will need to enable the vx855_spi 704 VIA VX855/VX875 south bridge. You will need to enable the vx855_spi
704 and/or vx855_gpio drivers for this to do anything useful. 705 and/or vx855_gpio drivers for this to do anything useful.
705 706
706 config MFD_WL1273_CORE 707 config MFD_WL1273_CORE
707 tristate "Support for TI WL1273 FM radio." 708 tristate "Support for TI WL1273 FM radio."
708 depends on I2C 709 depends on I2C
709 select MFD_CORE 710 select MFD_CORE
710 default n 711 default n
711 help 712 help
712 This is the core driver for the TI WL1273 FM radio. This MFD 713 This is the core driver for the TI WL1273 FM radio. This MFD
713 driver connects the radio-wl1273 V4L2 module and the wl1273 714 driver connects the radio-wl1273 V4L2 module and the wl1273
714 audio codec. 715 audio codec.
715 716
716 config MFD_OMAP_USB_HOST 717 config MFD_OMAP_USB_HOST
717 bool "Support OMAP USBHS core driver" 718 bool "Support OMAP USBHS core driver"
718 depends on USB_EHCI_HCD_OMAP || USB_OHCI_HCD_OMAP3 719 depends on USB_EHCI_HCD_OMAP || USB_OHCI_HCD_OMAP3
719 default y 720 default y
720 help 721 help
721 This is the core driver for the OAMP EHCI and OHCI drivers. 722 This is the core driver for the OAMP EHCI and OHCI drivers.
722 This MFD driver does the required setup functionalities for 723 This MFD driver does the required setup functionalities for
723 OMAP USB Host drivers. 724 OMAP USB Host drivers.
724 725
725 config MFD_PM8XXX 726 config MFD_PM8XXX
726 tristate 727 tristate
727 728
728 config MFD_PM8921_CORE 729 config MFD_PM8921_CORE
729 tristate "Qualcomm PM8921 PMIC chip" 730 tristate "Qualcomm PM8921 PMIC chip"
730 depends on MSM_SSBI 731 depends on MSM_SSBI
731 select MFD_CORE 732 select MFD_CORE
732 select MFD_PM8XXX 733 select MFD_PM8XXX
733 help 734 help
734 If you say yes to this option, support will be included for the 735 If you say yes to this option, support will be included for the
735 built-in PM8921 PMIC chip. 736 built-in PM8921 PMIC chip.
736 737
737 This is required if your board has a PM8921 and uses its features, 738 This is required if your board has a PM8921 and uses its features,
738 such as: MPPs, GPIOs, regulators, interrupts, and PWM. 739 such as: MPPs, GPIOs, regulators, interrupts, and PWM.
739 740
740 Say M here if you want to include support for PM8921 chip as a module. 741 Say M here if you want to include support for PM8921 chip as a module.
741 This will build a module called "pm8921-core". 742 This will build a module called "pm8921-core".
742 743
743 config MFD_PM8XXX_IRQ 744 config MFD_PM8XXX_IRQ
744 bool "Support for Qualcomm PM8xxx IRQ features" 745 bool "Support for Qualcomm PM8xxx IRQ features"
745 depends on MFD_PM8XXX 746 depends on MFD_PM8XXX
746 default y if MFD_PM8XXX 747 default y if MFD_PM8XXX
747 help 748 help
748 This is the IRQ driver for Qualcomm PM 8xxx PMIC chips. 749 This is the IRQ driver for Qualcomm PM 8xxx PMIC chips.
749 750
750 This is required to use certain other PM 8xxx features, such as GPIO 751 This is required to use certain other PM 8xxx features, such as GPIO
751 and MPP. 752 and MPP.
752 753
753 config TPS65911_COMPARATOR 754 config TPS65911_COMPARATOR
754 tristate 755 tristate
755 756
756 config MFD_AAT2870_CORE 757 config MFD_AAT2870_CORE
757 bool "Support for the AnalogicTech AAT2870" 758 bool "Support for the AnalogicTech AAT2870"
758 select MFD_CORE 759 select MFD_CORE
759 depends on I2C=y && GPIOLIB 760 depends on I2C=y && GPIOLIB
760 help 761 help
761 If you say yes here you get support for the AAT2870. 762 If you say yes here you get support for the AAT2870.
762 This driver provides common support for accessing the device, 763 This driver provides common support for accessing the device,
763 additional drivers must be enabled in order to use the 764 additional drivers must be enabled in order to use the
764 functionality of the device. 765 functionality of the device.
765 766
766 config MFD_INTEL_MSIC 767 config MFD_INTEL_MSIC
767 bool "Support for Intel MSIC" 768 bool "Support for Intel MSIC"
768 depends on INTEL_SCU_IPC 769 depends on INTEL_SCU_IPC
769 select MFD_CORE 770 select MFD_CORE
770 help 771 help
771 Select this option to enable access to Intel MSIC (Avatele 772 Select this option to enable access to Intel MSIC (Avatele
772 Passage) chip. This chip embeds audio, battery, GPIO, etc. 773 Passage) chip. This chip embeds audio, battery, GPIO, etc.
773 devices used in Intel Medfield platforms. 774 devices used in Intel Medfield platforms.
774 775
775 endmenu 776 endmenu
776 endif 777 endif
777 778
778 menu "Multimedia Capabilities Port drivers" 779 menu "Multimedia Capabilities Port drivers"
779 depends on ARCH_SA1100 780 depends on ARCH_SA1100
780 781
781 config MCP 782 config MCP
782 tristate 783 tristate
783 784
784 # Interface drivers 785 # Interface drivers
785 config MCP_SA11X0 786 config MCP_SA11X0
786 tristate "Support SA11x0 MCP interface" 787 tristate "Support SA11x0 MCP interface"
787 depends on ARCH_SA1100 788 depends on ARCH_SA1100
788 select MCP 789 select MCP
789 790
790 # Chip drivers 791 # Chip drivers
791 config MCP_UCB1200 792 config MCP_UCB1200
792 tristate "Support for UCB1200 / UCB1300" 793 tristate "Support for UCB1200 / UCB1300"
793 depends on MCP 794 depends on MCP
794 795
795 config MCP_UCB1200_TS 796 config MCP_UCB1200_TS
796 tristate "Touchscreen interface support" 797 tristate "Touchscreen interface support"
797 depends on MCP_UCB1200 && INPUT 798 depends on MCP_UCB1200 && INPUT
798 799
799 endmenu 800 endmenu
800 801
drivers/mfd/wm8994-irq.c
1 /* 1 /*
2 * wm8994-irq.c -- Interrupt controller support for Wolfson WM8994 2 * wm8994-irq.c -- Interrupt controller support for Wolfson WM8994
3 * 3 *
4 * Copyright 2010 Wolfson Microelectronics PLC. 4 * Copyright 2010 Wolfson Microelectronics PLC.
5 * 5 *
6 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> 6 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify it 8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the 9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your 10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version. 11 * option) any later version.
12 * 12 *
13 */ 13 */
14 14
15 #include <linux/kernel.h> 15 #include <linux/kernel.h>
16 #include <linux/module.h> 16 #include <linux/module.h>
17 #include <linux/i2c.h> 17 #include <linux/i2c.h>
18 #include <linux/irq.h> 18 #include <linux/irq.h>
19 #include <linux/mfd/core.h> 19 #include <linux/mfd/core.h>
20 #include <linux/interrupt.h> 20 #include <linux/interrupt.h>
21 #include <linux/regmap.h>
21 22
22 #include <linux/mfd/wm8994/core.h> 23 #include <linux/mfd/wm8994/core.h>
23 #include <linux/mfd/wm8994/registers.h> 24 #include <linux/mfd/wm8994/registers.h>
24 25
25 #include <linux/delay.h> 26 #include <linux/delay.h>
26 27
27 struct wm8994_irq_data { 28 static struct regmap_irq wm8994_irqs[] = {
28 int reg;
29 int mask;
30 };
31
32 static struct wm8994_irq_data wm8994_irqs[] = {
33 [WM8994_IRQ_TEMP_SHUT] = { 29 [WM8994_IRQ_TEMP_SHUT] = {
34 .reg = 2, 30 .reg_offset = 1,
35 .mask = WM8994_TEMP_SHUT_EINT, 31 .mask = WM8994_TEMP_SHUT_EINT,
36 }, 32 },
37 [WM8994_IRQ_MIC1_DET] = { 33 [WM8994_IRQ_MIC1_DET] = {
38 .reg = 2, 34 .reg_offset = 1,
39 .mask = WM8994_MIC1_DET_EINT, 35 .mask = WM8994_MIC1_DET_EINT,
40 }, 36 },
41 [WM8994_IRQ_MIC1_SHRT] = { 37 [WM8994_IRQ_MIC1_SHRT] = {
42 .reg = 2, 38 .reg_offset = 1,
43 .mask = WM8994_MIC1_SHRT_EINT, 39 .mask = WM8994_MIC1_SHRT_EINT,
44 }, 40 },
45 [WM8994_IRQ_MIC2_DET] = { 41 [WM8994_IRQ_MIC2_DET] = {
46 .reg = 2, 42 .reg_offset = 1,
47 .mask = WM8994_MIC2_DET_EINT, 43 .mask = WM8994_MIC2_DET_EINT,
48 }, 44 },
49 [WM8994_IRQ_MIC2_SHRT] = { 45 [WM8994_IRQ_MIC2_SHRT] = {
50 .reg = 2, 46 .reg_offset = 1,
51 .mask = WM8994_MIC2_SHRT_EINT, 47 .mask = WM8994_MIC2_SHRT_EINT,
52 }, 48 },
53 [WM8994_IRQ_FLL1_LOCK] = { 49 [WM8994_IRQ_FLL1_LOCK] = {
54 .reg = 2, 50 .reg_offset = 1,
55 .mask = WM8994_FLL1_LOCK_EINT, 51 .mask = WM8994_FLL1_LOCK_EINT,
56 }, 52 },
57 [WM8994_IRQ_FLL2_LOCK] = { 53 [WM8994_IRQ_FLL2_LOCK] = {
58 .reg = 2, 54 .reg_offset = 1,
59 .mask = WM8994_FLL2_LOCK_EINT, 55 .mask = WM8994_FLL2_LOCK_EINT,
60 }, 56 },
61 [WM8994_IRQ_SRC1_LOCK] = { 57 [WM8994_IRQ_SRC1_LOCK] = {
62 .reg = 2, 58 .reg_offset = 1,
63 .mask = WM8994_SRC1_LOCK_EINT, 59 .mask = WM8994_SRC1_LOCK_EINT,
64 }, 60 },
65 [WM8994_IRQ_SRC2_LOCK] = { 61 [WM8994_IRQ_SRC2_LOCK] = {
66 .reg = 2, 62 .reg_offset = 1,
67 .mask = WM8994_SRC2_LOCK_EINT, 63 .mask = WM8994_SRC2_LOCK_EINT,
68 }, 64 },
69 [WM8994_IRQ_AIF1DRC1_SIG_DET] = { 65 [WM8994_IRQ_AIF1DRC1_SIG_DET] = {
70 .reg = 2, 66 .reg_offset = 1,
71 .mask = WM8994_AIF1DRC1_SIG_DET, 67 .mask = WM8994_AIF1DRC1_SIG_DET,
72 }, 68 },
73 [WM8994_IRQ_AIF1DRC2_SIG_DET] = { 69 [WM8994_IRQ_AIF1DRC2_SIG_DET] = {
74 .reg = 2, 70 .reg_offset = 1,
75 .mask = WM8994_AIF1DRC2_SIG_DET_EINT, 71 .mask = WM8994_AIF1DRC2_SIG_DET_EINT,
76 }, 72 },
77 [WM8994_IRQ_AIF2DRC_SIG_DET] = { 73 [WM8994_IRQ_AIF2DRC_SIG_DET] = {
78 .reg = 2, 74 .reg_offset = 1,
79 .mask = WM8994_AIF2DRC_SIG_DET_EINT, 75 .mask = WM8994_AIF2DRC_SIG_DET_EINT,
80 }, 76 },
81 [WM8994_IRQ_FIFOS_ERR] = { 77 [WM8994_IRQ_FIFOS_ERR] = {
82 .reg = 2, 78 .reg_offset = 1,
83 .mask = WM8994_FIFOS_ERR_EINT, 79 .mask = WM8994_FIFOS_ERR_EINT,
84 }, 80 },
85 [WM8994_IRQ_WSEQ_DONE] = { 81 [WM8994_IRQ_WSEQ_DONE] = {
86 .reg = 2, 82 .reg_offset = 1,
87 .mask = WM8994_WSEQ_DONE_EINT, 83 .mask = WM8994_WSEQ_DONE_EINT,
88 }, 84 },
89 [WM8994_IRQ_DCS_DONE] = { 85 [WM8994_IRQ_DCS_DONE] = {
90 .reg = 2, 86 .reg_offset = 1,
91 .mask = WM8994_DCS_DONE_EINT, 87 .mask = WM8994_DCS_DONE_EINT,
92 }, 88 },
93 [WM8994_IRQ_TEMP_WARN] = { 89 [WM8994_IRQ_TEMP_WARN] = {
94 .reg = 2, 90 .reg_offset = 1,
95 .mask = WM8994_TEMP_WARN_EINT, 91 .mask = WM8994_TEMP_WARN_EINT,
96 }, 92 },
97 [WM8994_IRQ_GPIO(1)] = { 93 [WM8994_IRQ_GPIO(1)] = {
98 .reg = 1,
99 .mask = WM8994_GP1_EINT, 94 .mask = WM8994_GP1_EINT,
100 }, 95 },
101 [WM8994_IRQ_GPIO(2)] = { 96 [WM8994_IRQ_GPIO(2)] = {
102 .reg = 1,
103 .mask = WM8994_GP2_EINT, 97 .mask = WM8994_GP2_EINT,
104 }, 98 },
105 [WM8994_IRQ_GPIO(3)] = { 99 [WM8994_IRQ_GPIO(3)] = {
106 .reg = 1,
107 .mask = WM8994_GP3_EINT, 100 .mask = WM8994_GP3_EINT,
108 }, 101 },
109 [WM8994_IRQ_GPIO(4)] = { 102 [WM8994_IRQ_GPIO(4)] = {
110 .reg = 1,
111 .mask = WM8994_GP4_EINT, 103 .mask = WM8994_GP4_EINT,
112 }, 104 },
113 [WM8994_IRQ_GPIO(5)] = { 105 [WM8994_IRQ_GPIO(5)] = {
114 .reg = 1,
115 .mask = WM8994_GP5_EINT, 106 .mask = WM8994_GP5_EINT,
116 }, 107 },
117 [WM8994_IRQ_GPIO(6)] = { 108 [WM8994_IRQ_GPIO(6)] = {
118 .reg = 1,
119 .mask = WM8994_GP6_EINT, 109 .mask = WM8994_GP6_EINT,
120 }, 110 },
121 [WM8994_IRQ_GPIO(7)] = { 111 [WM8994_IRQ_GPIO(7)] = {
122 .reg = 1,
123 .mask = WM8994_GP7_EINT, 112 .mask = WM8994_GP7_EINT,
124 }, 113 },
125 [WM8994_IRQ_GPIO(8)] = { 114 [WM8994_IRQ_GPIO(8)] = {
126 .reg = 1,
127 .mask = WM8994_GP8_EINT, 115 .mask = WM8994_GP8_EINT,
128 }, 116 },
129 [WM8994_IRQ_GPIO(9)] = { 117 [WM8994_IRQ_GPIO(9)] = {
130 .reg = 1,
131 .mask = WM8994_GP8_EINT, 118 .mask = WM8994_GP8_EINT,
132 }, 119 },
133 [WM8994_IRQ_GPIO(10)] = { 120 [WM8994_IRQ_GPIO(10)] = {
134 .reg = 1,
135 .mask = WM8994_GP10_EINT, 121 .mask = WM8994_GP10_EINT,
136 }, 122 },
137 [WM8994_IRQ_GPIO(11)] = { 123 [WM8994_IRQ_GPIO(11)] = {
138 .reg = 1,
139 .mask = WM8994_GP11_EINT, 124 .mask = WM8994_GP11_EINT,
140 }, 125 },
141 }; 126 };
142 127
143 static inline struct wm8994_irq_data *irq_to_wm8994_irq(struct wm8994 *wm8994, 128 static struct regmap_irq_chip wm8994_irq_chip = {
144 int irq) 129 .name = "wm8994",
145 { 130 .irqs = wm8994_irqs,
146 return &wm8994_irqs[irq - wm8994->irq_base]; 131 .num_irqs = ARRAY_SIZE(wm8994_irqs),
147 }
148 132
149 static void wm8994_irq_lock(struct irq_data *data) 133 .num_regs = 2,
150 { 134 .status_base = WM8994_INTERRUPT_STATUS_1,
151 struct wm8994 *wm8994 = irq_data_get_irq_chip_data(data); 135 .mask_base = WM8994_INTERRUPT_STATUS_1_MASK,
152 136 .ack_base = WM8994_INTERRUPT_STATUS_1,
153 mutex_lock(&wm8994->irq_lock);
154 }
155
156 static void wm8994_irq_sync_unlock(struct irq_data *data)
157 {
158 struct wm8994 *wm8994 = irq_data_get_irq_chip_data(data);
159 int i;
160
161 for (i = 0; i < ARRAY_SIZE(wm8994->irq_masks_cur); i++) {
162 /* If there's been a change in the mask write it back
163 * to the hardware. */
164 if (wm8994->irq_masks_cur[i] != wm8994->irq_masks_cache[i]) {
165 wm8994->irq_masks_cache[i] = wm8994->irq_masks_cur[i];
166 wm8994_reg_write(wm8994,
167 WM8994_INTERRUPT_STATUS_1_MASK + i,
168 wm8994->irq_masks_cur[i]);
169 }
170 }
171
172 mutex_unlock(&wm8994->irq_lock);
173 }
174
175 static void wm8994_irq_enable(struct irq_data *data)
176 {
177 struct wm8994 *wm8994 = irq_data_get_irq_chip_data(data);
178 struct wm8994_irq_data *irq_data = irq_to_wm8994_irq(wm8994,
179 data->irq);
180
181 wm8994->irq_masks_cur[irq_data->reg - 1] &= ~irq_data->mask;
182 }
183
184 static void wm8994_irq_disable(struct irq_data *data)
185 {
186 struct wm8994 *wm8994 = irq_data_get_irq_chip_data(data);
187 struct wm8994_irq_data *irq_data = irq_to_wm8994_irq(wm8994,
188 data->irq);
189
190 wm8994->irq_masks_cur[irq_data->reg - 1] |= irq_data->mask;
191 }
192
193 static struct irq_chip wm8994_irq_chip = {
194 .name = "wm8994",
195 .irq_bus_lock = wm8994_irq_lock,
196 .irq_bus_sync_unlock = wm8994_irq_sync_unlock,
197 .irq_disable = wm8994_irq_disable,
198 .irq_enable = wm8994_irq_enable,
199 }; 137 };
200 138
201 /* The processing of the primary interrupt occurs in a thread so that 139 int wm8994_irq_init(struct wm8994 *wm8994)
202 * we can interact with the device over I2C or SPI. */
203 static irqreturn_t wm8994_irq_thread(int irq, void *data)
204 { 140 {
205 struct wm8994 *wm8994 = data;
206 unsigned int i;
207 u16 status[WM8994_NUM_IRQ_REGS];
208 int ret; 141 int ret;
209 142
210 ret = wm8994_bulk_read(wm8994, WM8994_INTERRUPT_STATUS_1,
211 WM8994_NUM_IRQ_REGS, status);
212 if (ret < 0) {
213 dev_err(wm8994->dev, "Failed to read interrupt status: %d\n",
214 ret);
215 return IRQ_NONE;
216 }
217
218 /* Bit swap and apply masking */
219 for (i = 0; i < WM8994_NUM_IRQ_REGS; i++) {
220 status[i] = be16_to_cpu(status[i]);
221 status[i] &= ~wm8994->irq_masks_cur[i];
222 }
223
224 /* Ack any unmasked IRQs */
225 for (i = 0; i < ARRAY_SIZE(status); i++) {
226 if (status[i])
227 wm8994_reg_write(wm8994, WM8994_INTERRUPT_STATUS_1 + i,
228 status[i]);
229 }
230
231 /* Report */
232 for (i = 0; i < ARRAY_SIZE(wm8994_irqs); i++) {
233 if (status[wm8994_irqs[i].reg - 1] & wm8994_irqs[i].mask)
234 handle_nested_irq(wm8994->irq_base + i);
235 }
236
237 return IRQ_HANDLED;
238 }
239
240 int wm8994_irq_init(struct wm8994 *wm8994)
241 {
242 int i, cur_irq, ret;
243
244 mutex_init(&wm8994->irq_lock);
245
246 /* Mask the individual interrupt sources */
247 for (i = 0; i < ARRAY_SIZE(wm8994->irq_masks_cur); i++) {
248 wm8994->irq_masks_cur[i] = 0xffff;
249 wm8994->irq_masks_cache[i] = 0xffff;
250 wm8994_reg_write(wm8994, WM8994_INTERRUPT_STATUS_1_MASK + i,
251 0xffff);
252 }
253
254 if (!wm8994->irq) { 143 if (!wm8994->irq) {
255 dev_warn(wm8994->dev, 144 dev_warn(wm8994->dev,
256 "No interrupt specified, no interrupts\n"); 145 "No interrupt specified, no interrupts\n");
257 wm8994->irq_base = 0; 146 wm8994->irq_base = 0;
258 return 0; 147 return 0;
259 } 148 }
260 149
261 if (!wm8994->irq_base) { 150 if (!wm8994->irq_base) {
262 dev_err(wm8994->dev, 151 dev_err(wm8994->dev,
263 "No interrupt base specified, no interrupts\n"); 152 "No interrupt base specified, no interrupts\n");
264 return 0; 153 return 0;
265 } 154 }
266 155
267 /* Register them with genirq */ 156 ret = regmap_add_irq_chip(wm8994->regmap, wm8994->irq,
268 for (cur_irq = wm8994->irq_base; 157 IRQF_TRIGGER_HIGH | IRQF_ONESHOT,
269 cur_irq < ARRAY_SIZE(wm8994_irqs) + wm8994->irq_base; 158 wm8994->irq_base, &wm8994_irq_chip,
270 cur_irq++) { 159 &wm8994->irq_data);
271 irq_set_chip_data(cur_irq, wm8994);
272 irq_set_chip_and_handler(cur_irq, &wm8994_irq_chip,
273 handle_edge_irq);
274 irq_set_nested_thread(cur_irq, 1);
275
276 /* ARM needs us to explicitly flag the IRQ as valid
277 * and will set them noprobe when we do so. */
278 #ifdef CONFIG_ARM
279 set_irq_flags(cur_irq, IRQF_VALID);
280 #else
281 irq_set_noprobe(cur_irq);
282 #endif
283 }
284
285 ret = request_threaded_irq(wm8994->irq, NULL, wm8994_irq_thread,
286 IRQF_TRIGGER_HIGH | IRQF_ONESHOT,
287 "wm8994", wm8994);
288 if (ret != 0) { 160 if (ret != 0) {
289 dev_err(wm8994->dev, "Failed to request IRQ %d: %d\n", 161 dev_err(wm8994->dev, "Failed to register IRQ chip: %d\n", ret);
290 wm8994->irq, ret);
291 return ret; 162 return ret;
292 } 163 }
293 164
294 /* Enable top level interrupt if it was masked */ 165 /* Enable top level interrupt if it was masked */
295 wm8994_reg_write(wm8994, WM8994_INTERRUPT_CONTROL, 0); 166 wm8994_reg_write(wm8994, WM8994_INTERRUPT_CONTROL, 0);
296 167
297 return 0; 168 return 0;
298 } 169 }
299 170
300 void wm8994_irq_exit(struct wm8994 *wm8994) 171 void wm8994_irq_exit(struct wm8994 *wm8994)
301 { 172 {
302 if (wm8994->irq) 173 regmap_del_irq_chip(wm8994->irq, wm8994->irq_data);
303 free_irq(wm8994->irq, wm8994);
304 } 174 }
include/linux/mfd/wm8994/core.h
1 /* 1 /*
2 * include/linux/mfd/wm8994/core.h -- Core interface for WM8994 2 * include/linux/mfd/wm8994/core.h -- Core interface for WM8994
3 * 3 *
4 * Copyright 2009 Wolfson Microelectronics PLC. 4 * Copyright 2009 Wolfson Microelectronics PLC.
5 * 5 *
6 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> 6 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify it 8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the 9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your 10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version. 11 * option) any later version.
12 * 12 *
13 */ 13 */
14 14
15 #ifndef __MFD_WM8994_CORE_H__ 15 #ifndef __MFD_WM8994_CORE_H__
16 #define __MFD_WM8994_CORE_H__ 16 #define __MFD_WM8994_CORE_H__
17 17
18 #include <linux/mutex.h> 18 #include <linux/mutex.h>
19 #include <linux/interrupt.h> 19 #include <linux/interrupt.h>
20 20
21 enum wm8994_type { 21 enum wm8994_type {
22 WM8994 = 0, 22 WM8994 = 0,
23 WM8958 = 1, 23 WM8958 = 1,
24 WM1811 = 2, 24 WM1811 = 2,
25 }; 25 };
26 26
27 struct regulator_dev; 27 struct regulator_dev;
28 struct regulator_bulk_data; 28 struct regulator_bulk_data;
29 struct regmap; 29 struct regmap;
30 30
31 #define WM8994_NUM_GPIO_REGS 11 31 #define WM8994_NUM_GPIO_REGS 11
32 #define WM8994_NUM_LDO_REGS 2 32 #define WM8994_NUM_LDO_REGS 2
33 #define WM8994_NUM_IRQ_REGS 2 33 #define WM8994_NUM_IRQ_REGS 2
34 34
35 #define WM8994_IRQ_TEMP_SHUT 0 35 #define WM8994_IRQ_TEMP_SHUT 0
36 #define WM8994_IRQ_MIC1_DET 1 36 #define WM8994_IRQ_MIC1_DET 1
37 #define WM8994_IRQ_MIC1_SHRT 2 37 #define WM8994_IRQ_MIC1_SHRT 2
38 #define WM8994_IRQ_MIC2_DET 3 38 #define WM8994_IRQ_MIC2_DET 3
39 #define WM8994_IRQ_MIC2_SHRT 4 39 #define WM8994_IRQ_MIC2_SHRT 4
40 #define WM8994_IRQ_FLL1_LOCK 5 40 #define WM8994_IRQ_FLL1_LOCK 5
41 #define WM8994_IRQ_FLL2_LOCK 6 41 #define WM8994_IRQ_FLL2_LOCK 6
42 #define WM8994_IRQ_SRC1_LOCK 7 42 #define WM8994_IRQ_SRC1_LOCK 7
43 #define WM8994_IRQ_SRC2_LOCK 8 43 #define WM8994_IRQ_SRC2_LOCK 8
44 #define WM8994_IRQ_AIF1DRC1_SIG_DET 9 44 #define WM8994_IRQ_AIF1DRC1_SIG_DET 9
45 #define WM8994_IRQ_AIF1DRC2_SIG_DET 10 45 #define WM8994_IRQ_AIF1DRC2_SIG_DET 10
46 #define WM8994_IRQ_AIF2DRC_SIG_DET 11 46 #define WM8994_IRQ_AIF2DRC_SIG_DET 11
47 #define WM8994_IRQ_FIFOS_ERR 12 47 #define WM8994_IRQ_FIFOS_ERR 12
48 #define WM8994_IRQ_WSEQ_DONE 13 48 #define WM8994_IRQ_WSEQ_DONE 13
49 #define WM8994_IRQ_DCS_DONE 14 49 #define WM8994_IRQ_DCS_DONE 14
50 #define WM8994_IRQ_TEMP_WARN 15 50 #define WM8994_IRQ_TEMP_WARN 15
51 51
52 /* GPIOs in the chip are numbered from 1-11 */ 52 /* GPIOs in the chip are numbered from 1-11 */
53 #define WM8994_IRQ_GPIO(x) (x + WM8994_IRQ_TEMP_WARN) 53 #define WM8994_IRQ_GPIO(x) (x + WM8994_IRQ_TEMP_WARN)
54 54
55 struct wm8994 { 55 struct wm8994 {
56 struct mutex irq_lock; 56 struct mutex irq_lock;
57 57
58 enum wm8994_type type; 58 enum wm8994_type type;
59 int revision; 59 int revision;
60 60
61 struct device *dev; 61 struct device *dev;
62 struct regmap *regmap; 62 struct regmap *regmap;
63 63
64 bool ldo_ena_always_driven; 64 bool ldo_ena_always_driven;
65 65
66 int gpio_base; 66 int gpio_base;
67 int irq_base; 67 int irq_base;
68 68
69 int irq; 69 int irq;
70 u16 irq_masks_cur[WM8994_NUM_IRQ_REGS]; 70 struct regmap_irq_chip_data *irq_data;
71 u16 irq_masks_cache[WM8994_NUM_IRQ_REGS];
72 71
73 /* Used over suspend/resume */ 72 /* Used over suspend/resume */
74 bool suspended; 73 bool suspended;
75 74
76 struct regulator_dev *dbvdd; 75 struct regulator_dev *dbvdd;
77 int num_supplies; 76 int num_supplies;
78 struct regulator_bulk_data *supplies; 77 struct regulator_bulk_data *supplies;
79 }; 78 };
80 79
81 /* Device I/O API */ 80 /* Device I/O API */
82 int wm8994_reg_read(struct wm8994 *wm8994, unsigned short reg); 81 int wm8994_reg_read(struct wm8994 *wm8994, unsigned short reg);
83 int wm8994_reg_write(struct wm8994 *wm8994, unsigned short reg, 82 int wm8994_reg_write(struct wm8994 *wm8994, unsigned short reg,
84 unsigned short val); 83 unsigned short val);
85 int wm8994_set_bits(struct wm8994 *wm8994, unsigned short reg, 84 int wm8994_set_bits(struct wm8994 *wm8994, unsigned short reg,
86 unsigned short mask, unsigned short val); 85 unsigned short mask, unsigned short val);
87 int wm8994_bulk_read(struct wm8994 *wm8994, unsigned short reg, 86 int wm8994_bulk_read(struct wm8994 *wm8994, unsigned short reg,
88 int count, u16 *buf); 87 int count, u16 *buf);
89 int wm8994_bulk_write(struct wm8994 *wm8994, unsigned short reg, 88 int wm8994_bulk_write(struct wm8994 *wm8994, unsigned short reg,
90 int count, const u16 *buf); 89 int count, const u16 *buf);
91 90
92 91
93 /* Helper to save on boilerplate */ 92 /* Helper to save on boilerplate */
94 static inline int wm8994_request_irq(struct wm8994 *wm8994, int irq, 93 static inline int wm8994_request_irq(struct wm8994 *wm8994, int irq,
95 irq_handler_t handler, const char *name, 94 irq_handler_t handler, const char *name,
96 void *data) 95 void *data)
97 { 96 {
98 if (!wm8994->irq_base) 97 if (!wm8994->irq_base)
99 return -EINVAL; 98 return -EINVAL;
100 return request_threaded_irq(wm8994->irq_base + irq, NULL, handler, 99 return request_threaded_irq(wm8994->irq_base + irq, NULL, handler,
101 IRQF_TRIGGER_RISING, name, 100 IRQF_TRIGGER_RISING, name,
102 data); 101 data);
103 } 102 }
104 static inline void wm8994_free_irq(struct wm8994 *wm8994, int irq, void *data) 103 static inline void wm8994_free_irq(struct wm8994 *wm8994, int irq, void *data)
105 { 104 {
106 if (!wm8994->irq_base) 105 if (!wm8994->irq_base)
107 return; 106 return;
108 free_irq(wm8994->irq_base + irq, data); 107 free_irq(wm8994->irq_base + irq, data);
109 } 108 }
110 109
111 int wm8994_irq_init(struct wm8994 *wm8994); 110 int wm8994_irq_init(struct wm8994 *wm8994);
112 void wm8994_irq_exit(struct wm8994 *wm8994); 111 void wm8994_irq_exit(struct wm8994 *wm8994);
113 112
114 #endif 113 #endif
115 114