dmaengine.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vinod Koul <vkoul@kernel.org>
To: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: dmaengine@vger.kernel.org
Subject: Re: [PATCH 3/4] dmaengine: move APIs in interface to use peripheral term
Date: Wed, 28 Oct 2020 10:03:23 +0530	[thread overview]
Message-ID: <20201028043323.GD3550@vkoul-mobl> (raw)
In-Reply-To: <18d27d30-c6c4-51f6-b361-6bf0be1a34b5@ti.com>

On 19-10-20, 12:17, Peter Ujfalusi wrote:
> Hi Vinod,
> 
> On 15/10/2020 10.31, Vinod Koul wrote:
> > dmaengine history has a non inclusive terminology of dmaengine slave, I
> > feel it is time to replace that.
> > 
> > This moves APIs in dmaengine interface with replacement of slave
> > to peripheral which is an appropriate term for dmaengine peripheral
> > devices
> > 
> > Since the change of name can break users, the new names have been added
> > with old APIs kept as macro define for new names. Once the users have
> > been migrated, these macros will be dropped.
> > 
> > Signed-off-by: Vinod Koul <vkoul@kernel.org>
> > ---
> >  include/linux/dmaengine.h | 46 +++++++++++++++++++++++++++------------
> >  1 file changed, 32 insertions(+), 14 deletions(-)
> > 
> > diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
> > index 04b993a5373c..d8dce3cdfdd4 100644
> > --- a/include/linux/dmaengine.h
> > +++ b/include/linux/dmaengine.h
> > @@ -923,6 +923,10 @@ struct dma_device {
> >  	struct dma_async_tx_descriptor *(*device_prep_dma_interrupt)(
> >  		struct dma_chan *chan, unsigned long flags);
> >  
> > +	struct dma_async_tx_descriptor *(*device_prep_peripheral_sg)(
> > +		struct dma_chan *chan, struct scatterlist *sgl,
> > +		unsigned int sg_len, enum dma_transfer_direction direction,
> > +		unsigned long flags, void *context);
> >  	struct dma_async_tx_descriptor *(*device_prep_slave_sg)(
> >  		struct dma_chan *chan, struct scatterlist *sgl,
> >  		unsigned int sg_len, enum dma_transfer_direction direction,
> > @@ -959,8 +963,8 @@ struct dma_device {
> >  #endif
> >  };
> >  
> > -static inline int dmaengine_slave_config(struct dma_chan *chan,
> > -					  struct dma_slave_config *config)
> > +static inline int dmaengine_peripheral_config(struct dma_chan *chan,
> > +					  struct dma_peripheral_config *config)
> >  {
> >  	if (chan->device->device_config)
> >  		return chan->device->device_config(chan, config);
> > @@ -968,12 +972,16 @@ static inline int dmaengine_slave_config(struct dma_chan *chan,
> >  	return -ENOSYS;
> >  }
> >  
> > -static inline bool is_slave_direction(enum dma_transfer_direction direction)
> > +#define dmaengine_slave_config dmaengine_peripheral_config
> > +
> > +static inline bool is_peripheral_direction(enum dma_transfer_direction direction)
> >  {
> >  	return (direction == DMA_MEM_TO_DEV) || (direction == DMA_DEV_TO_MEM);
> >  }
> >  
> > -static inline struct dma_async_tx_descriptor *dmaengine_prep_slave_single(
> > +#define is_slave_direction is_peripheral_direction
> > +
> > +static inline struct dma_async_tx_descriptor *dmaengine_prep_peripheral_single(
> >  	struct dma_chan *chan, dma_addr_t buf, size_t len,
> >  	enum dma_transfer_direction dir, unsigned long flags)
> >  {
> > @@ -989,7 +997,9 @@ static inline struct dma_async_tx_descriptor *dmaengine_prep_slave_single(
> >  						  dir, flags, NULL);
> >  }
> >  
> > -static inline struct dma_async_tx_descriptor *dmaengine_prep_slave_sg(
> > +#define dmaengine_prep_slave_single dmaengine_prep_peripheral_single
> > +
> > +static inline struct dma_async_tx_descriptor *dmaengine_prep_peripheral_sg(
> >  	struct dma_chan *chan, struct scatterlist *sgl,	unsigned int sg_len,
> >  	enum dma_transfer_direction dir, unsigned long flags)
> >  {
> > @@ -1000,6 +1010,8 @@ static inline struct dma_async_tx_descriptor *dmaengine_prep_slave_sg(
> >  						  dir, flags, NULL);
> >  }
> >  
> > +#define dmaengine_prep_slave_sg dmaengine_prep_peripheral_sg
> > +
> 
> If you do similar changes to _single() then DMA drivers can migrate to
> the new device_prep_peripheral_sg in their own pace:

Yes not sure why I missed that, I have updated this for all three APIs
which use .device_prep_slave_sg()

Thanks
-- 
~Vinod

  reply	other threads:[~2020-10-29  0:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-15  7:31 [PATCH 0/4] dmaengine: use inclusive terminology Vinod Koul
2020-10-15  7:31 ` [PATCH 1/4] dmaengine: move enums in interface to use peripheral term Vinod Koul
2020-10-19  8:54   ` Peter Ujfalusi
2020-10-27 17:11     ` Vinod Koul
2020-10-15  7:31 ` [PATCH 2/4] dmaengine: move struct " Vinod Koul
2020-10-19  9:04   ` Peter Ujfalusi
2020-10-27 17:16     ` Vinod Koul
2020-10-15  7:31 ` [PATCH 3/4] dmaengine: move APIs " Vinod Koul
2020-10-19  9:17   ` Peter Ujfalusi
2020-10-28  4:33     ` Vinod Koul [this message]
2020-10-15  7:31 ` [PATCH 4/4] dmaengine: core: update " 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=20201028043323.GD3550@vkoul-mobl \
    --to=vkoul@kernel.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=peter.ujfalusi@ti.com \
    /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).