summaryrefslogtreecommitdiff
path: root/drivers/ata
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@st.com>2011-03-04 14:09:29 +0300
committerJeff Garzik <jgarzik@pobox.com>2011-03-14 09:58:03 +0300
commit60a230e4a62be6837335911b09101bd8aeb7c95a (patch)
tree81eaf5ffaef68320dbbdd62bec7142f603609420 /drivers/ata
parent8d7b1c70b3c1aac4b63109f5c73f732f1d63fad6 (diff)
downloadlinux-60a230e4a62be6837335911b09101bd8aeb7c95a.tar.xz
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.c7
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 {
struct dma_chan *dma_chan;
/* Mask for DMA transfers */
dma_cap_mask_t mask;
+ /* dma channel private data */
+ void *dma_priv;
/* DMA transfer work */
struct work_struct work;
/* DMA delayed finish work */
@@ -356,6 +358,7 @@ static void dma_callback(void *dev)
static bool filter(struct dma_chan *chan, void *slave)
{
+ chan->private = slave;
return true;
}
@@ -526,7 +529,8 @@ static void data_xfer(struct work_struct *work)
/* request dma channels */
/* dma_request_channel may sleep, so calling from process context */
- acdev->dma_chan = dma_request_channel(acdev->mask, filter, NULL);
+ acdev->dma_chan = dma_request_channel(acdev->mask, filter,
+ acdev->dma_priv);
if (!acdev->dma_chan) {
dev_err(acdev->host->dev, "Unable to get dma_chan\n");
goto chan_request_fail;
@@ -853,6 +857,7 @@ static int __devinit arasan_cf_probe(struct platform_device *pdev)
INIT_WORK(&acdev->work, data_xfer);
INIT_DELAYED_WORK(&acdev->dwork, delayed_finish);
dma_cap_set(DMA_MEMCPY, acdev->mask);
+ acdev->dma_priv = pdata->dma_priv;
/* Handle platform specific quirks */
if (pdata->quirk) {