Bulk convert rk3128 DT gpios to their constant counterparts.

sed -i -f script.sed rk3128.dtsi
sed -i -f script.sed rk3128-evb.dts

================================

/rockchip,pins *=/bcheck
b # to end of script
:append-next-line
N
:check
/^[^;]*$/bappend-next-line
s/<RK_GPIO\([0-9]\) /<\1 /g
s/<\([^ ][^ ]*  *\)0 /<\1RK_PA0 /g
s/<\([^ ][^ ]*  *\)1 /<\1RK_PA1 /g
s/<\([^ ][^ ]*  *\)2 /<\1RK_PA2 /g
s/<\([^ ][^ ]*  *\)3 /<\1RK_PA3 /g
s/<\([^ ][^ ]*  *\)4 /<\1RK_PA4 /g
s/<\([^ ][^ ]*  *\)5 /<\1RK_PA5 /g
s/<\([^ ][^ ]*  *\)6 /<\1RK_PA6 /g
s/<\([^ ][^ ]*  *\)7 /<\1RK_PA7 /g
s/<\([^ ][^ ]*  *\)8 /<\1RK_PB0 /g
s/<\([^ ][^ ]*  *\)9 /<\1RK_PB1 /g
s/<\([^ ][^ ]*  *\)10 /<\1RK_PB2 /g
s/<\([^ ][^ ]*  *\)11 /<\1RK_PB3 /g
s/<\([^ ][^ ]*  *\)12 /<\1RK_PB4 /g
s/<\([^ ][^ ]*  *\)13 /<\1RK_PB5 /g
s/<\([^ ][^ ]*  *\)14 /<\1RK_PB6 /g
s/<\([^ ][^ ]*  *\)15 /<\1RK_PB7 /g
s/<\([^ ][^ ]*  *\)16 /<\1RK_PC0 /g
s/<\([^ ][^ ]*  *\)17 /<\1RK_PC1 /g
s/<\([^ ][^ ]*  *\)18 /<\1RK_PC2 /g
s/<\([^ ][^ ]*  *\)19 /<\1RK_PC3 /g
s/<\([^ ][^ ]*  *\)20 /<\1RK_PC4 /g
s/<\([^ ][^ ]*  *\)21 /<\1RK_PC5 /g
s/<\([^ ][^ ]*  *\)22 /<\1RK_PC6 /g
s/<\([^ ][^ ]*  *\)23 /<\1RK_PC7 /g
s/<\([^ ][^ ]*  *\)24 /<\1RK_PD0 /g
s/<\([^ ][^ ]*  *\)25 /<\1RK_PD1 /g
s/<\([^ ][^ ]*  *\)26 /<\1RK_PD2 /g
s/<\([^ ][^ ]*  *\)27 /<\1RK_PD3 /g
s/<\([^ ][^ ]*  *\)28 /<\1RK_PD4 /g
s/<\([^ ][^ ]*  *\)29 /<\1RK_PD5 /g
s/<\([^ ][^ ]*  *\)30 /<\1RK_PD6 /g
s/<\([^ ][^ ]*  *\)31 /<\1RK_PD7 /g
s/<\([^ ][^ ]*  *[^ ][^ ]*  *\)0 /<\1RK_FUNC_GPIO /g
s/<\([^ ][^ ]*  *[^ ][^ ]*  *\)RK_FUNC_\([1-9]\) /<\1\2 /g

Signed-off-by: Johan Jonker <jbx6...@gmail.com>
---
 arch/arm/dts/rk3128-evb.dts |  4 +-
 arch/arm/dts/rk3128.dtsi    | 86 ++++++++++++++++++-------------------
 2 files changed, 45 insertions(+), 45 deletions(-)

diff --git a/arch/arm/dts/rk3128-evb.dts b/arch/arm/dts/rk3128-evb.dts
index 2fb2b0da..a407ac2d 100644
--- a/arch/arm/dts/rk3128-evb.dts
+++ b/arch/arm/dts/rk3128-evb.dts
@@ -82,13 +82,13 @@
 &pinctrl {
        usb_otg {
                otg_vbus_drv: host-vbus-drv {
-                       rockchip,pins = <0 26 RK_FUNC_GPIO &pcfg_pull_none>;
+                       rockchip,pins = <0 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;
                };
        };
 
        usb_host {
                host_vbus_drv: host-vbus-drv {
-                       rockchip,pins = <2 23 RK_FUNC_GPIO &pcfg_pull_none>;
+                       rockchip,pins = <2 RK_PC7 RK_FUNC_GPIO &pcfg_pull_none>;
                };
        };
 };
