提交 c66dc529 编写于 作者: S Sebastian Andrzej Siewior 提交者: Ben Dooks

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: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: NDirk Brandewie <dirk.brandewie@gmail.com>
Signed-off-by: NBen Dooks <ben-linux@fluff.org>
上级 7e94dd15
...@@ -956,11 +956,17 @@ static void i2c_pxa_irq_rxfull(struct pxa_i2c *i2c, u32 isr) ...@@ -956,11 +956,17 @@ static void i2c_pxa_irq_rxfull(struct pxa_i2c *i2c, u32 isr)
writel(icr, _ICR(i2c)); writel(icr, _ICR(i2c));
} }
#define VALID_INT_SOURCE (ISR_SSD | ISR_ALD | ISR_ITE | ISR_IRF | \
ISR_SAD | ISR_BED)
static irqreturn_t i2c_pxa_handler(int this_irq, void *dev_id) static irqreturn_t i2c_pxa_handler(int this_irq, void *dev_id)
{ {
struct pxa_i2c *i2c = dev_id; struct pxa_i2c *i2c = dev_id;
u32 isr = readl(_ISR(i2c)); u32 isr = readl(_ISR(i2c));
isr &= VALID_INT_SOURCE;
if (!isr)
return IRQ_NONE;
if (i2c_debug > 2 && 0) { if (i2c_debug > 2 && 0) {
dev_dbg(&i2c->adap.dev, "%s: ISR=%08x, ICR=%08x, IBMR=%02x\n", dev_dbg(&i2c->adap.dev, "%s: ISR=%08x, ICR=%08x, IBMR=%02x\n",
__func__, isr, readl(_ICR(i2c)), readl(_IBMR(i2c))); __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,7 +981,7 @@ static irqreturn_t i2c_pxa_handler(int this_irq, void *dev_id)
/* /*
* Always clear all pending IRQs. * Always clear all pending IRQs.
*/ */
writel(isr & (ISR_SSD|ISR_ALD|ISR_ITE|ISR_IRF|ISR_SAD|ISR_BED), _ISR(i2c)); writel(isr, _ISR(i2c));
if (isr & ISR_SAD) if (isr & ISR_SAD)
i2c_pxa_slave_start(i2c, isr); i2c_pxa_slave_start(i2c, isr);
...@@ -1120,7 +1126,7 @@ static int i2c_pxa_probe(struct platform_device *dev) ...@@ -1120,7 +1126,7 @@ static int i2c_pxa_probe(struct platform_device *dev)
i2c->adap.algo = &i2c_pxa_pio_algorithm; i2c->adap.algo = &i2c_pxa_pio_algorithm;
} else { } else {
i2c->adap.algo = &i2c_pxa_algorithm; i2c->adap.algo = &i2c_pxa_algorithm;
ret = request_irq(irq, i2c_pxa_handler, IRQF_DISABLED, ret = request_irq(irq, i2c_pxa_handler, IRQF_SHARED,
i2c->adap.name, i2c); i2c->adap.name, i2c);
if (ret) if (ret)
goto ereqirq; goto ereqirq;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册