linux-tegra.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
To: Laurent Pinchart
	<laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
Cc: Javier Martinez Canillas
	<javier-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Benoit Cousson <bcousson-rdvid1DuHRBWk0Htik3J/w@public.gmane.org>,
	Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>,
	Andrew Lunn <andrew-g2DYL2Zd6BY@public.gmane.org>,
	Gregory Clement
	<gregory.clement-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
	Sebastian Hesselbarth
	<sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Kukjin Kim <kgene-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Krzysztof Kozlowski
	<k.kozlowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	Shawn Guo <shawnguo-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Sascha Hauer <kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
	Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>,
	Thierry Reding
	<thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Alexandre Courbot
	<gnurou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Liam Girdwood <lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Linus Walleij
	<linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Subject: Re: [PATCH 00/37] ARM: dts: Fix fixed regulators enable GPIO polarity
Date: Mon, 12 Oct 2015 15:24:25 -0700	[thread overview]
Message-ID: <20151012222424.GJ23801@atomide.com> (raw)
In-Reply-To: <5696453.QxruGxICMQ@avalon>

* Laurent Pinchart <laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org> [151012 15:26]:
> Hi Javier,
> 
> On Tuesday 13 October 2015 00:19:20 Javier Martinez Canillas wrote:
> > On 10/12/2015 11:46 PM, Tony Lindgren wrote:
> > > * Laurent Pinchart <laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org> [151012 14:17]:
> > >> Hello,
> > >> 
> > >> While working on regulators, GPIOs and DT I noticed that many of our DT
> > >> source files incorrectly describe fixed regulators. The common error
> > >> patterns are
> > >> 
> > >> - Usage of the undefined (and never parsed) enable-active-low property
> > >> - Usage of the enable-active-high property without specifying an enable
> > >>   GPIO
> > >> - Typos in the enabl GPIO property name (gpios instead of gpio)
> > >> - Mismatch between the enable-active-high property (or the lack thereof)
> > >>   and the enable GPIO flags
> > >> 
> > >> This patch series fixes those issues in all the DT sources after locating
> > >> the errors using the following script.
> > >> 
> > >> -------------------------------------------------------------------------
> > >> !/bin/sh
> > >> 
> > >> echo $1
> > >> cat $1 | awk '
> > >> BEGIN {
> > >> 	open_drain = 0;
> > >> 	active_high = 0;
> > >> 	gpio = 0;
> > >> 	flags = 0;
> > >> }
> > >> 
> > >> match($0, /([a-zA-Z0-9@_-]*) {/, ary) {
> > >> 	name = ary[1];
> > >> }
> > >> 
> > >> /compatible.*"regulator-fixed"/ {
> > >> 	found = 1;
> > >> }
> > >> 
> > >> /enable-active-high/ {
> > >> 	active_high = 1;
> > >> }
> > >> 
> > >> /gpio-open-drain/ {
> > >> 	open_drain = 1;
> > >> }
> > >> 
> > >> match($0, /gpio += <.* ([^ ]*)>/, ary) {
> > >> 	gpio = 1;
> > >> 	flags = ary[1];
> > >> 	if (flags == 0)
> > >> 		flags = "GPIO_ACTIVE_HIGH";
> > >> }
> > >> 
> > >> /}/ {
> > >> 	if (found) {
> > >> 		if (gpio) {
> > >> 			print "\t" name ": active high " active_high " " flags " open 
> drain "
> > >> 			open_drain;
> > >> 			if ((active_high && flags == "GPIO_ACTIVE_LOW") ||
> > >> 			    (!active_high && flags == "GPIO_ACTIVE_HIGH"))
> > >> 				print "WARNING: enable-active-high and flags do not 
> match"
> > >> 		} else {
> > >> 			if (active_high)
> > >> 				print "WARNING: active high without GPIO"
> > >> 			if (open_drain)
> > >> 				print "WARNING: open drain without GPIO"
> > >> 		}
> > >> 	}
> > >> 	
> > >> 	gpio = 0;
> > >> 	found = 0;
> > >> 	active_high = 0;
> > >> 	open_drain = 0;
> > >> 	flags = 0;
> > >> }
> > >> '
> > >> -------------------------------------------------------------------------
> > >> 
> > >> All patches except for the ones touching omap3-beagle-xm and
> > >> omap3-overo-base are untested as I lack test hardware.
> > >> 
> > >> As there's no dependency between the patches touching different source
> > >> files the appropriate maintainers could take their share of the patches
> > >> in their tree. Alternatively I could send a single pull request after
> > >> collecting all acks but that might be more complex.
> > > 
> > > Nice clean-up. For omaps, there's an earlier patch posted by
> > > Javier Martinez Canillas <javier-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org> as "[PATCH] ARM: dts:
> > > Use defined GPIO constants in flags cell for OMAP2+ boards". Can you guys
> > > do some cross checking and let me know which combination I should appluy
> > > for omaps?
> >
> > Since Laurent's changes for OMAP are part of a bigger series and my patch
> > was only for OMAP, probably makes sense for you to pick his patches and I
> > can re-spin mine on top of that.
> > 
> > BTW, I posted as a single patch since the changes were trivial but maybe
> > that made handling these conflicts harder and I should split the changes
> > instead, since I'll resend anyways.
> > 
> > What do you prefer? a patch per SoC family (i.e: OMAP{2,3,4,5}) or patch
> > per board DTS?
> 
> My series will likely miss the next merge window as more discussion is needed. 
> I'll thus respin the patches on top of yours, please proceed without caring 
> about this.

