Commit baae8496 authored by David Brownell's avatar David Brownell Committed by Tony Lindgren

twl4030 "subdriver" irq tweaks

Bugfixes to TWL subdriver irq handler setup ... lockdep
workarounds, remove IRQF_DISABLED.  NOPs with current code.

These changes are specific to the drivers which register
directly with the PIH irq_chip (in twl4030-core), and are
prerequsites to a cleanup patch for that PIH infrastructure.
(Unless you don't use these drivers.)
Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 85c0074e
...@@ -148,6 +148,14 @@ static irqreturn_t twl4030_madc_irq_handler(int irq, void *_madc) ...@@ -148,6 +148,14 @@ static irqreturn_t twl4030_madc_irq_handler(int irq, void *_madc)
u8 isr_val, imr_val; u8 isr_val, imr_val;
int i; int i;
#ifdef CONFIG_LOCKDEP
/* WORKAROUND for lockdep forcing IRQF_DISABLED on us, which
* we don't want and can't tolerate. Although it might be
* friendlier not to borrow this thread context...
*/
local_irq_enable();
#endif
/* Use COR to ack interrupts since we have no shared IRQs in ISRx */ /* Use COR to ack interrupts since we have no shared IRQs in ISRx */
isr_val = twl4030_madc_read(madc, madc->isr); isr_val = twl4030_madc_read(madc, madc->isr);
imr_val = twl4030_madc_read(madc, madc->imr); imr_val = twl4030_madc_read(madc, madc->imr);
...@@ -451,7 +459,7 @@ static int __init twl4030_madc_probe(struct platform_device *pdev) ...@@ -451,7 +459,7 @@ static int __init twl4030_madc_probe(struct platform_device *pdev)
regval, TWL4030_BCI_BCICTL1); regval, TWL4030_BCI_BCICTL1);
ret = request_irq(TWL4030_MODIRQ_MADC, twl4030_madc_irq_handler, ret = request_irq(TWL4030_MODIRQ_MADC, twl4030_madc_irq_handler,
IRQF_DISABLED, "twl4030_madc", madc); 0, "twl4030_madc", madc);
if (ret) { if (ret) {
dev_dbg(&pdev->dev, "could not request irq\n"); dev_dbg(&pdev->dev, "could not request irq\n");
goto err_irq; goto err_irq;
......
...@@ -208,6 +208,14 @@ static irqreturn_t do_kp_irq(int irq, void *_kp) ...@@ -208,6 +208,14 @@ static irqreturn_t do_kp_irq(int irq, void *_kp)
u8 reg; u8 reg;
int ret; int ret;
#ifdef CONFIG_LOCKDEP
/* WORKAROUND for lockdep forcing IRQF_DISABLED on us, which
* we don't want and can't tolerate. Although it might be
* friendlier not to borrow this thread context...
*/
local_irq_enable();
#endif
/* Read & Clear TWL4030 pending interrupt */ /* Read & Clear TWL4030 pending interrupt */
ret = twl4030_kpread(kp, TWL4030_MODULE_KEYPAD, &reg, KEYP_ISR1, 1); ret = twl4030_kpread(kp, TWL4030_MODULE_KEYPAD, &reg, KEYP_ISR1, 1);
...@@ -340,8 +348,7 @@ static int __init omap_kp_probe(struct platform_device *pdev) ...@@ -340,8 +348,7 @@ static int __init omap_kp_probe(struct platform_device *pdev)
* This ISR will always execute in kernel thread context because of * This ISR will always execute in kernel thread context because of
* the need to access the TWL4030 over the I2C bus. * the need to access the TWL4030 over the I2C bus.
*/ */
ret = request_irq(kp->irq, do_kp_irq, IRQF_DISABLED, ret = request_irq(kp->irq, do_kp_irq, 0, pdev->name, kp);
"TWL4030 Keypad", kp);
if (ret < 0) { if (ret < 0) {
dev_info(kp->dbg_dev, "request_irq failed for irq no=%d\n", dev_info(kp->dbg_dev, "request_irq failed for irq no=%d\n",
kp->irq); kp->irq);
......
...@@ -210,6 +210,14 @@ static irqreturn_t twl4030charger_interrupt(int irq, void *_di) ...@@ -210,6 +210,14 @@ static irqreturn_t twl4030charger_interrupt(int irq, void *_di)
{ {
struct twl4030_bci_device_info *di = _di; struct twl4030_bci_device_info *di = _di;
#ifdef CONFIG_LOCKDEP
/* WORKAROUND for lockdep forcing IRQF_DISABLED on us, which
* we don't want and can't tolerate. Although it might be
* friendlier not to borrow this thread context...
*/
local_irq_enable();
#endif
twl4030charger_presence_evt(); twl4030charger_presence_evt();
power_supply_changed(&di->bat); power_supply_changed(&di->bat);
...@@ -310,6 +318,14 @@ static irqreturn_t twl4030battery_interrupt(int irq, void *_di) ...@@ -310,6 +318,14 @@ static irqreturn_t twl4030battery_interrupt(int irq, void *_di)
u8 isr1a_val, isr2a_val, clear_2a, clear_1a; u8 isr1a_val, isr2a_val, clear_2a, clear_1a;
int ret; int ret;
#ifdef CONFIG_LOCKDEP
/* WORKAROUND for lockdep forcing IRQF_DISABLED on us, which
* we don't want and can't tolerate. Although it might be
* friendlier not to borrow this thread context...
*/
local_irq_enable();
#endif
ret = twl4030_i2c_read_u8(TWL4030_MODULE_INTERRUPTS, &isr1a_val, ret = twl4030_i2c_read_u8(TWL4030_MODULE_INTERRUPTS, &isr1a_val,
REG_BCIISR1A); REG_BCIISR1A);
if (ret) if (ret)
...@@ -943,7 +959,7 @@ static int __init twl4030_bci_battery_probe(struct platform_device *pdev) ...@@ -943,7 +959,7 @@ static int __init twl4030_bci_battery_probe(struct platform_device *pdev)
/* request BCI interruption */ /* request BCI interruption */
ret = request_irq(TWL4030_MODIRQ_BCI, twl4030battery_interrupt, ret = request_irq(TWL4030_MODIRQ_BCI, twl4030battery_interrupt,
IRQF_DISABLED, pdev->name, NULL); 0, pdev->name, NULL);
if (ret) { if (ret) {
dev_dbg(&pdev->dev, "could not request irq %d, status %d\n", dev_dbg(&pdev->dev, "could not request irq %d, status %d\n",
TWL4030_MODIRQ_BCI, ret); TWL4030_MODIRQ_BCI, ret);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment