linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
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: Tue, 23 Jul 2013 01:23:40 +0200	[thread overview]
Message-ID: <2097756.PJRdecDxfm@avalon> (raw)
In-Reply-To: <Pine.LNX.4.64.1307220912380.7852@axis700.grange>

Hi Guennadi,

On Monday 22 July 2013 09:29:40 Guennadi Liakhovetski wrote:
> On Mon, 22 Jul 2013, Laurent Pinchart wrote:
> > 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.

If you end up sending a v3 you could remove the generic entry. Otherwise let's 
not bother for now.

> > > +	{}
> > > +};
> > > +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.

Exactly that, saving a couple of bytes :-)

-- 
Regards,

Laurent Pinchart


  reply	other threads:[~2013-07-22 23:22 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
2013-07-22 23:23       ` Laurent Pinchart [this message]
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=2097756.PJRdecDxfm@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=g.liakhovetski@gmx.de \
    --cc=horms@verge.net.au \
    --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).