diff options
author | David Brownell <dbrownell@users.sourceforge.net> | 2008-10-20 17:46:28 -0400 |
---|---|---|
committer | Samuel Ortiz <samuel@sortiz.org> | 2008-10-21 19:19:37 -0400 |
commit | a30d46c042c8a17ef25de02f439fbd120ab8a8de (patch) | |
tree | c83c8136266862ecbe6d453887fabcbe564851e5 /include/linux | |
parent | 2515ddc6db8eb49a79f0fe5e67ff09ac7c81eab4 (diff) |
mfd: twl4030 IRQ handling update
- Move it into a separate file; clean and streamline it
- Restructure the init code for reuse during secondary dispatch
- Support both levels (primary, secondary) of IRQ dispatch
- Use a workqueue for irq mask/unmask and trigger configuration
Code for two subchips currently share that secondary handler code.
One is the power subchip; its IRQs are now handled by this core,
courtesy of this patch. The other is the GPIO module, which will
be supported through a later patch.
There are also minor changes to the header file, mostly related
to GPIO support; nothing yet in mainline cares about those. A
few references to OMAP-specific symbols are disabled; when they
can all be removed, the TWL4030 support ceases being OMAP-specific.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/i2c/twl4030.h | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/include/linux/i2c/twl4030.h b/include/linux/i2c/twl4030.h index cdb453162a97..fb604dcd38f1 100644 --- a/include/linux/i2c/twl4030.h +++ b/include/linux/i2c/twl4030.h | |||
@@ -228,6 +228,12 @@ struct twl4030_gpio_platform_data { | |||
228 | int gpio_base; | 228 | int gpio_base; |
229 | unsigned irq_base, irq_end; | 229 | unsigned irq_base, irq_end; |
230 | 230 | ||
231 | /* package the two LED signals as output-only GPIOs? */ | ||
232 | bool use_leds; | ||
233 | |||
234 | /* gpio-n should control VMMC(n+1) if BIT(n) in mmc_cd is set */ | ||
235 | u8 mmc_cd; | ||
236 | |||
231 | /* For gpio-N, bit (1 << N) in "pullups" is set if that pullup | 237 | /* For gpio-N, bit (1 << N) in "pullups" is set if that pullup |
232 | * should be enabled. Else, if that bit is set in "pulldowns", | 238 | * should be enabled. Else, if that bit is set in "pulldowns", |
233 | * that pulldown is enabled. Don't waste power by letting any | 239 | * that pulldown is enabled. Don't waste power by letting any |
@@ -277,6 +283,8 @@ struct twl4030_platform_data { | |||
277 | 283 | ||
278 | /*----------------------------------------------------------------------*/ | 284 | /*----------------------------------------------------------------------*/ |
279 | 285 | ||
286 | int twl4030_sih_setup(int module); | ||
287 | |||
280 | /* | 288 | /* |
281 | * FIXME completely stop using TWL4030_IRQ_BASE ... instead, pass the | 289 | * FIXME completely stop using TWL4030_IRQ_BASE ... instead, pass the |
282 | * IRQ data to subsidiary devices using platform device resources. | 290 | * IRQ data to subsidiary devices using platform device resources. |
@@ -291,16 +299,16 @@ struct twl4030_platform_data { | |||
291 | #define TWL4030_MODIRQ_BCI (TWL4030_IRQ_BASE + 2) | 299 | #define TWL4030_MODIRQ_BCI (TWL4030_IRQ_BASE + 2) |
292 | #define TWL4030_MODIRQ_MADC (TWL4030_IRQ_BASE + 3) | 300 | #define TWL4030_MODIRQ_MADC (TWL4030_IRQ_BASE + 3) |
293 | /* #define TWL4030_MODIRQ_USB (TWL4030_IRQ_BASE + 4) */ | 301 | /* #define TWL4030_MODIRQ_USB (TWL4030_IRQ_BASE + 4) */ |
294 | #define TWL4030_MODIRQ_PWR (TWL4030_IRQ_BASE + 5) | 302 | /* #define TWL4030_MODIRQ_PWR (TWL4030_IRQ_BASE + 5) */ |
295 | 303 | ||
296 | #define TWL4030_PWRIRQ_PWRBTN (TWL4030_PWR_IRQ_BASE + 0) | 304 | #define TWL4030_PWRIRQ_PWRBTN (TWL4030_PWR_IRQ_BASE + 0) |
297 | #define TWL4030_PWRIRQ_CHG_PRES (TWL4030_PWR_IRQ_BASE + 1) | 305 | /* #define TWL4030_PWRIRQ_CHG_PRES (TWL4030_PWR_IRQ_BASE + 1) */ |
298 | #define TWL4030_PWRIRQ_USB_PRES (TWL4030_PWR_IRQ_BASE + 2) | 306 | /* #define TWL4030_PWRIRQ_USB_PRES (TWL4030_PWR_IRQ_BASE + 2) */ |
299 | #define TWL4030_PWRIRQ_RTC (TWL4030_PWR_IRQ_BASE + 3) | 307 | /* #define TWL4030_PWRIRQ_RTC (TWL4030_PWR_IRQ_BASE + 3) */ |
300 | #define TWL4030_PWRIRQ_HOT_DIE (TWL4030_PWR_IRQ_BASE + 4) | 308 | /* #define TWL4030_PWRIRQ_HOT_DIE (TWL4030_PWR_IRQ_BASE + 4) */ |
301 | #define TWL4030_PWRIRQ_PWROK_TIMEOUT (TWL4030_PWR_IRQ_BASE + 5) | 309 | /* #define TWL4030_PWRIRQ_PWROK_TIMEOUT (TWL4030_PWR_IRQ_BASE + 5) */ |
302 | #define TWL4030_PWRIRQ_MBCHG (TWL4030_PWR_IRQ_BASE + 6) | 310 | /* #define TWL4030_PWRIRQ_MBCHG (TWL4030_PWR_IRQ_BASE + 6) */ |
303 | #define TWL4030_PWRIRQ_SC_DETECT (TWL4030_PWR_IRQ_BASE + 7) | 311 | /* #define TWL4030_PWRIRQ_SC_DETECT (TWL4030_PWR_IRQ_BASE + 7) */ |
304 | 312 | ||
305 | /* Rest are unsued currently*/ | 313 | /* Rest are unsued currently*/ |
306 | 314 | ||
@@ -317,17 +325,13 @@ struct twl4030_platform_data { | |||
317 | /* TWL4030 GPIO interrupt definitions */ | 325 | /* TWL4030 GPIO interrupt definitions */ |
318 | 326 | ||
319 | #define TWL4030_GPIO_IRQ_NO(n) (TWL4030_GPIO_IRQ_BASE + (n)) | 327 | #define TWL4030_GPIO_IRQ_NO(n) (TWL4030_GPIO_IRQ_BASE + (n)) |
320 | #define TWL4030_GPIO_IS_ENABLE 1 | ||
321 | 328 | ||
322 | /* | 329 | /* |
323 | * Exported TWL4030 GPIO APIs | 330 | * Exported TWL4030 GPIO APIs |
324 | * | 331 | * |
325 | * WARNING -- use standard GPIO and IRQ calls instead; these will vanish. | 332 | * WARNING -- use standard GPIO and IRQ calls instead; these will vanish. |
326 | */ | 333 | */ |
327 | int twl4030_get_gpio_datain(int gpio); | ||
328 | int twl4030_request_gpio(int gpio); | ||
329 | int twl4030_set_gpio_debounce(int gpio, int enable); | 334 | int twl4030_set_gpio_debounce(int gpio, int enable); |
330 | int twl4030_free_gpio(int gpio); | ||
331 | 335 | ||
332 | #if defined(CONFIG_TWL4030_BCI_BATTERY) || \ | 336 | #if defined(CONFIG_TWL4030_BCI_BATTERY) || \ |
333 | defined(CONFIG_TWL4030_BCI_BATTERY_MODULE) | 337 | defined(CONFIG_TWL4030_BCI_BATTERY_MODULE) |