All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Drew Fustini <drew@pdp7.com>
Cc: Robert Nelson <robertcnelson@gmail.com>,
	Grygorii Strashko <grygorii.strashko@ti.com>,
	Haojian Zhuang <haojian.zhuang@linaro.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Santosh Shilimkar <ssantosh@kernel.org>,
	Kevin Hilman <khilman@kernel.org>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	Jason Kridner <jkridner@beagleboard.org>,
	linux-omap <linux-omap@vger.kernel.org>,
	Kent Gibson <warthog618@gmail.com>,
	Bartosz Golaszewski <brgl@bgdev.pl>
Subject: Re: gpio-omap: add support gpiolib bias (pull-up/down) flags?
Date: Thu, 23 Apr 2020 09:42:08 -0700	[thread overview]
Message-ID: <20200423164208.GF37466@atomide.com> (raw)
In-Reply-To: <20200423131738.GA16584@x1>

* Drew Fustini <drew@pdp7.com> [200423 13:17]:
> Thanks, Tony.  I was able to apply your patch cleanly to 5.5.9 kernel
> and boot it ok on the PocketBeagle (AM3358) which is what I'm currently
> testing with.  I can switch to 5.7.x but I just happened to be on 5.5.x
> because that is when bias flags were added to gpiolib uapi.

OK. BTW, with PocketBeagle and mainline v5.6 kernel, I see the micro-USB
connection always get disconnected after few hours of use. Are you aware
ofthat?

This is with the micro-USB configured as acm and ecm gadget via configfs.

> I'm a somewhat confused about the difference between the "gpio-ranges"
> property for the gpio[0-3] nodes and the "pinctrl-single,gpio-range"
> property for the am33xx_pinmux node.
> 
> For a test, I tried adding "gpio-ranges" to arch/arm/boot/dts/am33xx-l4.dtsi:
> 
>                         gpio0: gpio@0 {
>                                 compatible = "ti,omap4-gpio";
>                                 gpio-controller;
>                                 #gpio-cells = <2>;
>                                 interrupt-controller;
>                                 #interrupt-cells = <2>;
>                                 reg = <0x0 0x1000>;
>                                 interrupts = <96>;
>                                 gpio-ranges = <&am33xx_pinmux 0 0 1>;
> 			}

So the gpio-ranges tells the gpio contorller what pinctrl device pin
to use for configuring things.

> and "pinctrl-single,gpio-range" like this:
> 
>                                 am33xx_pinmux: pinmux@800 {
>                                         compatible = "pinctrl-single";
>                                         reg = <0x800 0x238>;
>                                         #pinctrl-cells = <1>;
>                                         pinctrl-single,register-width = <32>;
>                                         pinctrl-single,function-mask = <0x7f>;
> 
>                                         pinctrl-single,gpio-range = <&range 0 1 0>;
> 
>                                         range: gpio-range {
>                                                 #pinctrl-single,gpio-range-cells = <3>;
>                                         };
>                                 };
> 
> Do you think both of those properties would be needed?

No I don't think so. The pinctrl-single could be additionally
configured for gpio functionality too. For omaps, that gpio
functionality would be mostly limited to output toggling using the
internal pulls. Would be still usable on some systems though.

Also, it's been a while so I don't remember where I started running
into addressing issues though.. My guess is that you will soon hit
them too and notice :)

But basically we want to reference the pinctrl pins based on their
physical offset from the padconf base register, and not based on an
invented number in the dts. Well maybe you can describe the problem
further for us to discuss when you see it :)

Regards,

Tony

  reply	other threads:[~2020-04-23 16:42 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-08 13:08 gpio-omap: add support gpiolib bias (pull-up/down) flags? Drew Fustini
2020-03-12 10:43 ` Linus Walleij
2020-03-13  0:39   ` Drew Fustini
2020-03-13  5:23     ` Haojian Zhuang
2020-04-13 12:39       ` Drew Fustini
2020-04-15 13:15         ` Grygorii Strashko
2020-04-15 13:20           ` Robert Nelson
2020-04-15 13:47             ` Grygorii Strashko
2020-04-15 13:59               ` Robert Nelson
2020-04-15 23:37                 ` Drew Fustini
2020-04-16 12:03                   ` Linus Walleij
2020-04-16 16:07                     ` Drew Fustini
2020-04-16 14:16                   ` Grygorii Strashko
2020-04-17 10:37                     ` Linus Walleij
2020-04-16 16:32                   ` Tony Lindgren
2020-04-23 13:17                     ` Drew Fustini
2020-04-23 16:42                       ` Tony Lindgren [this message]
2020-04-24 17:32                         ` Drew Fustini
2020-04-24 17:49                           ` Tony Lindgren
2020-05-25 13:17                             ` Drew Fustini

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=20200423164208.GF37466@atomide.com \
    --to=tony@atomide.com \
    --cc=brgl@bgdev.pl \
    --cc=drew@pdp7.com \
    --cc=grygorii.strashko@ti.com \
    --cc=haojian.zhuang@linaro.org \
    --cc=jkridner@beagleboard.org \
    --cc=khilman@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=robertcnelson@gmail.com \
    --cc=ssantosh@kernel.org \
    --cc=warthog618@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.