Re: [PATCH v9 38/38] dma: cirrus: remove platform code

From: Alexander Sverdlin
Date: Thu Mar 28 2024 - 03:00:33 EST


Hi Vinod!

On Thu, 2024-03-28 at 10:14 +0530, Vinod Koul wrote:
> > From: Nikita Shubin <nikita.shubin@xxxxxxxxxxx>
>
> s/dma/dmaengine is subject line
>
> >
> > Remove DMA platform header, from now on we use device tree for DMA
> > clients.
> >
> > Signed-off-by: Nikita Shubin <nikita.shubin@xxxxxxxxxxx>
> > ---
> >   drivers/dma/ep93xx_dma.c                 |  48 ++++++++++++++-
> >   include/linux/platform_data/dma-ep93xx.h | 100 -------------------------------
> >   2 files changed, 46 insertions(+), 102 deletions(-)
> >
> > diff --git a/drivers/dma/ep93xx_dma.c b/drivers/dma/ep93xx_dma.c
> > index 17c8e2badee2..43c4241af7f5 100644
> > --- a/drivers/dma/ep93xx_dma.c
> > +++ b/drivers/dma/ep93xx_dma.c

[...]

> > +/*
> > + * ep93xx_dma_chan_direction - returns direction the channel can be used
> > + *
> > + * This function can be used in filter functions to find out whether the
> > + * channel supports given DMA direction. Only M2P channels have such
> > + * limitation, for M2M channels the direction is configurable.
> > + */
> > +static inline enum dma_transfer_direction
> > +ep93xx_dma_chan_direction(struct dma_chan *chan)
> > +{
> > + if (!ep93xx_dma_chan_is_m2p(chan))
> > + return DMA_TRANS_NONE;
> > +
> > + /* even channels are for TX, odd for RX */
>
> Is this a SW limitation and HW one?

The numbering scheme is defined in HW:
https://cdn.embeddedts.com/resource-attachments/ts-7000_ep9301-ug.pdf

"7.2.2 Internal M2P/P2M Channel Register Map" -> "PPALLOC"

"NOTE: The naming convention used for channels and
ports is as follows - even numbers correspond to transmit
channels/ports and odd numbers correspond to receive
channels/ports."


> > + return (chan->chan_id % 2 == 0) ? DMA_MEM_TO_DEV : DMA_DEV_TO_MEM;
> > +}

--
Alexander Sverdlin.