lkml.org 
[lkml]   [2018]   [Jul]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 07/18] dmaengine: dma-jz4780: Add support for the JZ4770 SoC
On 24-07-18, 17:04, Paul Cercueil wrote:
> Hi Vinod,
>
> Le mar. 24 juil. 2018 à 15:32, Vinod <vkoul@kernel.org> a écrit :
> > On 21-07-18, 13:06, Paul Cercueil wrote:
> > > +static inline void jz4780_dma_chan_enable(struct jz4780_dma_dev
> > > *jzdma,
> > > + unsigned int chn)
> >
> > right justified and aligned with preceding please. While adding new
> > code to a existing driver it is a good idea to conform to existing style
>
> OK.
>
> > > +{
> > > + if (jzdma->version == ID_JZ4770)
> > > + jz4780_dma_ctrl_writel(jzdma, JZ_DMA_REG_DCKES, BIT(chn));
> > > +}
> > > +
> > > +static inline void jz4780_dma_chan_disable(struct jz4780_dma_dev
> > > *jzdma,
> > > + unsigned int chn)
> > > +{
> > > + if (jzdma->version == ID_JZ4770)
> > > + jz4780_dma_ctrl_writel(jzdma, JZ_DMA_REG_DCKEC, BIT(chn));
> >
> > so if another version has this feature we would do:
> > if (jzdma->version == ID_JZ4770) ||
> > if (jzdma->version == ID_JZXXXX))
> >
> > and so on.. why not add a value, clk_enable in the description and use
> > that. For each controller it is set to true or false
>
> I agree with what you said in your other answers.
> However here I still need to check the "version", because on JZ4725B and
> JZ4770+
> the way to start/stop each DMA channel's clock is different, so I can't use
> a boolean

sure describe the behavior and use that. Versions is not a very scalable
way..

--
~Vinod

\
 
 \ /
  Last update: 2018-07-24 18:02    [W:0.082 / U:18.624 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site