]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commit
twl4030-pwrirq simplification, cleanup
authorDavid Brownell <david-b@pacbell.net>
Wed, 8 Oct 2008 14:22:30 +0000 (17:22 +0300)
committerTony Lindgren <tony@atomide.com>
Fri, 10 Oct 2008 11:55:42 +0000 (14:55 +0300)
commit62c21db8dbcb8179cd28466609d6efa5e0eeadbf
treed50b12c85f753418f425820cd8203a82fb337a46
parentd0558a7c788a2441f227a1b7062cbca6063287a2
twl4030-pwrirq simplification, cleanup

I can't test the pwrbutton stuff, but rtc and musb behave...

With one issue:  the usb transceiver glue misbehaves on
startup if the device is connected.  (Again.)  I looked at
this a bit, and I think the issue is probably caused by
not actually using key USB registers ... IRQ trigger
mode state transitions are at best a fragile proxy for the
real state.

(This is similar to the GPIO patch I just sent, but simpler
except for the impact on the few drivers thinking oddly
about IRQs.  Those patches cover the key SIH modules, and
a similar one affects the PIH in twl4030-core.)

- Dave

================================
Streamline the "power irq" code, and some of the mechanisms
it uses:

 - Support IRQ masking, not just unmasking; simpler code.
 - Use the standard handle_edge_irq() handler for these edge IRQs.
 - Use generic_handle_irq() instead of a manual expansion thereof.
 - Provide a missing spinlock for the shared data.

In short, use more of the standard genirq code ... more correctly.

Also, update the drivers using the "power IRQ" accordingly:

 - Don't request IRQF_DISABLED if the handler makes I2C calls;
   and defend against lockdep forcing it on us.

 - Let the irq_chip handle IRQ mask/unmask; it handles mutual
   exclusion between drivers, among other things.

 - (Unrelated) remove useless MODULE_ALIAS in pwrbutton.

The USB transceiver driver still places some dodgey games with IRQ
enable/disable, and IRQ trigger flags.  At least some of them seem
like they'd be simplified by using USB transceiver registers ...
notably, startup code, which doesn't seem to check state before
it enters an irq-driven mode.

For the moment, these drivers still (wrongly) try to configure IRQ
trigger modes themselves ... again, that's something that an irq_chip
handles (but not yet, for this one).

NOTE:  tested (MUSB and RTC only) along with the init/retry hack
to make twl4030-pwrirq work around the i2c-omap timeout problems.
drivers/i2c/chips/twl4030-pwrbutton.c
drivers/i2c/chips/twl4030-pwrirq.c
drivers/i2c/chips/twl4030-usb.c
drivers/rtc/rtc-twl4030.c