diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2011-02-23 06:38:18 -0500 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2011-03-21 05:23:52 -0400 |
commit | c66dc529194be374556d166ee7ddb84a7d1d302b (patch) | |
tree | 7ced04809474bae16d0ad4b7a76b60293397be40 /drivers/i2c/busses/i2c-pxa.c | |
parent | 7e94dd154e934aa2137c427c3b1c8e9a6e465fcd (diff) |
i2c-pxa2xx: add support for shared IRQ handler
Sodaville has three of them on a single IRQ. IRQF_DISABLED is removed
because it is a NOP allready and scheduled for removal.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'drivers/i2c/busses/i2c-pxa.c')
-rw-r--r-- | drivers/i2c/busses/i2c-pxa.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c index ab59b7e492ed..fa8dd2c634d9 100644 --- a/drivers/i2c/busses/i2c-pxa.c +++ b/drivers/i2c/busses/i2c-pxa.c | |||
@@ -956,11 +956,17 @@ static void i2c_pxa_irq_rxfull(struct pxa_i2c *i2c, u32 isr) | |||
956 | writel(icr, _ICR(i2c)); | 956 | writel(icr, _ICR(i2c)); |
957 | } | 957 | } |
958 | 958 | ||
959 | #define VALID_INT_SOURCE (ISR_SSD | ISR_ALD | ISR_ITE | ISR_IRF | \ | ||
960 | ISR_SAD | ISR_BED) | ||
959 | static irqreturn_t i2c_pxa_handler(int this_irq, void *dev_id) | 961 | static irqreturn_t i2c_pxa_handler(int this_irq, void *dev_id) |
960 | { | 962 | { |
961 | struct pxa_i2c *i2c = dev_id; | 963 | struct pxa_i2c *i2c = dev_id; |
962 | u32 isr = readl(_ISR(i2c)); | 964 | u32 isr = readl(_ISR(i2c)); |
963 | 965 | ||
966 | isr &= VALID_INT_SOURCE; | ||
967 | if (!isr) | ||
968 | return IRQ_NONE; | ||
969 | |||
964 | if (i2c_debug > 2 && 0) { | 970 | if (i2c_debug > 2 && 0) { |
965 | dev_dbg(&i2c->adap.dev, "%s: ISR=%08x, ICR=%08x, IBMR=%02x\n", | 971 | dev_dbg(&i2c->adap.dev, "%s: ISR=%08x, ICR=%08x, IBMR=%02x\n", |
966 | __func__, isr, readl(_ICR(i2c)), readl(_IBMR(i2c))); | 972 | __func__, isr, readl(_ICR(i2c)), readl(_IBMR(i2c))); |
@@ -975,7 +981,7 @@ static irqreturn_t i2c_pxa_handler(int this_irq, void *dev_id) | |||
975 | /* | 981 | /* |
976 | * Always clear all pending IRQs. | 982 | * Always clear all pending IRQs. |
977 | */ | 983 | */ |
978 | writel(isr & (ISR_SSD|ISR_ALD|ISR_ITE|ISR_IRF|ISR_SAD|ISR_BED), _ISR(i2c)); | 984 | writel(isr, _ISR(i2c)); |
979 | 985 | ||
980 | if (isr & ISR_SAD) | 986 | if (isr & ISR_SAD) |
981 | i2c_pxa_slave_start(i2c, isr); | 987 | i2c_pxa_slave_start(i2c, isr); |
@@ -1120,7 +1126,7 @@ static int i2c_pxa_probe(struct platform_device *dev) | |||
1120 | i2c->adap.algo = &i2c_pxa_pio_algorithm; | 1126 | i2c->adap.algo = &i2c_pxa_pio_algorithm; |
1121 | } else { | 1127 | } else { |
1122 | i2c->adap.algo = &i2c_pxa_algorithm; | 1128 | i2c->adap.algo = &i2c_pxa_algorithm; |
1123 | ret = request_irq(irq, i2c_pxa_handler, IRQF_DISABLED, | 1129 | ret = request_irq(irq, i2c_pxa_handler, IRQF_SHARED, |
1124 | i2c->adap.name, i2c); | 1130 | i2c->adap.name, i2c); |
1125 | if (ret) | 1131 | if (ret) |
1126 | goto ereqirq; | 1132 | goto ereqirq; |