From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: linux-kernel@vger.kernel.org, linux-sh@vger.kernel.org,
Magnus Damm <magnus.damm@gmail.com>,
Simon Horman <horms@verge.net.au>,
Vinod Koul <vinod.koul@intel.com>,
Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Subject: Re: [PATCH v2 05/15] DMA: shdma: pass SoC-specific configuration to the driver via OF matching
Date: Mon, 22 Jul 2013 07:29:40 +0000 [thread overview]
Message-ID: <Pine.LNX.4.64.1307220912380.7852@axis700.grange> (raw)
In-Reply-To: <1625139.lQ0AJJW8Dp@avalon>
On Mon, 22 Jul 2013, Laurent Pinchart wrote:
> Hi Guennadi,
>
> Thanks for the patch.
>
> On Friday 19 July 2013 18:29:30 Guennadi Liakhovetski wrote:
> > Similar to the non-DT case, this patch passes SoC-specific configuration
> > to the driver via device ID matching, instead of platform data.
> >
> > Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
> > ---
> >
> > v2: adjust spacing within array definitions to keep a uniform style.
> >
> > Documentation/devicetree/bindings/dma/shdma.txt | 7 +++++--
> > drivers/dma/sh/shdmac.c | 22 +++++++++++++-------
> > 2 files changed, 20 insertions(+), 9 deletions(-)
> >
> > diff --git a/Documentation/devicetree/bindings/dma/shdma.txt
> > b/Documentation/devicetree/bindings/dma/shdma.txt index c15994a..7702e35
> > 100644
> > --- a/Documentation/devicetree/bindings/dma/shdma.txt
> > +++ b/Documentation/devicetree/bindings/dma/shdma.txt
> > @@ -22,7 +22,10 @@ Optional properties (currently unused):
> > * DMA controller
> >
> > Required properties:
> > -- compatible: should be "renesas,shdma"
> > +- compatible: should be one of
> > + "renesas,shdma-r8a73a4" for the system DMAC on r8a73a4 SoC
> > + "renesas,shdma-r8a7740" for the DMACs (not RTDMAC) on r8a7740
> > + "renesas,shdma" for a generic DMAC
> >
> > Example:
> > dmac: dma-mux0 {
> > @@ -36,7 +39,7 @@ Example:
> > ranges;
> >
> > dma0: shdma@fe008020 {
> > - compatible = "renesas,shdma";
> > + compatible = "renesas,shdma-r8a7740";
> > reg = <0xfe008020 0x270>,
> > <0xfe009000 0xc>;
> > interrupt-parent = <&gic>;
> > diff --git a/drivers/dma/sh/shdmac.c b/drivers/dma/sh/shdmac.c
> > index 859ddbe..f80543c 100644
> > --- a/drivers/dma/sh/shdmac.c
> > +++ b/drivers/dma/sh/shdmac.c
> > @@ -20,6 +20,8 @@
> >
> > #include <linux/init.h>
> > #include <linux/module.h>
> > +#include <linux/of.h>
> > +#include <linux/of_device.h>
> > #include <linux/slab.h>
> > #include <linux/interrupt.h>
> > #include <linux/dmaengine.h>
> > @@ -663,6 +665,14 @@ static const struct shdma_ops sh_dmae_shdma_ops = {
> > .get_partial = sh_dmae_get_partial,
> > };
> >
> > +static const struct of_device_id sh_dmae_of_match[] = {
> > + {.compatible = "renesas,shdma",},
> > + {.compatible = "renesas,shdma-r8a73a4", .data = r8a73a4_shdma_devid,},
> > + {.compatible = "renesas,shdma-r8a7740", .data = r8a7740_shdma_devid,},
>
> Nit-picking here, OF device ID entries are usually ordered from most specific
> to most generic compatible strings. It's up to you.
Yeah, in fact, I'm not even sure we need the generic line, so far I think
we always need SoC configuration. Maybe I shall just remove it. Could do
in an incremental patch.
> > + {}
> > +};
> > +MODULE_DEVICE_TABLE(of, sh_dmae_of_match);
>
> Shouldn't you guard the table with #ifdef CONFIG_OF ? If the driver can only
> be used on ARM platforms it might not be worth it, but if it can be used on SH
> as well that would make sense.
Well, it is a pretty common practice, I admit, but what exactly does it
bring us apart from saving a couple of bytes? I just tried a SuperH build
- no problem.
Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
next prev parent reply other threads:[~2013-07-22 7:29 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-19 16:29 [PATCH v2 00/15] ARM: shmobile: move DMAC configuration data in the driver Guennadi Liakhovetski
2013-07-19 16:29 ` [PATCH v2 01/15] DMA: shdma: add support for DMAC configuration data, supplied via device ID Guennadi Liakhovetski
2013-07-19 16:29 ` [PATCH v2 02/15] DMA: shdma: add r8a7740 DMAC data to the device ID table Guennadi Liakhovetski
2013-07-19 16:29 ` [PATCH v2 03/15] DMA: shdma: add r8a73a4 " Guennadi Liakhovetski
2013-07-19 16:29 ` [PATCH v2 04/15] DMA: shdma: make a pointer const Guennadi Liakhovetski
2013-07-21 21:54 ` Laurent Pinchart
2013-07-22 7:53 ` Guennadi Liakhovetski
2013-07-22 23:37 ` Laurent Pinchart
2013-07-19 16:29 ` [PATCH v2 05/15] DMA: shdma: pass SoC-specific configuration to the driver via OF matching Guennadi Liakhovetski
2013-07-21 22:12 ` Laurent Pinchart
2013-07-22 7:29 ` Guennadi Liakhovetski [this message]
2013-07-22 23:23 ` Laurent Pinchart
2013-07-19 16:29 ` [PATCH v2 06/15] DMA: shdma: make multiplexer platform data optional Guennadi Liakhovetski
2013-07-19 16:29 ` [PATCH v2 07/15] DMA: shdma: add sh73a0 DMAC data to the device ID table Guennadi Liakhovetski
2013-07-20 11:28 ` [PATCH v3 " Guennadi Liakhovetski
2013-07-23 1:29 ` Simon Horman
2013-07-19 16:29 ` [PATCH v2 08/15] DMA: shdma: move two macros to a header Guennadi Liakhovetski
2013-07-21 22:16 ` Laurent Pinchart
2013-07-22 6:40 ` Guennadi Liakhovetski
2013-07-22 23:30 ` Laurent Pinchart
2013-07-19 16:29 ` [PATCH v2 09/15] DMA: shdma: support referencing specific DMACs within a multiplexer in DT Guennadi Liakhovetski
2013-07-21 22:23 ` Laurent Pinchart
2013-07-22 6:34 ` Guennadi Liakhovetski
2013-07-22 23:35 ` Laurent Pinchart
2013-07-19 20:22 ` [PATCH v2 10/15] ARM: shmobile: r8a73a4: add a DMAC platform device and clock for it Guennadi Liakhovetski
2013-07-19 20:22 ` [PATCH v2 11/15] ARM: shmobile: r8a7740: switch DMAC controllers to using device ID data Guennadi Liakhovetski
2013-07-19 20:22 ` [PATCH v2 12/15] ARM: shmobile: r8a7740: add DT nodes and clock aliases for three DMAC instances Guennadi Liakhovetski
2013-07-19 20:22 ` [PATCH v2 13/15] ARM: shmobile: r8a73a4: add a DT node and a clock alias for the DMAC Guennadi Liakhovetski
2013-07-19 20:22 ` [PATCH v2 14/15] ARM: shmobile: sh73a0: switch DMAC controllers to using device ID data Guennadi Liakhovetski
2013-07-19 20:22 ` [PATCH v2 15/15] ARM: shmobile: r8a7740: add support for 2 RTDMACs Guennadi Liakhovetski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.64.1307220912380.7852@axis700.grange \
--to=g.liakhovetski@gmx.de \
--cc=horms@verge.net.au \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=sergei.shtylyov@cogentembedded.com \
--cc=vinod.koul@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).