From mboxrd@z Thu Jan 1 00:00:00 1970 From: aisheng.dong@freescale.com (Dong Aisheng) Date: Mon, 23 Apr 2012 12:01:29 +0800 Subject: [PATCH 3/5] dma: mxs-dma: add device tree probe support In-Reply-To: <20120423031518.GJ26306@S2101-09.ap.freescale.net> References: <1334753197-12032-1-git-send-email-b29396@freescale.com> <1334753197-12032-4-git-send-email-b29396@freescale.com> <20120423031518.GJ26306@S2101-09.ap.freescale.net> Message-ID: <20120423040129.GC24843@shlinux2.ap.freescale.net> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Mon, Apr 23, 2012 at 11:15:20AM +0800, Shawn Guo wrote: > On Wed, Apr 18, 2012 at 08:46:35PM +0800, Dong Aisheng wrote: > > From: Dong Aisheng > > > > Cc: Grant Likely > > Cc: Rob Herring > > Cc: Rob Landley > > Cc: Vinod Koul > > Cc: Dan Williams > > Cc: Shawn Guo > > Cc: Sascha Hauer > > Cc: Marek Vasut > > Cc: Huang Shijie > > Signed-off-by: Dong Aisheng > > --- > > .../devicetree/bindings/dma/fsl-mxs-dma.txt | 19 +++++++++++++ > > drivers/dma/mxs-dma.c | 29 +++++++++++++++++--- > > 2 files changed, 44 insertions(+), 4 deletions(-) > > > > diff --git a/Documentation/devicetree/bindings/dma/fsl-mxs-dma.txt b/Documentation/devicetree/bindings/dma/fsl-mxs-dma.txt > > new file mode 100644 > > index 0000000..ded0398 > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/dma/fsl-mxs-dma.txt > > @@ -0,0 +1,19 @@ > > +* Freescale MXS DMA > > + > > +Required properties: > > +- compatible : Should be "fsl,-dma-apbh" or "fsl,-dma-apbx" > > +- reg : Should contain registers location and length > > + > > +Supported chips: > > +imx23, imx28. > > + > > +Examples: > > +dma-apbh at 80004000 { > > + compatible = "fsl,imx28-dma-apbh"; > > + reg = <0x80004000 2000>; > > +}; > > + > > +dma-apbx at 80024000 { > > + compatible = "fsl,imx28-dma-apbx"; > > + reg = <0x80024000 2000>; > > +}; > > diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c > > index 51a29f9..74c3275 100644 > > --- a/drivers/dma/mxs-dma.c > > +++ b/drivers/dma/mxs-dma.c > > @@ -22,8 +22,11 @@ > > #include > > #include > > #include > > +#include > > #include > > #include > > +#include > > +#include > > > > #include > > > > @@ -178,6 +181,17 @@ static struct platform_device_id mxs_dma_idt[] = { > > } > > }; > > > > +#ifdef CONFIG_OF > > +static const struct of_device_id mxs_dma_dt_ids[] = { > > + { .compatible = "fsl,imx23-dma-apbh", .data = &mxs_dma_idt[0], }, > > + { .compatible = "fsl,imx23-dma-apbx", .data = &mxs_dma_idt[1], }, > > + { .compatible = "fsl,imx28-dma-apbh", .data = &mxs_dma_idt[2], }, > > + { .compatible = "fsl,imx28-dma-apbx", .data = &mxs_dma_idt[3], }, > > + { /* sentinel */ } > > +}; > > +MODULE_DEVICE_TABLE(of, mxs_dma_dt_ids); > > +#endif > > + > As out goal is to convert mxs over to DT, you can remove the #ifdef > here ... > But the non-dt is still exist, right? So i think we can keep it now unless we totally removed the non-dt code. Regards Dong Aisheng