OK applying Javier's patch into omap-for-v4.4/dt then.

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2015-10-12 22:24 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-12 21:12 [PATCH 00/37] ARM: dts: Fix fixed regulators enable GPIO polarity Laurent Pinchart
     [not found] ` <1444684386-17094-1-git-send-email-laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
2015-10-12 21:13   ` [PATCH 34/37] ARM: dts: tegra20-harmony: Fix regulator " Laurent Pinchart
2015-10-12 21:13   ` [PATCH 35/37] ARM: dts: tegra20-iris-512: " Laurent Pinchart
2015-10-12 21:13   ` [PATCH 36/37] ARM: dts: tegra20-seaboard: " Laurent Pinchart
2015-10-12 21:13   ` [PATCH 37/37] ARM: dts: tegra20-ventana: " Laurent Pinchart
     [not found]     ` <1444684386-17094-38-git-send-email-laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
2015-10-12 21:34       ` Stephen Warren
     [not found]         ` <561C2773.5090408-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2015-10-12 22:24           ` Laurent Pinchart
2015-10-13 16:35             ` Stephen Warren
2015-10-12 21:46   ` [PATCH 00/37] ARM: dts: Fix fixed regulators " Tony Lindgren
2015-10-12 22:19     ` Javier Martinez Canillas
2015-10-12 22:22       ` Laurent Pinchart
2015-10-12 22:24         ` Tony Lindgren [this message]
2015-10-13  6:19   ` Sascha Hauer
2015-10-13 14:09   ` Shawn Guo
2015-10-13 14:17     ` Laurent Pinchart
2015-10-13 15:09       ` Shawn Guo

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=20151012222424.GJ23801@atomide.com \
    --to=tony-4v6ys6ai5vpbdgjk7y7tuq@public.gmane.org \
    --cc=andrew-g2DYL2Zd6BY@public.gmane.org \
    --cc=bcousson-rdvid1DuHRBWk0Htik3J/w@public.gmane.org \
    --cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=gnurou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=gregory.clement-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
    --cc=jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org \
    --cc=javier-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org \
    --cc=k.kozlowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    --cc=kgene-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org \
    --cc=lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=shawnguo-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org \
    --cc=thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /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).