aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/pxa2xx_spi.c
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2010-11-22 20:12:14 -0500
committerSebastian Andrzej Siewior <bigeasy@linutronix.de>2010-12-01 06:18:31 -0500
commit49cbb1e0b6dcba9170e72fdf40c75fc24cadba4b (patch)
treead2b14d580fd4101b39b55761a6de5178a7c5d0a /drivers/spi/pxa2xx_spi.c
parentfbd29a14af42d374ddce9c16ff5f7805e69c764f (diff)
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)
742{ 742{
743 struct driver_data *drv_data = dev_id; 743 struct driver_data *drv_data = dev_id;
744 void __iomem *reg = drv_data->ioaddr; 744 void __iomem *reg = drv_data->ioaddr;
745 u32 sccr1_reg = read_SSCR1(reg);
746 u32 mask = drv_data->mask_sr;
747 u32 status;
748
749 status = read_SSSR(reg);
750
751 /* Ignore possible writes if we don't need to write */
752 if (!(sccr1_reg & SSCR1_TIE))
753 mask &= ~SSSR_TFS;
754
755 if (!(status & mask))
756 return IRQ_NONE;
745 757
746 if (!drv_data->cur_msg) { 758 if (!drv_data->cur_msg) {
747 759
@@ -1512,7 +1524,8 @@ static int __devinit pxa2xx_spi_probe(struct platform_device *pdev)
1512 drv_data->mask_sr = SSSR_TINT | SSSR_RFS | SSSR_TFS | SSSR_ROR; 1524 drv_data->mask_sr = SSSR_TINT | SSSR_RFS | SSSR_TFS | SSSR_ROR;
1513 } 1525 }
1514 1526
1515 status = request_irq(ssp->irq, ssp_int, 0, dev_name(dev), drv_data); 1527 status = request_irq(ssp->irq, ssp_int, IRQF_SHARED, dev_name(dev),
1528 drv_data);
1516 if (status < 0) { 1529 if (status < 0) {
1517 dev_err(&pdev->dev, "cannot get IRQ %d\n", ssp->irq); 1530 dev_err(&pdev->dev, "cannot get IRQ %d\n", ssp->irq);
1518 goto out_error_master_alloc; 1531 goto out_error_master_alloc;