diff --git a/arch/arm/dts/rk3128.dtsi b/arch/arm/dts/rk3128.dtsi
index 5d2499c1..62fd5343 100644
--- a/arch/arm/dts/rk3128.dtsi
+++ b/arch/arm/dts/rk3128.dtsi
@@ -618,85 +618,85 @@
                         */
 
                        emmc_clk: emmc-clk {
-                               rockchip,pins = <2 7 RK_FUNC_2 &pcfg_pull_none>;
+                               rockchip,pins = <2 RK_PA7 2 &pcfg_pull_none>;
                        };
 
                        emmc_cmd: emmc-cmd {
-                               rockchip,pins = <2 4 RK_FUNC_2 &pcfg_pull_none>;
+                               rockchip,pins = <2 RK_PA4 2 &pcfg_pull_none>;
                        };
 
                        emmc_pwren: emmc-pwren {
-                               rockchip,pins = <2 5 RK_FUNC_2 &pcfg_pull_none>;
+                               rockchip,pins = <2 RK_PA5 2 &pcfg_pull_none>;
                        };
 
                        emmc_bus8: emmc-bus8 {
-                               rockchip,pins = <1 24 RK_FUNC_2 
&pcfg_pull_none>,
-                                               <1 25 RK_FUNC_2 
&pcfg_pull_none>,
-                                               <1 26 RK_FUNC_2 
&pcfg_pull_none>,
-                                               <1 27 RK_FUNC_2 
&pcfg_pull_none>,
-                                               <1 28 RK_FUNC_2 
&pcfg_pull_none>,
-                                               <1 29 RK_FUNC_2 
&pcfg_pull_none>,
-                                               <1 30 RK_FUNC_2 
&pcfg_pull_none>,
-                                               <1 31 RK_FUNC_2 
&pcfg_pull_none>;
+                               rockchip,pins = <1 RK_PD0 2 &pcfg_pull_none>,
+                                               <1 RK_PD1 2 &pcfg_pull_none>,
+                                               <1 RK_PD2 2 &pcfg_pull_none>,
+                                               <1 RK_PD3 2 &pcfg_pull_none>,
+                                               <1 RK_PD4 2 &pcfg_pull_none>,
+                                               <1 RK_PD5 2 &pcfg_pull_none>,
+                                               <1 RK_PD6 2 &pcfg_pull_none>,
+                                               <1 RK_PD7 2 &pcfg_pull_none>;
                        };
                };
 
                nandc{
                        nandc_ale:nandc-ale {
-                               rockchip,pins = <0 18 RK_FUNC_1 
&pcfg_pull_none>;
+                               rockchip,pins = <0 RK_PC2 1 &pcfg_pull_none>;
                        };
 
                        nandc_cle:nandc-cle {
-                               rockchip,pins = <0 18 RK_FUNC_1 
&pcfg_pull_none>;
+                               rockchip,pins = <0 RK_PC2 1 &pcfg_pull_none>;
                        };
 
                        nandc_wrn:nandc-wrn {
-                               rockchip,pins = <0 18 RK_FUNC_1 
&pcfg_pull_none>;
+                               rockchip,pins = <0 RK_PC2 1 &pcfg_pull_none>;
                        };
 
                        nandc_rdn:nandc-rdn {
-                               rockchip,pins = <0 18 RK_FUNC_1 
&pcfg_pull_none>;
+                               rockchip,pins = <0 RK_PC2 1 &pcfg_pull_none>;
                        };
 
                        nandc_rdy:nandc-rdy {
-                               rockchip,pins = <0 18 RK_FUNC_1 
&pcfg_pull_none>;
+                               rockchip,pins = <0 RK_PC2 1 &pcfg_pull_none>;
                        };
 
                        nandc_cs0:nandc-cs0 {
-                               rockchip,pins = <0 18 RK_FUNC_1 
&pcfg_pull_none>;
+                               rockchip,pins = <0 RK_PC2 1 &pcfg_pull_none>;
                        };
 
                        nandc_data: nandc-data {
-                               rockchip,pins = <0 18 RK_FUNC_1 
&pcfg_pull_none>;
+                               rockchip,pins = <0 RK_PC2 1 &pcfg_pull_none>;
                        };
                };
 
                uart0 {
                        uart0_xfer: uart0-xfer {
-                               rockchip,pins = <0 16 RK_FUNC_1 
&pcfg_pull_none>,
-                                               <0 17 RK_FUNC_1 
&pcfg_pull_none>;
+                               rockchip,pins = <0 RK_PC0 1 &pcfg_pull_none>,
+                                               <0 RK_PC1 1 &pcfg_pull_none>;
                        };
 
                        uart0_cts: uart0-cts {
-                               rockchip,pins = <0 18 RK_FUNC_1 
&pcfg_pull_none>;
+                               rockchip,pins = <0 RK_PC2 1 &pcfg_pull_none>;
                        };
 
                        uart0_rts: uart0-rts {
-                               rockchip,pins = <0 19 RK_FUNC_1 
&pcfg_pull_none>;
+                               rockchip,pins = <0 RK_PC3 1 &pcfg_pull_none>;
                        };
                };
 
                uart1 {
                        uart1_xfer: uart1-xfer {
-                               rockchip,pins = <2 22 RK_FUNC_1 
&pcfg_pull_none>,
-                                               <2 23 RK_FUNC_1 
&pcfg_pull_none>;
+                               rockchip,pins = <2 RK_PC6 1 &pcfg_pull_none>,
+                                               <2 RK_PC7 1 &pcfg_pull_none>;
                        };
                };
 
                uart2 {
                        uart2_xfer: uart2-xfer {
-                               rockchip,pins = <1 18 RK_FUNC_2 
&pcfg_pull_none>,
-                               <1 19 RK_FUNC_2 &pcfg_pull_none>;
+                               rockchip,pins = <1 RK_PC2 2 &pcfg_pull_none>,
+                                               <1 RK_PC3 2 &pcfg_pull_none>;
                        };
                };
 
