diff options
author | Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> | 2013-09-25 18:31:37 -0400 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2013-10-10 21:54:36 -0400 |
commit | 08d08bcdee30d3a28426bd60dfbdae44b36250bc (patch) | |
tree | bd2ab50c2c4deb05b5f5550051c46b6570b57649 /drivers/dma/sh | |
parent | cdeb5c033f0389c44e5b36cafd623bdf44bbe25c (diff) |
rcar-hpbdma: add parameter to set_slave() method
Commit 4981c4dc194efb18f0e9a02f1b43e926f2f0d2bb (DMA: shdma: switch DT mode to
use configuration data from a match table) added a new parameter to set_slave()
method but unfortunately got merged later than commit c4f6c41ba790bbbfcebb4c47a
(dma: add driver for R-Car HPB-DMAC), so that the HPB-DMAC driver retained the
old prototype which caused this warning:
drivers/dma/sh/rcar-hpbdma.c:485: warning: initialization from incompatible
pointer type
The newly added parameter is used to override DMA slave address from 'struct
hpb_dmae_slave_config', so we have to add the 'slave_addr' field to 'struct
hpb_dmae_chan', conditionally assign it in set_slave() method, and return in
slave_addr() method.
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Tested-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma/sh')
-rw-r--r-- | drivers/dma/sh/rcar-hpbdma.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/dma/sh/rcar-hpbdma.c b/drivers/dma/sh/rcar-hpbdma.c index b2f50d8bd755..ebad84591a6e 100644 --- a/drivers/dma/sh/rcar-hpbdma.c +++ b/drivers/dma/sh/rcar-hpbdma.c | |||
@@ -93,6 +93,7 @@ struct hpb_dmae_chan { | |||
93 | void __iomem *base; | 93 | void __iomem *base; |
94 | const struct hpb_dmae_slave_config *cfg; | 94 | const struct hpb_dmae_slave_config *cfg; |
95 | char dev_id[16]; /* unique name per DMAC of channel */ | 95 | char dev_id[16]; /* unique name per DMAC of channel */ |
96 | dma_addr_t slave_addr; | ||
96 | }; | 97 | }; |
97 | 98 | ||
98 | struct hpb_dmae_device { | 99 | struct hpb_dmae_device { |
@@ -445,7 +446,8 @@ hpb_dmae_alloc_chan_resources(struct hpb_dmae_chan *hpb_chan, | |||
445 | return 0; | 446 | return 0; |
446 | } | 447 | } |
447 | 448 | ||
448 | static int hpb_dmae_set_slave(struct shdma_chan *schan, int slave_id, bool try) | 449 | static int hpb_dmae_set_slave(struct shdma_chan *schan, int slave_id, |
450 | dma_addr_t slave_addr, bool try) | ||
449 | { | 451 | { |
450 | struct hpb_dmae_chan *chan = to_chan(schan); | 452 | struct hpb_dmae_chan *chan = to_chan(schan); |
451 | const struct hpb_dmae_slave_config *sc = | 453 | const struct hpb_dmae_slave_config *sc = |
@@ -456,6 +458,7 @@ static int hpb_dmae_set_slave(struct shdma_chan *schan, int slave_id, bool try) | |||
456 | if (try) | 458 | if (try) |
457 | return 0; | 459 | return 0; |
458 | chan->cfg = sc; | 460 | chan->cfg = sc; |
461 | chan->slave_addr = slave_addr ? : sc->addr; | ||
459 | return hpb_dmae_alloc_chan_resources(chan, sc); | 462 | return hpb_dmae_alloc_chan_resources(chan, sc); |
460 | } | 463 | } |
461 | 464 | ||
@@ -467,7 +470,7 @@ static dma_addr_t hpb_dmae_slave_addr(struct shdma_chan *schan) | |||
467 | { | 470 | { |
468 | struct hpb_dmae_chan *chan = to_chan(schan); | 471 | struct hpb_dmae_chan *chan = to_chan(schan); |
469 | 472 | ||
470 | return chan->cfg->addr; | 473 | return chan->slave_addr; |
471 | } | 474 | } |
472 | 475 | ||
473 | static struct shdma_desc *hpb_dmae_embedded_desc(void *buf, int i) | 476 | static struct shdma_desc *hpb_dmae_embedded_desc(void *buf, int i) |