提交 427d5ecd 编写于 作者: N Niklas Söderlund 提交者: Vinod Koul

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: NNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: NVinod Koul <vinod.koul@intel.com>
上级 2ea659a9
...@@ -144,6 +144,7 @@ struct rcar_dmac_chan_map { ...@@ -144,6 +144,7 @@ struct rcar_dmac_chan_map {
* @chan: base DMA channel object * @chan: base DMA channel object
* @iomem: channel I/O memory base * @iomem: channel I/O memory base
* @index: index of this channel in the controller * @index: index of this channel in the controller
* @irq: channel IRQ
* @src: slave memory address and size on the source side * @src: slave memory address and size on the source side
* @dst: slave memory address and size on the destination side * @dst: slave memory address and size on the destination side
* @mid_rid: hardware MID/RID for the DMA client using this channel * @mid_rid: hardware MID/RID for the DMA client using this channel
...@@ -161,6 +162,7 @@ struct rcar_dmac_chan { ...@@ -161,6 +162,7 @@ struct rcar_dmac_chan {
struct dma_chan chan; struct dma_chan chan;
void __iomem *iomem; void __iomem *iomem;
unsigned int index; unsigned int index;
int irq;
struct rcar_dmac_chan_slave src; struct rcar_dmac_chan_slave src;
struct rcar_dmac_chan_slave dst; struct rcar_dmac_chan_slave dst;
...@@ -1647,7 +1649,6 @@ static int rcar_dmac_chan_probe(struct rcar_dmac *dmac, ...@@ -1647,7 +1649,6 @@ static int rcar_dmac_chan_probe(struct rcar_dmac *dmac,
struct dma_chan *chan = &rchan->chan; struct dma_chan *chan = &rchan->chan;
char pdev_irqname[5]; char pdev_irqname[5];
char *irqname; char *irqname;
int irq;
int ret; int ret;
rchan->index = index; rchan->index = index;
...@@ -1664,8 +1665,8 @@ static int rcar_dmac_chan_probe(struct rcar_dmac *dmac, ...@@ -1664,8 +1665,8 @@ static int rcar_dmac_chan_probe(struct rcar_dmac *dmac,
/* Request the channel interrupt. */ /* Request the channel interrupt. */
sprintf(pdev_irqname, "ch%u", index); sprintf(pdev_irqname, "ch%u", index);
irq = platform_get_irq_byname(pdev, pdev_irqname); rchan->irq = platform_get_irq_byname(pdev, pdev_irqname);
if (irq < 0) { if (rchan->irq < 0) {
dev_err(dmac->dev, "no IRQ specified for channel %u\n", index); dev_err(dmac->dev, "no IRQ specified for channel %u\n", index);
return -ENODEV; return -ENODEV;
} }
...@@ -1675,11 +1676,13 @@ static int rcar_dmac_chan_probe(struct rcar_dmac *dmac, ...@@ -1675,11 +1676,13 @@ static int rcar_dmac_chan_probe(struct rcar_dmac *dmac,
if (!irqname) if (!irqname)
return -ENOMEM; return -ENOMEM;
ret = devm_request_threaded_irq(dmac->dev, irq, rcar_dmac_isr_channel, ret = devm_request_threaded_irq(dmac->dev, rchan->irq,
rcar_dmac_isr_channel,
rcar_dmac_isr_channel_thread, 0, rcar_dmac_isr_channel_thread, 0,
irqname, rchan); irqname, rchan);
if (ret) { if (ret) {
dev_err(dmac->dev, "failed to request IRQ %u (%d)\n", irq, ret); dev_err(dmac->dev, "failed to request IRQ %u (%d)\n",
rchan->irq, ret);
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册