@@ -727,75 +727,75 @@
 
                pwm0 {
                        pwm0_pin: pwm0-pin {
-                               rockchip,pins = <0 0 RK_FUNC_2 &pcfg_pull_none>;
+                               rockchip,pins = <0 RK_PA0 2 &pcfg_pull_none>;
                        };
                };
 
                pwm1 {
                        pwm1_pin: pwm1-pin {
-                               rockchip,pins = <0 1 RK_FUNC_2 &pcfg_pull_none>;
+                               rockchip,pins = <0 RK_PA1 2 &pcfg_pull_none>;
                        };
                };
 
                pwm2 {
                        pwm2_pin: pwm2-pin {
-                               rockchip,pins = <0 1 2 &pcfg_pull_none>;
+                               rockchip,pins = <0 RK_PA1 2 &pcfg_pull_none>;
                        };
                };
 
                pwm3 {
                        pwm3_pin: pwm3-pin {
-                               rockchip,pins = <0 27 1 &pcfg_pull_none>;
+                               rockchip,pins = <0 RK_PD3 1 &pcfg_pull_none>;
                        };
                };
 
                i2c0 {
                        i2c0_xfer: i2c0-xfer {
-                               rockchip,pins = <0 0 RK_FUNC_1 &pcfg_pull_none>,
-                                               <0 1 RK_FUNC_1 &pcfg_pull_none>;
+                               rockchip,pins = <0 RK_PA0 1 &pcfg_pull_none>,
+                                               <0 RK_PA1 1 &pcfg_pull_none>;
                        };
                };
 
                i2c1 {
                        i2c1_xfer: i2c1-xfer {
-                               rockchip,pins = <0 2 RK_FUNC_1 &pcfg_pull_none>,
-                                               <0 3 RK_FUNC_1 &pcfg_pull_none>;
+                               rockchip,pins = <0 RK_PA2 1 &pcfg_pull_none>,
+                                               <0 RK_PA3 1 &pcfg_pull_none>;
                        };
                };
 
                i2c2 {
                        i2c2_xfer: i2c2-xfer {
-                               rockchip,pins = <2 20 3 &pcfg_pull_none>,
-                                               <2 21 3 &pcfg_pull_none>;
+                               rockchip,pins = <2 RK_PC4 3 &pcfg_pull_none>,
+                                               <2 RK_PC5 3 &pcfg_pull_none>;
                        };
                };
 
                i2c3 {
                        i2c3_xfer: i2c3-xfer {
-                               rockchip,pins = <0 6 RK_FUNC_1 &pcfg_pull_none>,
-                                               <0 7 RK_FUNC_1 &pcfg_pull_none>;
+                               rockchip,pins = <0 RK_PA6 1 &pcfg_pull_none>,
+                                               <0 RK_PA7 1 &pcfg_pull_none>;
                        };
                };
 
                spi0 {
                        spi0_txd_mux0:spi0-txd-mux0 {
-                               rockchip,pins = <2 4 RK_FUNC_2 &pcfg_pull_none>;
+                               rockchip,pins = <2 RK_PA4 2 &pcfg_pull_none>;
                        };
 
                        spi0_rxd_mux0:spi0-rxd-mux0 {
-                               rockchip,pins = <2 4 RK_FUNC_2 &pcfg_pull_none>;
+                               rockchip,pins = <2 RK_PA4 2 &pcfg_pull_none>;
                        };
 
                        spi0_clk_mux0:spi0-clk-mux0 {
-                               rockchip,pins = <2 4 RK_FUNC_2 &pcfg_pull_none>;
+                               rockchip,pins = <2 RK_PA4 2 &pcfg_pull_none>;
                        };
 
                        spi0_cs0_mux0:spi0-cs0-mux0 {
-                               rockchip,pins = <2 4 RK_FUNC_2 &pcfg_pull_none>;
+                               rockchip,pins = <2 RK_PA4 2 &pcfg_pull_none>;
                        };
 
                        spi0_cs1_mux0:spi0-cs1-mux0 {
-                               rockchip,pins = <2 4 RK_FUNC_2 &pcfg_pull_none>;
+                               rockchip,pins = <2 RK_PA4 2 &pcfg_pull_none>;
                        };
                };
 
-- 
2.20.1

Reply via email to