All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ata/pata_arasan_cf: fill dma chan->private from pdata->dma_priv
@ 2011-03-04 11:09 Viresh Kumar
  2011-03-04 11:16 ` Tejun Heo
  2011-03-14  6:58 ` Jeff Garzik
  0 siblings, 2 replies; 3+ messages in thread
From: Viresh Kumar @ 2011-03-04 11:09 UTC (permalink / raw)
  To: tj, jgarzik, linux-ide
  Cc: shiraz.hashim, amit.goel, armando.visconti, viresh.linux,
	Viresh Kumar

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>
---
 drivers/ata/pata_arasan_cf.c        |    7 ++++++-
 include/linux/pata_arasan_cf_data.h |    2 ++
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/ata/pata_arasan_cf.c b/drivers/ata/pata_arasan_cf.c
index b99b3fc..d67bff7 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) {
diff --git a/include/linux/pata_arasan_cf_data.h b/include/linux/pata_arasan_cf_data.h
index d979fe6..a6ee9aa 100644
--- a/include/linux/pata_arasan_cf_data.h
+++ b/include/linux/pata_arasan_cf_data.h
@@ -37,6 +37,8 @@ struct arasan_cf_pdata {
 	#define CF_BROKEN_PIO			(1)
 	#define CF_BROKEN_MWDMA			(1 << 1)
 	#define CF_BROKEN_UDMA			(1 << 2)
+	/* This is platform specific data for the DMA controller */
+	void *dma_priv;
 };
 
 static inline void
-- 
1.7.2.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ata/pata_arasan_cf: fill dma chan->private from pdata->dma_priv
  2011-03-04 11:09 [PATCH] ata/pata_arasan_cf: fill dma chan->private from pdata->dma_priv Viresh Kumar
@ 2011-03-04 11:16 ` Tejun Heo
  2011-03-14  6:58 ` Jeff Garzik
  1 sibling, 0 replies; 3+ messages in thread
From: Tejun Heo @ 2011-03-04 11:16 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: jgarzik, linux-ide, shiraz.hashim, amit.goel, armando.visconti,
	viresh.linux

On Fri, Mar 04, 2011 at 04:39:29PM +0530, Viresh Kumar wrote:
> 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>

Acked-by: Tejun Heo <tj@kernel.org>

-- 
tejun

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ata/pata_arasan_cf: fill dma chan->private from pdata->dma_priv
  2011-03-04 11:09 [PATCH] ata/pata_arasan_cf: fill dma chan->private from pdata->dma_priv Viresh Kumar
  2011-03-04 11:16 ` Tejun Heo
@ 2011-03-14  6:58 ` Jeff Garzik
  1 sibling, 0 replies; 3+ messages in thread
From: Jeff Garzik @ 2011-03-14  6:58 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: tj, linux-ide, shiraz.hashim, amit.goel, armando.visconti,
	viresh.linux

On 03/04/2011 06:09 AM, Viresh Kumar wrote:
> 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>
> ---
>   drivers/ata/pata_arasan_cf.c        |    7 ++++++-
>   include/linux/pata_arasan_cf_data.h |    2 ++

applied



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-03-14  6:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-04 11:09 [PATCH] ata/pata_arasan_cf: fill dma chan->private from pdata->dma_priv Viresh Kumar
2011-03-04 11:16 ` Tejun Heo
2011-03-14  6:58 ` Jeff Garzik

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.