aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>2017-05-15 19:09:15 -0400
committerVinod Koul <vinod.koul@intel.com>2017-05-19 05:25:23 -0400
commit427d5ecd270bad5b9ba15a42f0414accdfa4e2f8 (patch)
tree7b0119da1b4eb9853925202f7216fadc6c307e9c
parent2ea659a9ef488125eb46da6eb571de5eae5c43f6 (diff)
dmaengine: rcar-dmac: store channel IRQ in struct rcar_dmac_chan
The IRQ number is needed after probe to be able to add synchronisation points in other places in the driver when freeing resources and to implement a device_synchronize() callback. Store the IRQ number in the struct rcar_dmac_chan so that it can be used later. Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
-rw-r--r--drivers/dma/sh/rcar-dmac.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c
index db41795fe42a..c68c3336bdad 100644
--- a/drivers/dma/sh/rcar-dmac.c
+++ b/drivers/dma/sh/rcar-dmac.c
@@ -144,6 +144,7 @@ struct rcar_dmac_chan_map {
144 * @chan: base DMA channel object 144 * @chan: base DMA channel object
145 * @iomem: channel I/O memory base 145 * @iomem: channel I/O memory base
146 * @index: index of this channel in the controller 146 * @index: index of this channel in the controller
147 * @irq: channel IRQ
147 * @src: slave memory address and size on the source side 148 * @src: slave memory address and size on the source side
148 * @dst: slave memory address and size on the destination side 149 * @dst: slave memory address and size on the destination side
149 * @mid_rid: hardware MID/RID for the DMA client using this channel 150 * @mid_rid: hardware MID/RID for the DMA client using this channel
@@ -161,6 +162,7 @@ struct rcar_dmac_chan {
161 struct dma_chan chan; 162 struct dma_chan chan;
162 void __iomem *iomem; 163 void __iomem *iomem;
163 unsigned int index; 164 unsigned int index;
165 int irq;
164 166
165 struct rcar_dmac_chan_slave src; 167 struct rcar_dmac_chan_slave src;
166 struct rcar_dmac_chan_slave dst; 168 struct rcar_dmac_chan_slave dst;
@@ -1647,7 +1649,6 @@ static int rcar_dmac_chan_probe(struct rcar_dmac *dmac,
1647 struct dma_chan *chan = &rchan->chan; 1649 struct dma_chan *chan = &rchan->chan;
1648 char pdev_irqname[5]; 1650 char pdev_irqname[5];
1649 char *irqname; 1651 char *irqname;
1650 int irq;
1651 int ret; 1652 int ret;
1652 1653
1653 rchan->index = index; 1654 rchan->index = index;
@@ -1664,8 +1665,8 @@ static int rcar_dmac_chan_probe(struct rcar_dmac *dmac,
1664 1665
1665 /* Request the channel interrupt. */ 1666 /* Request the channel interrupt. */
1666 sprintf(pdev_irqname, "ch%u", index); 1667 sprintf(pdev_irqname, "ch%u", index);
1667 irq = platform_get_irq_byname(pdev, pdev_irqname); 1668 rchan->irq = platform_get_irq_byname(pdev, pdev_irqname);
1668 if (irq < 0) { 1669 if (rchan->irq < 0) {
1669 dev_err(dmac->dev, "no IRQ specified for channel %u\n", index); 1670 dev_err(dmac->dev, "no IRQ specified for channel %u\n", index);
1670 return -ENODEV; 1671 return -ENODEV;
1671 } 1672 }
@@ -1675,11 +1676,13 @@ static int rcar_dmac_chan_probe(struct rcar_dmac *dmac,
1675 if (!irqname) 1676 if (!irqname)
1676 return -ENOMEM; 1677 return -ENOMEM;
1677 1678
1678 ret = devm_request_threaded_irq(dmac->dev, irq, rcar_dmac_isr_channel, 1679 ret = devm_request_threaded_irq(dmac->dev, rchan->irq,
1680 rcar_dmac_isr_channel,
1679 rcar_dmac_isr_channel_thread, 0, 1681 rcar_dmac_isr_channel_thread, 0,
1680 irqname, rchan); 1682 irqname, rchan);
1681 if (ret) { 1683 if (ret) {
1682 dev_err(dmac->dev, "failed to request IRQ %u (%d)\n", irq, ret); 1684 dev_err(dmac->dev, "failed to request IRQ %u (%d)\n",
1685 rchan->irq, ret);
1683 return ret; 1686 return ret;
1684 } 1687 }
1685 1688