# \[v3,07/18\] dmaengine: dma-jz4780: Add support for the JZ4770 SoC

- From: Paul Cercueil \<paul@crapouillou.net\>
- Date: 2018-08-04 09:22:12 
- List: dmaengine
- Page: https://ratatoskr.run/dmaengine/2018/08/5350784
- Thread: https://ratatoskr.run/dmaengine/2018/07/5338746/t.md

```text
Hi Vinod,

Le mar. 24 juil. 2018 à 15:32, Vinod [ref] 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

Well that's exactly what I did, this is the style used in the DMA 
driver,
so I tried to conform to it.

>>  +{
>>  +	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
> 
> --
> ~Vinod
---
To unsubscribe from this list: send the line "unsubscribe dmaengine" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
```
