Skip to contentSkip to conversation

include: dt-bindings: Add GPIO pin index definition for rockchip pinctrl

PATCH New Andy Yan 2 participants 4 messages Sep 7, 2016 – Oct 21, 2016

Subsystems (3)
lore
Share & tools
lore

Andy Yan

author
#0 lore raw

PATCH 1/2 include: dt-bindings: Add GPIO pin index definition for rockchip pinctrl

Add gpio pin index definition to make it easier to describe GPIO in dts.

---

Changes in v1:
- remove gpio bank definition RK_GPIO7/8
- redefine GPIO PIN as RK_PA/B/C/Dx

 include/dt-bindings/pinctrl/rockchip.h | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
include/dt-bindings/pinctrl/rockchip.h +33 -0
index 743e66a..aaec8ba 100644
@@ -25,6 +25,39 @@
 #define RK_GPIO4	4
 #define RK_GPIO6	6
 
+#define RK_PA0		0
+#define RK_PA1		1
+#define RK_PA2		2
+#define RK_PA3		3
+#define RK_PA4		4
+#define RK_PA5		5
+#define RK_PA6		6
+#define RK_PA7		7
+#define RK_PB0		8
+#define RK_PB1		9
+#define RK_PB2		10
+#define RK_PB3		11
+#define RK_PB4		12
+#define RK_PB5		13
+#define RK_PB6		14
+#define RK_PB7		15
+#define RK_PC0		16
+#define RK_PC1		17
+#define RK_PC2		18
+#define RK_PC3		19
+#define RK_PC4		20
+#define RK_PC5		21
+#define RK_PC6		22
+#define RK_PC7		23
+#define RK_PD0		24
+#define RK_PD1		25
+#define RK_PD2		26
+#define RK_PD3		27
+#define RK_PD4		28
+#define RK_PD5		29
+#define RK_PD6		30
+#define RK_PD7		31
+
 #define RK_FUNC_GPIO	0
 #define RK_FUNC_1	1
 #define RK_FUNC_2	2
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH 2/2 ARM: dts: use definition in rockchip pinctrl header to describe gpios on Popmetal-RK3288

Use definition in rockchip pinctrl header to describe gpios, this will make it more clear.

---

Changes in v1:
- use new GPIO pin definition

 arch/arm/boot/dts/rk3288-popmetal.dts | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)
