linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Drew Fustini <drew@beagleboard.org>
To: Tony Lindgren <tony@atomide.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Linux-OMAP <linux-omap@vger.kernel.org>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	Jason Kridner <jkridner@beagleboard.org>,
	Robert Nelson <robertcnelson@gmail.com>
Subject: Re: gpio-omap: handle bias flag for gpio line
Date: Mon, 13 Jul 2020 19:47:47 +0200	[thread overview]
Message-ID: <20200713174747.GA1424108@x1> (raw)
In-Reply-To: <20200713150220.GJ5849@atomide.com>

On Mon, Jul 13, 2020 at 08:02:20AM -0700, Tony Lindgren wrote:
> Hi,
> 
> * Drew Fustini <drew@beagleboard.org> [200712 21:56]:
> > P2.03 header pin on PocketBeagle maps to gpiochip 0 line 23. It is PIN9
> > which value on boot: 0x37 (input [0x20] pull-up [0x10] gpio mode [0x7])
> > 
> > $ cat /sys/kernel/debug/pinctrl/44e10800.pinmux-pinctrl-single/pins |grep ^'pin 9' |head -1
> > pin 9 (PIN9) 44e10824 00000037 pinctrl-single
> > 
> > $ gpiomon -B pull-down 0 23
> 
> Nice it's getting quite close to a user usable feature :)
> 
> I think we really should have an easy way to use the dts configured
> GPIO line names here though. Can we make the dts configured GPIO
> line name show up in the pinctrl output directly?
> 
> This would allow grepping for the device specific GPIO line name
> directly in from the debugfs "pins" output.
> 
> But Ideally this should be done with the gpio sysfs interface though
> somehow rather than rely on pinctrl debugfs. The debugfs interface
> should be optional, and can change.
> 
> Regards,
> 
> Tony

There is gpio-ranges for pinctrl-single in debugfs:

debian@beaglebone:~$ sudo more /sys/kernel/debug/pinctrl/44e10800.pinmux-pinctrl-single/gpio-ranges
GPIO ranges handled:
0: gpio-0-31 GPIOS [0 - 7] PINS [82 - 89]
8: gpio-0-31 GPIOS [8 - 11] PINS [52 - 55]
12: gpio-0-31 GPIOS [12 - 15] PINS [94 - 97]
16: gpio-0-31 GPIOS [16 - 17] PINS [71 - 72]
18: gpio-0-31 GPIOS [18 - 18] PINS [135 - 135]
19: gpio-0-31 GPIOS [19 - 20] PINS [108 - 109]
21: gpio-0-31 GPIOS [21 - 21] PINS [73 - 73]
22: gpio-0-31 GPIOS [22 - 23] PINS [8 - 9]
26: gpio-0-31 GPIOS [26 - 27] PINS [10 - 11]
28: gpio-0-31 GPIOS [28 - 28] PINS [74 - 74]
29: gpio-0-31 GPIOS [29 - 29] PINS [81 - 81]
30: gpio-0-31 GPIOS [30 - 31] PINS [28 - 29]
0: gpio-32-63 GPIOS [32 - 39] PINS [0 - 7]
8: gpio-32-63 GPIOS [40 - 43] PINS [90 - 93]
12: gpio-32-63 GPIOS [44 - 59] PINS [12 - 27]
28: gpio-32-63 GPIOS [60 - 63] PINS [30 - 33]
0: gpio-64-95 GPIOS [64 - 81] PINS [34 - 51]
18: gpio-64-95 GPIOS [82 - 85] PINS [77 - 80]
22: gpio-64-95 GPIOS [86 - 95] PINS [56 - 65]
0: gpio-96-127 GPIOS [96 - 100] PINS [66 - 70]
5: gpio-96-127 GPIOS [101 - 102] PINS [98 - 99]
7: gpio-96-127 GPIOS [103 - 104] PINS [75 - 76]
13: gpio-96-127 GPIOS [109 - 109] PINS [141 - 141]
14: gpio-96-127 GPIOS [110 - 117] PINS [100 - 107]

Do you mean you would like to see the mapping added as a column in the pins file?

debian@beaglebone:~$ sudo cat /sys/kernel/debug/pinctrl/44e10800.pinmux-pinctrl-single/pins  |head
registered pins: 142
pin 0 (PIN0) 44e10800 00000027 pinctrl-single
pin 1 (PIN1) 44e10804 00000027 pinctrl-single
pin 2 (PIN2) 44e10808 00000027 pinctrl-single
pin 3 (PIN3) 44e1080c 00000027 pinctrl-single
pin 4 (PIN4) 44e10810 00000027 pinctrl-single
pin 5 (PIN5) 44e10814 00000027 pinctrl-single
pin 6 (PIN6) 44e10818 00000027 pinctrl-single
pin 7 (PIN7) 44e1081c 00000027 pinctrl-single
pin 8 (PIN8) 44e10820 00000027 pinctrl-single

So that could be:

debian@beaglebone:~$ sudo cat /sys/kernel/debug/pinctrl/44e10800.pinmux-pinctrl-single/pins  |head
registered pins: 142
pin 0 (PIN0) 44e10800 00000027 pinctrl-single GPIO-32
pin 1 (PIN1) 44e10804 00000027 pinctrl-single GPIO-33
pin 2 (PIN2) 44e10808 00000027 pinctrl-single GPIO-34
pin 3 (PIN3) 44e1080c 00000027 pinctrl-single GPIO-35
pin 4 (PIN4) 44e10810 00000027 pinctrl-single GPIO-36
pin 5 (PIN5) 44e10814 00000027 pinctrl-single GPIO-37
pin 6 (PIN6) 44e10818 00000027 pinctrl-single GPIO-38
pin 7 (PIN7) 44e1081c 00000027 pinctrl-single GPIO-39
pin 8 (PIN8) 44e10820 00000027 pinctrl-single GPIO-22

Should I try to add that in pcs_pin_dbg_show()?

It currently prints:

        seq_printf(s, "%zx %08x %s ", pa, val, DRIVER_NAME);

so I could change that to include the GPIO number if mapping exists.


thanks,
drew

  reply	other threads:[~2020-07-13 17:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-25  0:27 gpio-omap: handle bias flag for gpio line Drew Fustini
2020-07-07 12:38 ` Linus Walleij
2020-07-12 21:56   ` Drew Fustini
2020-07-13 15:02     ` Tony Lindgren
2020-07-13 17:47       ` Drew Fustini [this message]
2020-07-13 18:05         ` Tony Lindgren
2020-07-17  1:42           ` 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=20200713174747.GA1424108@x1 \
    --to=drew@beagleboard.org \
    --cc=jkridner@beagleboard.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=robertcnelson@gmail.com \
    --cc=tony@atomide.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).