Add gpio labels for R4Pro
Subsystems (2)
cover Add gpio labels for R4Pro
From: Frank Wunderlich <[email protected]>
This Series adds line-names for i2c-gpio adapter and pcie hogs for easier debugging via /sys/kernel/debug/gpio.
Frank Wunderlich (2):
arm64: dts: mediatek: mt7988a-bpi-r4pro: add names for i2c-to-gpio
chip
arm64: dts: mediatek: mt7988a-bpi-r4pro: label gpio-hogs
.../mt7988a-bananapi-bpi-r4-pro-cn13.dtso | 1 + .../mt7988a-bananapi-bpi-r4-pro-cn14.dtso | 1 + .../mt7988a-bananapi-bpi-r4-pro-cn15.dtso | 1 + .../mt7988a-bananapi-bpi-r4-pro-cn18.dtso | 1 + .../mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi | 18 ++++++++++++++++++ 5 files changed, 22 insertions(+)
Signature · 1 line
2.53.0
PATCH 1/2 arm64: dts: mediatek: mt7988a-bpi-r4pro: add names for i2c-to-gpio chip
From: Frank Wunderlich <[email protected]>
Add line-names for the PCA9555 i2c to gpio expander to have more information in debugfs.
--- .../mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi +18 -0
@@ -315,6 +315,24 @@ pca9555: i2c-gpio-expander@20 { reg = <0x20>; gpio-controller; #gpio-cells = <2>; + + gpio-line-names = + "BKEY-A-PDN", /* GPIO0 */ + "BKEY-A-Vset", /* GPIO1 */ + "BKEY-B-PDN", /* GPIO2 */ + "BKEY-B-Vset", /* GPIO3 */ + "BKEY-C-PDN", /* GPIO4 */ + "BKEY-C-Vset", /* GPIO5 */ + "SIM_SEL", /* GPIO6 */ + "mPCIe_AB_Vset",/* GPIO7 */ + "mPCIe_A_PDN", /* GPIO8 */ + "mPCIe_B_PDN", /* GPIO9 */ + "BKEY-A-RST", /* GPIO10 */ + "VBUS_AB_PDN", /* GPIO11 */ + "BKEY-B-RST", /* GPIO12 */ + "BKEY-C-RST", /* GPIO13 */ + "SYS_LEDB", /* GPIO14 */ + "SYS_LEDR"; /* GPIO15 */ }; rtc@51 {
Signature · 1 line
2.53.0
Re: [PATCH 1/2] arm64: dts: mediatek: mt7988a-bpi-r4pro: add names for i2c-to-gpio chip
Quoted 6 lines · Frank Wunderlich
From: Frank Wunderlich <[email protected]>
Add line-names for the PCA9555 i2c to gpio expander to have more information in debugfs.
Signed-off-by Frank Wunderlich <[email protected]>
Yours,
Linus Walleij
PATCH 2/2 arm64: dts: mediatek: mt7988a-bpi-r4pro: label gpio-hogs
In reply to Frank WunderlichFrom: Frank Wunderlich <[email protected]>
GPIO hogs were tagged with name "?" in recent kernel versions (7.1+) due to commit d1d564ec4992 ("gpio: move hogs into GPIO core").
7.0 showed the unit-name which behaviour is restored by patch [1], but labeling the hog directly makes things easier.
gpiochip0: 84 GPIOs, parent: platform/1001f000.pinctrl, pinctrl_moore:
gpio-0 ( |tx-disable ) in lo gpio-1 ( |mod-def0 ) in hi IRQ ACTIVE LOW gpio-2 ( |los ) in hi IRQ gpio-12 ( |cd ) in lo IRQ ACTIVE LOW gpio-13 ( |reset ) in hi IRQ ACTIVE LOW gpio-14 ( |WPS ) in hi IRQ ACTIVE LOW gpio-21 ( |tx-disable ) in lo gpio-63 ( |? ) out hi gpio-69 ( |mod-def0 ) in hi IRQ ACTIVE LOW gpio-70 ( |los ) in hi IRQ gpio-79 ( |? ) out lo gpio-82 ( |PHY reset ) out hi ACTIVE LOW gpio-83 ( |PHY reset ) out hi ACTIVE LOW
after the change:
root@bpi-r4:~# cat /sys/kernel/debug/gpio gpiochip0: 84 GPIOs, parent: platform/1001f000.pinctrl, pinctrl_moore: gpio-0 ( |tx-disable ) in lo gpio-1 ( |mod-def0 ) in hi IRQ ACTIVE LOW gpio-2 ( |los ) in hi IRQ gpio-12 ( |cd ) in lo IRQ ACTIVE LOW gpio-13 ( |reset ) in hi IRQ ACTIVE LOW gpio-14 ( |WPS ) in hi IRQ ACTIVE LOW gpio-21 ( |tx-disable ) in lo gpio-63 ( |pcie3-cn14-hog ) out hi gpio-69 ( |mod-def0 ) in hi IRQ ACTIVE LOW gpio-70 ( |los ) in hi IRQ gpio-79 ( |pcie2-cn15-hog ) out lo gpio-82 ( |PHY reset ) out hi ACTIVE LOW gpio-83 ( |PHY reset ) out hi ACTIVE LOW
[1] https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git/commit/?id=d54a489c8c4b627775445d54a6cbd32f209bda8f
"gpiolib: use of_node_name if line-name is missing"
--- .../boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro-cn13.dtso | 1 + .../boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro-cn14.dtso | 1 + .../boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro-cn15.dtso | 1 + .../boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro-cn18.dtso | 1 + 4 files changed, 4 insertions(+)
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro-cn13.dtso +1 -0
@@ -16,5 +16,6 @@ / { }; &{/soc/pinctrl@1001f000/pcie-2-hog} { + line-name = "pcie2-cn13-hog"; output-high; };
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro-cn14.dtso +1 -0
@@ -16,5 +16,6 @@ / { }; &{/soc/pinctrl@1001f000/pcie-3-hog} { + line-name = "pcie3-cn14-hog"; output-high; };
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro-cn15.dtso +1 -0
@@ -16,5 +16,6 @@ / { }; &{/soc/pinctrl@1001f000/pcie-2-hog} { + line-name = "pcie2-cn15-hog"; output-low; };
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro-cn18.dtso +1 -0
@@ -16,5 +16,6 @@ / { }; &{/soc/pinctrl@1001f000/pcie-3-hog} { + line-name = "pcie3-cn18-hog"; output-low; };
Signature · 1 line
2.53.0
Re: [PATCH 2/2] arm64: dts: mediatek: mt7988a-bpi-r4pro: label gpio-hogs
Quoted 41 lines · Frank Wunderlich
From: Frank Wunderlich <[email protected]>
GPIO hogs were tagged with name "?" in recent kernel versions (7.1+) due to commit
d1d564ec4992("gpio: move hogs into GPIO core").7.0 showed the unit-name which behaviour is restored by patch [1], but labeling the hog directly makes things easier.
gpiochip0: 84 GPIOs, parent: platform/1001f000.pinctrl,
pinctrl_moore:gpio-0 ( |tx-disable ) in lo gpio-1 ( |mod-def0 ) in hi IRQ ACTIVE LOW gpio-2 ( |los ) in hi IRQ gpio-12 ( |cd ) in lo IRQ ACTIVE LOW gpio-13 ( |reset ) in hi IRQ ACTIVE LOW gpio-14 ( |WPS ) in hi IRQ ACTIVE LOW gpio-21 ( |tx-disable ) in lo gpio-63 ( |? ) out hi gpio-69 ( |mod-def0 ) in hi IRQ ACTIVE LOW gpio-70 ( |los ) in hi IRQ gpio-79 ( |? ) out lo gpio-82 ( |PHY reset ) out hi ACTIVE LOW gpio-83 ( |PHY reset ) out hi ACTIVE LOWafter the change:
root@bpi-r4:~# cat /sys/kernel/debug/gpio gpiochip0: 84 GPIOs, parent: platform/1001f000.pinctrl, pinctrl_moore: gpio-0 ( |tx-disable ) in lo gpio-1 ( |mod-def0 ) in hi IRQ ACTIVE LOW gpio-2 ( |los ) in hi IRQ gpio-12 ( |cd ) in lo IRQ ACTIVE LOW gpio-13 ( |reset ) in hi IRQ ACTIVE LOW gpio-14 ( |WPS ) in hi IRQ ACTIVE LOW gpio-21 ( |tx-disable ) in lo gpio-63 ( |pcie3-cn14-hog ) out hi gpio-69 ( |mod-def0 ) in hi IRQ ACTIVE LOW gpio-70 ( |los ) in hi IRQ gpio-79 ( |pcie2-cn15-hog ) out lo gpio-82 ( |PHY reset ) out hi ACTIVE LOW gpio-83 ( |PHY reset ) out hi ACTIVE LOW
Quoted 5 lines
[1] https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git/commit/?id=d54a489c8c4b627775445d54a6cbd32f209bda8f
"gpiolib: useof_node_nameif line-name is missing"Fixes d1d564ec4992 ("gpio: move hogs into GPIO core")Signed-off-by Frank Wunderlich <[email protected]>
It's always good to use line-names on boards for tinkering makerspaces prototyping etc.
Yours,
Linus Walleij
Quoted 11 lines · Frank Wunderlich
From: Frank Wunderlich <[email protected]>
This Series adds line-names for i2c-gpio adapter and pcie hogs for easier debugging via
/sys/kernel/debug/gpio.Frank Wunderlich (2):
arm64: dts: mediatek: mt7988a-bpi-r4pro: add names for i2c-to-gpio
chip
arm64: dts: mediatek: mt7988a-bpi-r4pro: label gpio-hogs[...]
Applied to v7.3-next/dts64, thanks!
[1/2] arm64: dts: mediatek: mt7988a-bpi-r4pro: add names for i2c-to-gpio chip
commit: ee3f4a1785bd73a865a4aa5e1974c6079f96b2bc
[2/2] arm64: dts: mediatek: mt7988a-bpi-r4pro: label gpio-hogs
commit: bf89276b2db391cbb25d1a0e898280fe85b16fb5Cheers,
Angelo