arch/arm/boot/dts/rk3288-popmetal.dts +12 -12
index f8c6f01..953e2ed 100644
@@ -72,7 +72,7 @@
 		pinctrl-0 = <&pwrbtn>;
 
 		power {
-			gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
+			gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
 			linux,code = <KEY_POWER>;
 			label = "GPIO Key Power";
 			linux,input-type = <1>;
@@ -83,7 +83,7 @@
 
 	ir: ir-receiver {
 		compatible = "gpio-ir-receiver";
-		gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
+		gpios = <&gpio0 RK_PA6 GPIO_ACTIVE_LOW>;
 		pinctrl-names = "default";
 		pinctrl-0 = <&ir_int>;
 	};
@@ -98,7 +98,7 @@
 
 	vcc_sd: sdmmc-regulator {
 		compatible = "regulator-fixed";
-		gpio = <&gpio7 11 GPIO_ACTIVE_LOW>;
+		gpio = <&gpio7 RK_PB3 GPIO_ACTIVE_LOW>;
 		pinctrl-names = "default";
 		pinctrl-0 = <&sdmmc_pwr>;
 		regulator-name = "vcc_sd";
@@ -132,7 +132,7 @@
 	vcc28_dvp: vcc28-dvp-regulator {
 		compatible = "regulator-fixed";
 		enable-active-high;
-		gpio = <&gpio0 17 GPIO_ACTIVE_HIGH>;
+		gpio = <&gpio0 RK_PC1 GPIO_ACTIVE_HIGH>;
 		pinctrl-names = "default";
 		pinctrl-0 = <&dvp_pwr>;
 		regulator-name = "vcc28_dvp";
@@ -178,7 +178,7 @@
 	phy-supply = <&vcc_lan>;
 	phy-mode = "rgmii";
 	clock_in_out = "input";
-	snps,reset-gpio = <&gpio4 7 0>;
+	snps,reset-gpio = <&gpio4 RK_PB0 0>;
 	snps,reset-active-low;
 	snps,reset-delays-us = <0 10000 1000000>;
 	assigned-clocks = <&cru SCLK_MAC>;
@@ -447,43 +447,43 @@
 &pinctrl {
 	ak8963 {
 		comp_int: comp-int {
-			rockchip,pins = <8 1 RK_FUNC_GPIO &pcfg_pull_up>;
+			rockchip,pins = <8 RK_PA1 RK_FUNC_GPIO &pcfg_pull_up>;
 		};
 	};
 
 	buttons {
 		pwrbtn: pwrbtn {
-			rockchip,pins = <0 5 RK_FUNC_GPIO &pcfg_pull_up>;
+			rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>;
 		};
 	};
 
 	dvp {
 		dvp_pwr: dvp-pwr {
-			rockchip,pins = <0 17 RK_FUNC_GPIO &pcfg_pull_none>;
+			rockchip,pins = <0 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>;
 		};
 	};
 
 	ir {
 		ir_int: ir-int {
-			rockchip,pins = <0 6 RK_FUNC_GPIO &pcfg_pull_up>;
+			rockchip,pins = <0 RK_PA6 RK_FUNC_GPIO &pcfg_pull_up>;
 		};
 	};
 
 	mma8452 {
 		gsensor_int: gsensor-int {
-			rockchip,pins = <8 0 RK_FUNC_GPIO &pcfg_pull_up>;
+			rockchip,pins = <8 RK_PA0 RK_FUNC_GPIO &pcfg_pull_up>;
 		};
 	};
 
 	pmic {
 		pmic_int: pmic-int {
-			rockchip,pins = <RK_GPIO0 4 RK_FUNC_GPIO &pcfg_pull_up>;
+			rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_up>;
 		};
 	};
 
 	sdmmc {
 		sdmmc_pwr: sdmmc-pwr {
-			rockchip,pins = <7 11 RK_FUNC_GPIO &pcfg_pull_none>;
+			rockchip,pins = <7 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>;
 		};
 	};
 };
Signature · 1 line
2.7.4
maintainer
#2 lore raw

PATCH 1/2 include: dt-bindings: Add GPIO pin index definition for rockchip pinctrl

In reply to Andy Yan

Am Mittwoch, 7. September 2016, 09:00:53 CEST schrieb Andy Yan:

Quoted 4 lines

Add gpio pin index definition to make it easier to describe GPIO in dts.

just as a heads up, as I didn't respond yet:

Looks good and I'll take them, I just want to wait for the merge-window to close (should be the coming sunday), to be able to put the header change in a shared branch for the case that other users appear during the 4.10 cycle.

Heiko

Quoted 53 lines

---

Changes in v1:
- remove gpio bank definition RK_GPIO7/8
- redefine GPIO PIN as RK_PA/B/C/Dx

 include/dt-bindings/pinctrl/rockchip.h | 33

+++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+)

(quoted diff) +0 -0

b/include/dt-bindings/pinctrl/rockchip.h index 743e66a..aaec8ba 100644

include/dt-bindings/pinctrl/rockchip.h +33 -0
@@ -25,6 +25,39 @@
 #define RK_GPIO4	4
 #define RK_GPIO6	6
 
+#define RK_PA0		0
+#define RK_PA1		1
+#define RK_PA2		2
+#define RK_PA3		3
+#define RK_PA4		4
+#define RK_PA5		5
+#define RK_PA6		6
+#define RK_PA7		7
+#define RK_PB0		8
+#define RK_PB1		9
+#define RK_PB2		10
+#define RK_PB3		11
+#define RK_PB4		12
+#define RK_PB5		13
+#define RK_PB6		14
+#define RK_PB7		15
+#define RK_PC0		16
+#define RK_PC1		17
+#define RK_PC2		18
+#define RK_PC3		19
+#define RK_PC4		20
+#define RK_PC5		21
+#define RK_PC6		22
+#define RK_PC7		23
+#define RK_PD0		24
+#define RK_PD1		25
+#define RK_PD2		26
+#define RK_PD3		27
+#define RK_PD4		28
+#define RK_PD5		29
+#define RK_PD6		30
+#define RK_PD7		31
+
 #define RK_FUNC_GPIO	0
 #define RK_FUNC_1	1
 #define RK_FUNC_2	2
maintainer
#3 lore raw

PATCH 1/2 include: dt-bindings: Add GPIO pin index definition for rockchip pinctrl

Am Mittwoch, 12. Oktober 2016, 00:00:12 CEST schrieb Heiko Stuebner:

Quoted 11 lines

Am Mittwoch, 7. September 2016, 09:00:53 CEST schrieb Andy Yan:

Quoted 4 lines

Add gpio pin index definition to make it easier to describe GPIO in dts.

just as a heads up, as I didn't respond yet:

Looks good and I'll take them, I just want to wait for the merge-window to close (should be the coming sunday), to be able to put the header change in a shared branch for the case that other users appear during the 4.10 cycle.

I've now applied both patches for 4.10

Thanks
Heiko