linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Trevor Woerner <twoerner@gmail.com>
To: Conor Dooley <conor@kernel.org>
Cc: linux-kernel@vger.kernel.org, Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>, Chen-Yu Tsai <wens@csie.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Samuel Holland <samuel@sholland.org>,
	linux-riscv@lists.infradead.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-sunxi@lists.linux.dev
Subject: Re: [PATCH] riscv: dts: nezha-d1: add gpio-line-names
Date: Wed, 8 Feb 2023 11:57:43 -0500	[thread overview]
Message-ID: <20230208165743.GA8848@localhost> (raw)
In-Reply-To: <Y+PRGjn8a26pe5Dy@spud>

Hi Conor,

Thank you for your review!

On Wed 2023-02-08 @ 04:43:06 PM, Conor Dooley wrote:
> On Tue, Feb 07, 2023 at 08:45:03PM -0500, Trevor Woerner wrote:
> > Add descriptive names so users can associate specific lines with their
> > respective pins on the 40-pin header according to the schematics found at:
> > 
> > 	http://dl.linux-sunxi.org/D1/D1_Nezha_development_board_schematic_diagram_20210224.pdf
> 
> Dunno about the sunxi folk, but ideally that'd be a Link: tag IMO.

Okay, np.

> > 
> > Signed-off-by: Trevor Woerner <twoerner@gmail.com>
> > ---
> >  .../boot/dts/allwinner/sun20i-d1-nezha.dts    | 53 +++++++++++++++++++
> >  1 file changed, 53 insertions(+)
> > 
> > diff --git a/arch/riscv/boot/dts/allwinner/sun20i-d1-nezha.dts b/arch/riscv/boot/dts/allwinner/sun20i-d1-nezha.dts
> > index a0769185be97..33489c7619cb 100644
> > --- a/arch/riscv/boot/dts/allwinner/sun20i-d1-nezha.dts
> > +++ b/arch/riscv/boot/dts/allwinner/sun20i-d1-nezha.dts
> > @@ -90,6 +90,15 @@ pcf8574a: gpio@38 {
> >  		gpio-controller;
> >  		#gpio-cells = <2>;
> >  		#interrupt-cells = <2>;
> > +		gpio-line-names =
> > +			"pin13 [PP0,gpio8] ",
> > +			"pin16 [PP1,gpio10]",
> > +			"pin18 [PP2,gpio11]",
> > +			"pin26 [PP3,gpio17]",
> > +			"pin22 [PP4,gpio14]",
> > +			"pin28 [PP5,gpio19]",
> > +			"pin37 [PP6,gpio23]",
> > +			"pin11 [PP7,gpio6] ";
> 
> dtbs_check does not like this:
> arch/riscv/boot/dts/allwinner/sun20i-d1-nezha.dtb: gpio@38: 'gpio-line-names' does not match any of the regexes: '^(.+-hog(-[0-9]+)?)$', 'pinctrl-[0-9]+'
>         From schema: Documentation/devicetree/bindings/gpio/nxp,pcf8575.yaml
> 
> >  	};
> >  };

Okay, I'll look for other examples of giving names to io-expanders to see
what's needed to keep dtc happy.

> >  
> > @@ -164,3 +173,47 @@ &usbphy {
> >  	usb1_vbus-supply = <&reg_vcc>;
> >  	status = "okay";
> >  };
> > +
> > +&pio {
> > +	gpio-line-names =
> > +		/* Port A */
> > +		"", "", "", "", "", "", "", "",
> > +		"", "", "", "", "", "", "", "",
> > +		"", "", "", "", "", "", "", "",
> > +		"", "", "", "", "", "", "", "",
> > +		/* Port B */
> > +		"pin5  [PB0, gpio2/twi2-sck]",
> > +		"pin3  [PB1, gpio1/twi2-sda]",
> > +		"",
> > +		"pin38 [PB3, gpio24/i2s2-din]",
> > +		"pin40 [PB4, gpio25/i2s2-dout]",
> > +		"pin12 [PB5, gpio7/i2s-clk]",
> > +		"pin35 [PB6, gpio22/i2s2-lrck]",
> > +		"",
> > +		"pin8  [PB8, gpio4/uart0-txd]",
> > +		"pin10 [PB9, gpio5/uart0-rxd]",
> > +		"",
> > +		"",
> > +		"pin15 [PB12,gpio9]",
> 
> Why not pick a consistent styling w.r.t. the space between PB#, & gpio?

I thought it looked better when doing:

	nezha-allwinner-d1:~# gpioinfo
	gpiochip0 - 224 lines:
		...
		line  32: "pin5  [PB0, gpio2/twi2-sck]" kernel input active-high [used]
		line  33: "pin3  [PB1, gpio1/twi2-sda]" kernel input active-high [used]
		line  34:      unnamed  "interrupt"   input  active-high [used]
		line  35: "pin38 [PB3, gpio24/i2s2-din]" unused input active-high
		line  36: "pin40 [PB4, gpio25/i2s2-dout]" unused input active-high
		line  37: "pin12 [PB5, gpio7/i2s-clk]" unused input active-high
		line  38: "pin35 [PB6, gpio22/i2s2-lrck]" unused input active-high
		line  39:      unnamed       unused   input  active-high
		line  40: "pin8  [PB8, gpio4/uart0-txd]" kernel input active-high [used]
		line  41: "pin10 [PB9, gpio5/uart0-rxd]" kernel input active-high [used]
		...

I guess "better" is subjective :-)

I'll do a v2, thanks!

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2023-02-08 16:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-08  1:45 [PATCH] riscv: dts: nezha-d1: add gpio-line-names Trevor Woerner
2023-02-08 16:43 ` Conor Dooley
2023-02-08 16:57   ` Trevor Woerner [this message]
2023-02-10  2:51     ` [PATCH v3 2/2] " Trevor Woerner
2023-02-10 20:37       ` Conor Dooley
2023-03-14 20:44       ` Jernej Škrabec

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=20230208165743.GA8848@localhost \
    --to=twoerner@gmail.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=conor@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=robh+dt@kernel.org \
    --cc=samuel@sholland.org \
    --cc=wens@csie.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).