linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dma: omap-dma: Implement device_slave_caps callback
@ 2014-03-07 13:36 Peter Ujfalusi
  2014-03-12 17:37 ` Tony Lindgren
  2014-03-29 13:36 ` Vinod Koul
  0 siblings, 2 replies; 5+ messages in thread
From: Peter Ujfalusi @ 2014-03-07 13:36 UTC (permalink / raw)
  To: vinod.koul, dan.j.williams
  Cc: dmaengine, linux-kernel, linux, linux-omap, tony

With the callback implemented omap-dma can provide information to client
drivers regarding to supported address widths, directions, residue
granularity, etc.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 drivers/dma/omap-dma.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c
index 64ceca2920b8..b19f04f4390b 100644
--- a/drivers/dma/omap-dma.c
+++ b/drivers/dma/omap-dma.c
@@ -1088,6 +1088,23 @@ static void omap_dma_free(struct omap_dmadev *od)
 	}
 }
 
+#define OMAP_DMA_BUSWIDTHS	(BIT(DMA_SLAVE_BUSWIDTH_1_BYTE) | \
+				 BIT(DMA_SLAVE_BUSWIDTH_2_BYTES) | \
+				 BIT(DMA_SLAVE_BUSWIDTH_4_BYTES))
+
+static int omap_dma_device_slave_caps(struct dma_chan *dchan,
+				      struct dma_slave_caps *caps)
+{
+	caps->src_addr_widths = OMAP_DMA_BUSWIDTHS;
+	caps->dstn_addr_widths = OMAP_DMA_BUSWIDTHS;
+	caps->directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV);
+	caps->cmd_pause = true;
+	caps->cmd_terminate = true;
+	caps->residue_granularity = DMA_RESIDUE_GRANULARITY_BURST;
+
+	return 0;
+}
+
 static int omap_dma_probe(struct platform_device *pdev)
 {
 	struct omap_dmadev *od;
@@ -1118,6 +1135,7 @@ static int omap_dma_probe(struct platform_device *pdev)
 	od->ddev.device_prep_slave_sg = omap_dma_prep_slave_sg;
 	od->ddev.device_prep_dma_cyclic = omap_dma_prep_dma_cyclic;
 	od->ddev.device_control = omap_dma_control;
+	od->ddev.device_slave_caps = omap_dma_device_slave_caps;
 	od->ddev.dev = &pdev->dev;
 	INIT_LIST_HEAD(&od->ddev.channels);
 	INIT_LIST_HEAD(&od->pending);
-- 
1.9.0

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

* Re: [PATCH] dma: omap-dma: Implement device_slave_caps callback
  2014-03-07 13:36 [PATCH] dma: omap-dma: Implement device_slave_caps callback Peter Ujfalusi
@ 2014-03-12 17:37 ` Tony Lindgren
  2014-03-13  7:48   ` Peter Ujfalusi
  2014-03-29 13:36 ` Vinod Koul
  1 sibling, 1 reply; 5+ messages in thread
From: Tony Lindgren @ 2014-03-12 17:37 UTC (permalink / raw)
  To: Peter Ujfalusi
  Cc: vinod.koul, dan.j.williams, dmaengine, linux-kernel, linux,
	linux-omap

* Peter Ujfalusi <peter.ujfalusi@ti.com> [140307 05:39]:
> With the callback implemented omap-dma can provide information to client
> drivers regarding to supported address widths, directions, residue
> granularity, etc.

This may need some testing against linux next with Russell's
omap-dma.c clean-up series merged there. Peter, care to check
if this patch is still valid against linux next?

Regards,

Tony
 
> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
> ---
>  drivers/dma/omap-dma.c | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
> diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c
> index 64ceca2920b8..b19f04f4390b 100644
> --- a/drivers/dma/omap-dma.c
> +++ b/drivers/dma/omap-dma.c
> @@ -1088,6 +1088,23 @@ static void omap_dma_free(struct omap_dmadev *od)
>  	}
>  }
>  
> +#define OMAP_DMA_BUSWIDTHS	(BIT(DMA_SLAVE_BUSWIDTH_1_BYTE) | \
> +				 BIT(DMA_SLAVE_BUSWIDTH_2_BYTES) | \
> +				 BIT(DMA_SLAVE_BUSWIDTH_4_BYTES))
> +
> +static int omap_dma_device_slave_caps(struct dma_chan *dchan,
> +				      struct dma_slave_caps *caps)
> +{
> +	caps->src_addr_widths = OMAP_DMA_BUSWIDTHS;
> +	caps->dstn_addr_widths = OMAP_DMA_BUSWIDTHS;
> +	caps->directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV);
> +	caps->cmd_pause = true;
> +	caps->cmd_terminate = true;
> +	caps->residue_granularity = DMA_RESIDUE_GRANULARITY_BURST;
> +
> +	return 0;
> +}
> +
>  static int omap_dma_probe(struct platform_device *pdev)
>  {
>  	struct omap_dmadev *od;
> @@ -1118,6 +1135,7 @@ static int omap_dma_probe(struct platform_device *pdev)
>  	od->ddev.device_prep_slave_sg = omap_dma_prep_slave_sg;
>  	od->ddev.device_prep_dma_cyclic = omap_dma_prep_dma_cyclic;
>  	od->ddev.device_control = omap_dma_control;
> +	od->ddev.device_slave_caps = omap_dma_device_slave_caps;
>  	od->ddev.dev = &pdev->dev;
>  	INIT_LIST_HEAD(&od->ddev.channels);
>  	INIT_LIST_HEAD(&od->pending);
> -- 
> 1.9.0
> 

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

* Re: [PATCH] dma: omap-dma: Implement device_slave_caps callback
  2014-03-12 17:37 ` Tony Lindgren
@ 2014-03-13  7:48   ` Peter Ujfalusi
  2014-03-13 16:25     ` Tony Lindgren
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Ujfalusi @ 2014-03-13  7:48 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: vinod.koul, dan.j.williams, dmaengine, linux-kernel, linux,
	linux-omap

Hi Tony,

On 03/12/2014 07:37 PM, Tony Lindgren wrote:
> * Peter Ujfalusi <peter.ujfalusi@ti.com> [140307 05:39]:
>> With the callback implemented omap-dma can provide information to client
>> drivers regarding to supported address widths, directions, residue
>> granularity, etc.
> 
> This may need some testing against linux next with Russell's
> omap-dma.c clean-up series merged there. Peter, care to check
> if this patch is still valid against linux next?

The patch applies cleanly on top of linux-next fetched yesterday and I see
Russell's patches underneath.

-- 
Péter

> 
> Regards,
> 
> Tony
>  
>> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
>> ---
>>  drivers/dma/omap-dma.c | 18 ++++++++++++++++++
>>  1 file changed, 18 insertions(+)
>>
>> diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c
>> index 64ceca2920b8..b19f04f4390b 100644
>> --- a/drivers/dma/omap-dma.c
>> +++ b/drivers/dma/omap-dma.c
>> @@ -1088,6 +1088,23 @@ static void omap_dma_free(struct omap_dmadev *od)
>>  	}
>>  }
>>  
>> +#define OMAP_DMA_BUSWIDTHS	(BIT(DMA_SLAVE_BUSWIDTH_1_BYTE) | \
>> +				 BIT(DMA_SLAVE_BUSWIDTH_2_BYTES) | \
>> +				 BIT(DMA_SLAVE_BUSWIDTH_4_BYTES))
>> +
>> +static int omap_dma_device_slave_caps(struct dma_chan *dchan,
>> +				      struct dma_slave_caps *caps)
>> +{
>> +	caps->src_addr_widths = OMAP_DMA_BUSWIDTHS;
>> +	caps->dstn_addr_widths = OMAP_DMA_BUSWIDTHS;
>> +	caps->directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV);
>> +	caps->cmd_pause = true;
>> +	caps->cmd_terminate = true;
>> +	caps->residue_granularity = DMA_RESIDUE_GRANULARITY_BURST;
>> +
>> +	return 0;
>> +}
>> +
>>  static int omap_dma_probe(struct platform_device *pdev)
>>  {
>>  	struct omap_dmadev *od;
>> @@ -1118,6 +1135,7 @@ static int omap_dma_probe(struct platform_device *pdev)
>>  	od->ddev.device_prep_slave_sg = omap_dma_prep_slave_sg;
>>  	od->ddev.device_prep_dma_cyclic = omap_dma_prep_dma_cyclic;
>>  	od->ddev.device_control = omap_dma_control;
>> +	od->ddev.device_slave_caps = omap_dma_device_slave_caps;
>>  	od->ddev.dev = &pdev->dev;
>>  	INIT_LIST_HEAD(&od->ddev.channels);
>>  	INIT_LIST_HEAD(&od->pending);
>> -- 
>> 1.9.0
>>

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] dma: omap-dma: Implement device_slave_caps callback
  2014-03-13  7:48   ` Peter Ujfalusi
@ 2014-03-13 16:25     ` Tony Lindgren
  0 siblings, 0 replies; 5+ messages in thread
