linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vinod Koul <vkoul@infradead.org>
To: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: dan.j.williams@intel.com, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Subject: Re: [PATCH 3/3] dmaengine: at_hdmac: add slave config operation
Date: Thu, 07 Jul 2011 08:03:45 +0530	[thread overview]
Message-ID: <1310006025.20150.29.camel@psiaudioba-mobl1> (raw)
In-Reply-To: <1151852b20789636633095406a180335364f4afb.1309259835.git.nicolas.ferre@atmel.com>

On Tue, 2011-06-28 at 13:17 +0200, Nicolas Ferre wrote:
> Only change source/destination peripheral register access width.
How about a little more explainable change log

> 
> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/dma/at_hdmac.c |   29 +++++++++++++++++++++++++++++
>  1 files changed, 29 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
> index 7096adb..9cb8044 100644
> --- a/drivers/dma/at_hdmac.c
> +++ b/drivers/dma/at_hdmac.c
> @@ -954,6 +954,35 @@ static int atc_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
>  		clear_bit(ATC_IS_PAUSED, &atchan->status);
>  
>  		spin_unlock_irqrestore(&atchan->lock, flags);
> +	} else if (cmd == DMA_SLAVE_CONFIG) {
> +		struct dma_slave_config *dmaengine_cfg = (void *)arg;
> +		struct at_dma_slave	*atslave = chan->private;
This API was created to remove chan->private, so this doesn't make sense
at all. If your intent is to have a channels internal data, then you
should consider embedding dma_chan into this structure (the way other
dma drivers do) rather than using private field.
> +		enum dma_slave_buswidth sdma_width;
> +		enum at_dma_slave_width	atdma_width;
> +
> +		/* only modify transfer size width */
> +		if (!atslave)
> +			return -ENXIO;
> +
> +		if (dmaengine_cfg->direction == DMA_FROM_DEVICE)
> +			sdma_width = dmaengine_cfg->src_addr_width;
> +		else
> +			sdma_width = dmaengine_cfg->dst_addr_width;
> +
> +		switch (sdma_width) {
> +		case DMA_SLAVE_BUSWIDTH_1_BYTE:
> +			atdma_width = AT_DMA_SLAVE_WIDTH_8BIT;
> +			break;
> +		case DMA_SLAVE_BUSWIDTH_2_BYTES:
> +			atdma_width = AT_DMA_SLAVE_WIDTH_16BIT;
> +			break;
> +		case DMA_SLAVE_BUSWIDTH_4_BYTES:
> +			atdma_width = AT_DMA_SLAVE_WIDTH_32BIT;
> +			break;
> +		default:
> +			return -EINVAL;
> +		}
> +		atslave->reg_width = atdma_width;
>  	} else if (cmd == DMA_TERMINATE_ALL) {
>  		struct at_desc	*desc, *_desc;
>  		/*

-- 
~Vinod Koul
Intel Corp.


  reply	other threads:[~2011-07-07  2:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-28 11:17 [PATCH 1/3] dmaengine: at_hdmac: replace spin_lock* with irqsave variants Nicolas Ferre
2011-06-28 10:15 ` Nicolas Ferre
2011-06-28 11:17 ` [PATCH 2/3] dmaengine: at_hdmac: improve power management routines Nicolas Ferre
2011-07-07  2:20   ` Vinod Koul
2011-07-25 21:06     ` Nicolas Ferre
2011-07-26 10:51       ` Vinod Koul
2011-07-27 12:21         ` [PATCH V2 1/3] dmaengine: at_hdmac: replace spin_lock* with irqsave variants Nicolas Ferre
2011-07-25 21:09           ` [PATCH] dmaengine: at_hdmac: add wrappers for testing channel state Nicolas Ferre
2011-08-01 14:18             ` [PATCH V2 3/3] " Nicolas Ferre
2011-07-27 12:21           ` [PATCH V2 2/3] dmaengine: at_hdmac: improve power management routines Nicolas Ferre
2011-06-28 11:17 ` [PATCH 3/3] dmaengine: at_hdmac: add slave config operation Nicolas Ferre
2011-07-07  2:33   ` Vinod Koul [this message]
2011-07-25 21:12     ` Nicolas Ferre

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=1310006025.20150.29.camel@psiaudioba-mobl1 \
    --to=vkoul@infradead.org \
    --cc=dan.j.williams@intel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicolas.ferre@atmel.com \
    --cc=u.kleine-koenig@pengutronix.de \
    /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).