lkml.org 
[lkml]   [2018]   [Jul]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 01/14] dmaengine: dma-jz4780: Avoid hardcoding number of channels
On 03-07-18, 14:32, Paul Cercueil wrote:

> struct jz4780_dma_dev {
> struct dma_device dma_device;
> void __iomem *base;
> struct clk *clk;
> unsigned int irq;
> + unsigned int nb_channels;
> + enum jz_version version;
>
> uint32_t chan_reserved;
> - struct jz4780_dma_chan chan[JZ_DMA_NR_CHANNELS];
> + struct jz4780_dma_chan chan[];

why array, why not channel pointer?

> +static const unsigned int jz4780_dma_nb_channels[] = {
> + [ID_JZ4780] = 32,
> +};
> +
> +static const struct of_device_id jz4780_dma_dt_match[] = {
> + { .compatible = "ingenic,jz4780-dma", .data = (void *)ID_JZ4780 },
> + {},
> +};

Looking at description I was hoping that channels would be in DT,
channels is hardware information, so should come from DT rather than
coding the kernel...

> - jzdma = devm_kzalloc(dev, sizeof(*jzdma), GFP_KERNEL);
> + if (of_id)
> + version = (enum jz_version)of_id->data;
> + else
> + version = ID_JZ4780; /* Default when not probed from DT */

where else would it be probed from.... ?
--
~Vinod

\
 
 \ /
  Last update: 2018-07-09 19:01    [W:0.211 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site