Skip to contentSkip to conversation

Add gpio labels for R4Pro

PATCH Applied Frank Wunderlich 3 participants 6 messages Sep 18 – Sep 30

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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
#1 lore raw

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
index 1eeb72108b9b..f54787fbbc71 100644
@@ -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
#3 lore raw

PATCH 2/2 arm64: dts: mediatek: mt7988a-bpi-r4pro: label gpio-hogs

In reply to 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 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"

Fixes d1d564ec4992 ("gpio: move hogs into GPIO core")
---
 .../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
index 973b76ba0cbf..e9c322df15fc 100644
@@ -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
index 90b2a64459c3..9d8de737ca40 100644
@@ -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
index 9750916042de..57ee7dacdd78 100644
@@ -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
index 9830fb0fd97a..7830980ac95a 100644
@@ -16,5 +16,6 @@ / {
 };
 
 &{/soc/pinctrl@1001f000/pcie-3-hog} {
+	line-name = "pcie3-cn18-hog";
 	output-low;
 };
Signature · 1 line
2.53.0
Reviewed-by on v1 2/2
#4 lore raw

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 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
Quoted 5 lines

[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"

Fixes d1d564ec4992 ("gpio: move hogs into GPIO core")

It's always good to use line-names on boards for tinkering makerspaces prototyping etc.

Yours,
Linus Walleij

maintainer Applied
#5 lore raw
In reply to Frank Wunderlich
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: bf89276b2db391cbb25d1a0e898280fe85b16fb5

Cheers,
Angelo