diff options
author | Viresh Kumar <viresh.kumar@st.com> | 2011-03-04 06:09:29 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2011-03-14 02:58:03 -0400 |
commit | 60a230e4a62be6837335911b09101bd8aeb7c95a (patch) | |
tree | 81eaf5ffaef68320dbbdd62bec7142f603609420 /drivers/ata | |
parent | 8d7b1c70b3c1aac4b63109f5c73f732f1d63fad6 (diff) |
ata/pata_arasan_cf: fill dma chan->private from pdata->dma_priv
Some DMA controllers (eg: drivers/dma/dw_dmac*) allow platform specific
configuration for dma transfers. User drivers need to set chan->private field
of channel with pointer to configuration data. This patch takes dma_priv data
from platform data and passes it to chan->private_data, in order to pass
platform specific configuration to DMAC controller.
Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/ata')
-rw-r--r-- | drivers/ata/pata_arasan_cf.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/ata/pata_arasan_cf.c b/drivers/ata/pata_arasan_cf.c index 8b060c44bbe1..65cee74605b4 100644 --- a/drivers/ata/pata_arasan_cf.c +++ b/drivers/ata/pata_arasan_cf.c | |||
@@ -210,6 +210,8 @@ struct arasan_cf_dev { | |||
210 | struct dma_chan *dma_chan; | 210 | struct dma_chan *dma_chan; |
211 | /* Mask for DMA transfers */ | 211 | /* Mask for DMA transfers */ |
212 | dma_cap_mask_t mask; | 212 | dma_cap_mask_t mask; |
213 | /* dma channel private data */ | ||
214 | void *dma_priv; | ||
213 | /* DMA transfer work */ | 215 | /* DMA transfer work */ |
214 | struct work_struct work; | 216 | struct work_struct work; |
215 | /* DMA delayed finish work */ | 217 | /* DMA delayed finish work */ |
@@ -356,6 +358,7 @@ static void dma_callback(void *dev) | |||
356 | 358 | ||
357 | static bool filter(struct dma_chan *chan, void *slave) | 359 | static bool filter(struct dma_chan *chan, void *slave) |
358 | { | 360 | { |
361 | chan->private = slave; | ||
359 | return true; | 362 | return true; |
360 | } | 363 | } |
361 | 364 | ||
@@ -526,7 +529,8 @@ static void data_xfer(struct work_struct *work) | |||
526 | 529 | ||
527 | /* request dma channels */ | 530 | /* request dma channels */ |
528 | /* dma_request_channel may sleep, so calling from process context */ | 531 | /* dma_request_channel may sleep, so calling from process context */ |
529 | acdev->dma_chan = dma_request_channel(acdev->mask, filter, NULL); | 532 | acdev->dma_chan = dma_request_channel(acdev->mask, filter, |
533 | acdev->dma_priv); | ||
530 | if (!acdev->dma_chan) { | 534 | if (!acdev->dma_chan) { |
531 | dev_err(acdev->host->dev, "Unable to get dma_chan\n"); | 535 | dev_err(acdev->host->dev, "Unable to get dma_chan\n"); |
532 | goto chan_request_fail; | 536 | goto chan_request_fail; |
@@ -853,6 +857,7 @@ static int __devinit arasan_cf_probe(struct platform_device *pdev) | |||
853 | INIT_WORK(&acdev->work, data_xfer); | 857 | INIT_WORK(&acdev->work, data_xfer); |
854 | INIT_DELAYED_WORK(&acdev->dwork, delayed_finish); | 858 | INIT_DELAYED_WORK(&acdev->dwork, delayed_finish); |
855 | dma_cap_set(DMA_MEMCPY, acdev->mask); | 859 | dma_cap_set(DMA_MEMCPY, acdev->mask); |
860 | acdev->dma_priv = pdata->dma_priv; | ||
856 | 861 | ||
857 | /* Handle platform specific quirks */ | 862 | /* Handle platform specific quirks */ |
858 | if (pdata->quirk) { | 863 | if (pdata->quirk) { |