gpio-line-name for gpiochip0 and gpiochip1

Post Reply
ywtom3
Posts: 5
Joined: Mon Nov 25, 2019 7:03 pm
languages_spoken: english
Has thanked: 1 time
Been thanked: 0
Contact:

gpio-line-name for gpiochip0 and gpiochip1

Unread post by ywtom3 » Mon Jan 13, 2020 1:39 pm

I have a question about the gpio line names when using libgpiod.
Since the GPIO access using sysfs has been deprecated since version 4.8 of the Linux kernel (and I am using 4.9), I decided to use the libgpiod method to manipulate the GPIO for my project.
After installing the libgpiod on debian buster, I ran the gpiodetect and gpioinfo to check the gpiochip that were used. When running gpioinfo, the gpio-line-name displayed are all unnamed so I cannot see which gpio line is mapped to which pin on the 40 pin header. Is there any documentation I can refer to so I can distinguish which line is map to pin?
Thanks!

joshua.yang
Posts: 342
Joined: Fri Sep 22, 2017 5:54 pm
languages_spoken: Korean, English
ODROIDs: XU4, XU4Q + Cloudshell2, H2, N2
Has thanked: 9 times
Been thanked: 64 times
Contact:

Re: gpio-line-name for gpiochip0 and gpiochip1

Unread post by joshua.yang » Mon Jan 13, 2020 5:22 pm

Hi.

I'm sorry but we're not providing a table map for gpiochip0/1 pins corresponding to 40 pin header.

All the pins of the header are registered in gpiochip0, and the first pin number of the gpiochip0 is 427.

Code: Select all

root@odroidn2:~# cat /sys/kernel/debug/gpio
gpiochip1: GPIOs 412-426, parent: platform/ff800000.sys-ctrl:pinctrl@14, aobus-banks:
 gpio-420 (                    |regulator-tflash_vdd) out hi
 gpio-421 (                    |TF_IO               ) out lo
 gpio-423 (                    |?                   ) out lo

gpiochip0: GPIOs 427-511, parent: platform/ff634400.bus:pinctrl@40, periphs-banks:
 gpio-442 (                    |PHY reset           ) out hi ACTIVE LOW
 gpio-447 (                    |usb-hub-reset       ) in  hi
 gpio-448 (                    |regulator-hub_5v    ) out hi
 gpio-449 (                    |regulator-usb_pwr_en) out lo
 gpio-464 (                    |reset               ) out hi ACTIVE LOW
 gpio-474 (                    |cd                  ) in  hi ACTIVE LOW
 
So, you can write a code referring to this link: https://wiki.odroid.com/odroid-n2/hardw ... _2x20_pins
These users thanked the author joshua.yang for the post:
ywtom3 (Tue Jan 14, 2020 9:43 am)

Post Reply

Return to “Hardware and peripherals”

Who is online

Users browsing this forum: No registered users and 0 guests