linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: vinod.koul@intel.com (Vinod Koul)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 34/61] dmaengine: omap: Split device_control
Date: Fri, 5 Dec 2014 19:57:02 +0530	[thread overview]
Message-ID: <20141205142702.GF3411@intel.com> (raw)
In-Reply-To: <1416231775-31252-35-git-send-email-maxime.ripard@free-electrons.com>

On Mon, Nov 17, 2014 at 02:42:28PM +0100, Maxime Ripard wrote:
> Split the device_control callback of the TI OMAP DMA driver to make use
> of the newly introduced callbacks, that will eventually be used to retrieve
> slave capabilities.
> 
> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> ---
>  drivers/dma/omap-dma.c | 51 +++++++++++++++-----------------------------------
>  1 file changed, 15 insertions(+), 36 deletions(-)
> 
> diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c
> index a8aa5b6bb5e2..1cadf812f3b3 100644
> --- a/drivers/dma/omap-dma.c
> +++ b/drivers/dma/omap-dma.c
> @@ -948,8 +948,10 @@ static struct dma_async_tx_descriptor *omap_dma_prep_dma_cyclic(
>  	return vchan_tx_prep(&c->vc, &d->vd, flags);
>  }
>  
> -static int omap_dma_slave_config(struct omap_chan *c, struct dma_slave_config *cfg)
> +static int omap_dma_slave_config(struct dma_chan *chan, struct dma_slave_config *cfg)
>  {
> +	struct omap_chan *c = to_omap_dma_chan(chan);
> +
>  	if (cfg->src_addr_width == DMA_SLAVE_BUSWIDTH_8_BYTES ||
>  	    cfg->dst_addr_width == DMA_SLAVE_BUSWIDTH_8_BYTES)
>  		return -EINVAL;
> @@ -959,8 +961,9 @@ static int omap_dma_slave_config(struct omap_chan *c, struct dma_slave_config *c
>  	return 0;
>  }
>  
> -static int omap_dma_terminate_all(struct omap_chan *c)
> +static int omap_dma_terminate_all(struct dma_chan *chan)
>  {
> +	struct omap_chan *c = to_omap_dma_chan(chan);
>  	struct omap_dmadev *d = to_omap_dma_dev(c->vc.chan.device);
>  	unsigned long flags;
>  	LIST_HEAD(head);
> @@ -996,8 +999,10 @@ static int omap_dma_terminate_all(struct omap_chan *c)
>  	return 0;
>  }
>  
> -static int omap_dma_pause(struct omap_chan *c)
> +static int omap_dma_pause(struct dma_chan *chan)
>  {
> +	struct omap_chan *c = to_omap_dma_chan(chan);
> +
>  	/* Pause/Resume only allowed with cyclic mode */
>  	if (!c->cyclic)
>  		return -EINVAL;
> @@ -1010,8 +1015,10 @@ static int omap_dma_pause(struct omap_chan *c)
>  	return 0;
>  }
>  
> -static int omap_dma_resume(struct omap_chan *c)
> +static int omap_dma_resume(struct dma_chan *chan)
>  {
> +	struct omap_chan *c = to_omap_dma_chan(chan);
> +
>  	/* Pause/Resume only allowed with cyclic mode */
>  	if (!c->cyclic)
>  		return -EINVAL;
> @@ -1029,37 +1036,6 @@ static int omap_dma_resume(struct omap_chan *c)
>  	return 0;
>  }
>  
> -static int omap_dma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
> -	unsigned long arg)
> -{
> -	struct omap_chan *c = to_omap_dma_chan(chan);
> -	int ret;
> -
> -	switch (cmd) {
> -	case DMA_SLAVE_CONFIG:
> -		ret = omap_dma_slave_config(c, (struct dma_slave_config *)arg);
> -		break;
> -
> -	case DMA_TERMINATE_ALL:
> -		ret = omap_dma_terminate_all(c);
> -		break;
> -
> -	case DMA_PAUSE:
> -		ret = omap_dma_pause(c);
> -		break;
> -
> -	case DMA_RESUME:
> -		ret = omap_dma_resume(c);
> -		break;
> -
> -	default:
> -		ret = -ENXIO;
> -		break;
> -	}
> -
> -	return ret;
> -}
> -
>  static int omap_dma_chan_init(struct omap_dmadev *od, int dma_sig)
>  {
>  	struct omap_chan *c;
> @@ -1136,7 +1112,10 @@ static int omap_dma_probe(struct platform_device *pdev)
>  	od->ddev.device_issue_pending = omap_dma_issue_pending;
>  	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;
this should be assigned to omap_dma_slave_config. omap_dma_control is not
here :(

-- 
~Vinod

> +	od->ddev.device_config = omap_dma_config;
> +	od->ddev.device_pause = omap_dma_pause;
> +	od->ddev.device_resume = omap_dma_resume;
> +	od->ddev.device_terminate_all = omap_dma_terminate_all;
>  	od->ddev.device_slave_caps = omap_dma_device_slave_caps;
>  	od->ddev.dev = &pdev->dev;
>  	INIT_LIST_HEAD(&od->ddev.channels);
> -- 
> 2.1.1
> 

-- 

  reply	other threads:[~2014-12-05 14:27 UTC|newest]

Thread overview: 82+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-17 13:41 [PATCH v5 00/61] dmaengine: Implement generic slave capabilities retrieval Maxime Ripard
2014-11-17 13:41 ` [PATCH v5 01/61] serial: at91: Use dmaengine_slave_config API Maxime Ripard
2014-11-17 13:41 ` [PATCH v5 02/61] crypto: ux500: Use dmaengine_terminate_all API Maxime Ripard
2014-11-17 13:41 ` [PATCH v5 03/61] dmaengine: Make the destination abbreviation coherent Maxime Ripard
2014-11-17 13:41 ` [PATCH v5 04/61] dmaengine: Rework dma_chan_get Maxime Ripard
2014-11-17 13:41 ` [PATCH v5 05/61] dmaengine: Make channel allocation callbacks optional Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 06/61] dmaengine: Introduce a device_config callback Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 07/61] dmaengine: split out pause/resume operations from device_control Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 08/61] dmaengine: Add device_terminate_all callback Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 09/61] dmaengine: Remove the need to declare device_control Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 10/61] dmaengine: Create a generic dma_slave_caps callback Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 11/61] dmaengine: pl08x: Split device_control Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 12/61] dmaengine: hdmac: " Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 13/61] dmaengine: at_xdmac: split device_control Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 14/61] dmaengine: bcm2835: Split device_control Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 15/61] dmaengine: coh901318: " Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 16/61] dmaengine: cppi41: " Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 17/61] dmaengine: jz4740: " Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 18/61] dmaengine: dw: " Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 19/61] dmaengine: edma: " Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 20/61] dmaengine: ep93xx: " Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 21/61] dmaengine: fsl-edma: " Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 22/61] dmaengine: imx: " Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 23/61] dmaengine: imx-sdma: " Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 24/61] dmaengine: intel-mid-dma: " Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 25/61] dmaengine: ipu-idmac: " Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 26/61] dmaengine: k3: " Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 27/61] dmaengine: mmp-pdma: " Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 28/61] dmaengine: mmp-tdma: " Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 29/61] dmaengine: moxart: " Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 30/61] dmaengine: fsl-dma: " Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 31/61] dmaengine: mpc512x: " Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 32/61] dmaengine: mxs: " Maxime Ripard
2014-12-05 14:29   ` Vinod Koul
2014-11-17 13:42 ` [PATCH v5 33/61] dmaengine: nbpfaxi: " Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 34/61] dmaengine: omap: " Maxime Ripard
2014-12-05 14:27   ` Vinod Koul [this message]
2014-12-05 14:33     ` Maxime Ripard
2014-12-05 14:56       ` Vinod Koul
2014-12-05 17:07         ` Maxime Ripard
2014-12-05 17:39           ` Vinod Koul
2014-11-17 13:42 ` [PATCH v5 35/61] dmaengine: pl330: " Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 36/61] dmaengine: bam-dma: " Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 37/61] dmaengine: s3c24xx: " Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 38/61] dmaengine: sa11x0: " Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 39/61] dmaengine: sh: " Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 40/61] dmaengine: sirf: " Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 41/61] dmaengine: sun6i: " Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 42/61] dmaengine: d40: " Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 43/61] dmaengine: tegra20: " Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 44/61] dmaengine: xilinx: " Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 45/61] dmaengine: mv_xor: Remove device_control Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 46/61] dmaengine: pch-dma: Rename device_control Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 47/61] dmaengine: td: " Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 48/61] dmaengine: txx9: " Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 49/61] dmaengine: rapidio: tsi721: " Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 50/61] dmaengine: at_xdmac: Declare slave capabilities for the generic code Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 51/61] dmaengine: bcm2835: " Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 52/61] dmaengine: fsl-edma: " Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 53/61] dmaengine: edma: " Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 54/61] dmaengine: nbpfaxi: " Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 55/61] dmaengine: omap: " Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 56/61] dmaengine: pl330: " Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 57/61] dmaengine: sirf: " Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 58/61] dmaengine: sun6i: " Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 59/61] dmaengine: Add a warning for drivers not using the generic slave caps retrieval Maxime Ripard
2015-02-19  7:57   ` Viresh Kumar
2015-02-19  8:09     ` Jean Delvare
2015-02-19  8:53       ` Viresh Kumar
2015-02-20  6:24         ` Vinod Koul
2014-11-17 13:42 ` [PATCH v5 60/61] dmaengine: Remove device_control and device_slave_caps Maxime Ripard
2014-11-17 13:42 ` [PATCH v5 61/61] Documentation: dmaengine: Update the documentation Maxime Ripard
2014-12-08  6:17 ` [PATCH v5 00/61] dmaengine: Implement generic slave capabilities retrieval Vinod Koul
2014-12-08  9:32   ` Ludovic Desroches
2014-12-08 13:30     ` Vinod Koul
2014-12-08 14:31       ` Maxime Ripard
2014-12-08 14:18   ` Maxime Ripard
2014-12-08 16:28     ` Vinod Koul
2014-12-08 18:38       ` Maxime Ripard
2014-12-08 21:49         ` Lars-Peter Clausen
2014-12-11 17:03           ` Maxime Ripard
2014-12-09  4:43         ` Vinod Koul

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141205142702.GF3411@intel.com \
    --to=vinod.koul@intel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).