From: Tony Lindgren @ 2014-03-13 16:25 UTC (permalink / raw)
  To: Peter Ujfalusi
  Cc: vinod.koul, dan.j.williams, dmaengine, linux-kernel, linux,
	linux-omap

* Peter Ujfalusi <peter.ujfalusi@ti.com> [140313 00:52]:
> Hi Tony,
> 
> On 03/12/2014 07:37 PM, Tony Lindgren wrote:
> > * Peter Ujfalusi <peter.ujfalusi@ti.com> [140307 05:39]:
> >> With the callback implemented omap-dma can provide information to client
> >> drivers regarding to supported address widths, directions, residue
> >> granularity, etc.
> > 
> > This may need some testing against linux next with Russell's
> > omap-dma.c clean-up series merged there. Peter, care to check
> > if this patch is still valid against linux next?
> 
> The patch applies cleanly on top of linux-next fetched yesterday and I see
> Russell's patches underneath.

OK thanks for testing:

Acked-by: Tony Lindgren <tony@atomide.com>

> > Regards,
> > 
> > Tony
> >  
> >> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
> >> ---
> >>  drivers/dma/omap-dma.c | 18 ++++++++++++++++++
> >>  1 file changed, 18 insertions(+)
> >>
> >> diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c
> >> index 64ceca2920b8..b19f04f4390b 100644
> >> --- a/drivers/dma/omap-dma.c
> >> +++ b/drivers/dma/omap-dma.c
> >> @@ -1088,6 +1088,23 @@ static void omap_dma_free(struct omap_dmadev *od)
> >>  	}
> >>  }
> >>  
> >> +#define OMAP_DMA_BUSWIDTHS	(BIT(DMA_SLAVE_BUSWIDTH_1_BYTE) | \
> >> +				 BIT(DMA_SLAVE_BUSWIDTH_2_BYTES) | \
> >> +				 BIT(DMA_SLAVE_BUSWIDTH_4_BYTES))
> >> +
> >> +static int omap_dma_device_slave_caps(struct dma_chan *dchan,
> >> +				      struct dma_slave_caps *caps)
> >> +{
> >> +	caps->src_addr_widths = OMAP_DMA_BUSWIDTHS;
> >> +	caps->dstn_addr_widths = OMAP_DMA_BUSWIDTHS;
> >> +	caps->directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV);
> >> +	caps->cmd_pause = true;
> >> +	caps->cmd_terminate = true;
> >> +	caps->residue_granularity = DMA_RESIDUE_GRANULARITY_BURST;
> >> +
> >> +	return 0;
> >> +}
> >> +
> >>  static int omap_dma_probe(struct platform_device *pdev)
> >>  {
> >>  	struct omap_dmadev *od;
> >> @@ -1118,6 +1135,7 @@ static int omap_dma_probe(struct platform_device *pdev)
> >>  	od->ddev.device_prep_slave_sg = omap_dma_prep_slave_sg;
> >>  	od->ddev.device_prep_dma_cyclic = omap_dma_prep_dma_cyclic;
> >>  	od->ddev.device_control = omap_dma_control;
> >> +	od->ddev.device_slave_caps = omap_dma_device_slave_caps;
> >>  	od->ddev.dev = &pdev->dev;
> >>  	INIT_LIST_HEAD(&od->ddev.channels);
> >>  	INIT_LIST_HEAD(&od->pending);
> >> -- 
> >> 1.9.0
> >>
> 

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

* Re: [PATCH] dma: omap-dma: Implement device_slave_caps callback
  2014-03-07 13:36 [PATCH] dma: omap-dma: Implement device_slave_caps callback Peter Ujfalusi
  2014-03-12 17:37 ` Tony Lindgren
@ 2014-03-29 13:36 ` Vinod Koul
  1 sibling, 0 replies; 5+ messages in thread
From: Vinod Koul @ 2014-03-29 13:36 UTC (permalink / raw)
  To: Peter Ujfalusi
  Cc: dan.j.williams, dmaengine, linux-kernel, linux, linux-omap, tony

On Fri, Mar 07, 2014 at 03:36:44PM +0200, Peter Ujfalusi wrote:
> With the callback implemented omap-dma can provide information to client
> drivers regarding to supported address widths, directions, residue
> granularity, etc.
>

Applied, thanks

-- 
~Vinod

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

end of thread, other threads:[~2014-03-29 13:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-07 13:36 [PATCH] dma: omap-dma: Implement device_slave_caps callback Peter Ujfalusi
2014-03-12 17:37 ` Tony Lindgren
2014-03-13  7:48   ` Peter Ujfalusi
2014-03-13 16:25     ` Tony Lindgren
2014-03-29 13:36 ` Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).