summaryrefslogtreecommitdiff
path: root/drivers/spi/pxa2xx_spi.c
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2010-11-23 04:12:14 +0300
committerSebastian Andrzej Siewior <bigeasy@linutronix.de>2010-12-01 14:18:31 +0300
commit49cbb1e0b6dcba9170e72fdf40c75fc24cadba4b (patch)
treead2b14d580fd4101b39b55761a6de5178a7c5d0a /drivers/spi/pxa2xx_spi.c
parentfbd29a14af42d374ddce9c16ff5f7805e69c764f (diff)
downloadlinux-49cbb1e0b6dcba9170e72fdf40c75fc24cadba4b.tar.xz
spi/pxa2xx: add support for shared IRQ handler
This is required in case the interrupt line is shared with other devices. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
Diffstat (limited to 'drivers/spi/pxa2xx_spi.c')
-rw-r--r--drivers/spi/pxa2xx_spi.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/spi/pxa2xx_spi.c b/drivers/spi/pxa2xx_spi.c
index 4e169b579efb..1865c23f2175 100644
--- a/drivers/spi/pxa2xx_spi.c
+++ b/drivers/spi/pxa2xx_spi.c
@@ -742,6 +742,18 @@ static irqreturn_t ssp_int(int irq, void *dev_id)
{
struct driver_data *drv_data = dev_id;
void __iomem *reg = drv_data->ioaddr;
+ u32 sccr1_reg = read_SSCR1(reg);
+ u32 mask = drv_data->mask_sr;
+ u32 status;
+
+ status = read_SSSR(reg);
+
+ /* Ignore possible writes if we don't need to write */
+ if (!(sccr1_reg & SSCR1_TIE))
+ mask &= ~SSSR_TFS;
+
+ if (!(status & mask))
+ return IRQ_NONE;
if (!drv_data->cur_msg) {
@@ -1512,7 +1524,8 @@ static int __devinit pxa2xx_spi_probe(struct platform_device *pdev)
drv_data->mask_sr = SSSR_TINT | SSSR_RFS | SSSR_TFS | SSSR_ROR;
}
- status = request_irq(ssp->irq, ssp_int, 0, dev_name(dev), drv_data);
+ status = request_irq(ssp->irq, ssp_int, IRQF_SHARED, dev_name(dev),
+ drv_data);
if (status < 0) {
dev_err(&pdev->dev, "cannot get IRQ %d\n", ssp->irq);
goto out_error_master_alloc;