From 9620f4d40622fe6521fbd31249e2c48fa1fa929f Mon Sep 17 00:00:00 2001 From: luowei Date: Fri, 11 Jul 2014 17:10:21 +0800 Subject: [PATCH] pinctrl:delete unused definition for rk3036 --- arch/arm/boot/dts/rk3036-pinctrl.dtsi | 199 +++++++++++++------------ drivers/pinctrl/pinctrl-rockchip.c | 33 +++- include/dt-bindings/pinctrl/rockchip.h | 6 + 3 files changed, 138 insertions(+), 100 deletions(-) diff --git a/arch/arm/boot/dts/rk3036-pinctrl.dtsi b/arch/arm/boot/dts/rk3036-pinctrl.dtsi index d60816c4e41b..9e2a4d5f03d1 100755 --- a/arch/arm/boot/dts/rk3036-pinctrl.dtsi +++ b/arch/arm/boot/dts/rk3036-pinctrl.dtsi @@ -83,29 +83,29 @@ uart0_xfer: uart0-xfer { rockchip,pins = , ; - rockchip,pull = ; - //rockchip,drive = ; + rockchip,pull = ; + }; uart0_cts: uart0-cts { rockchip,pins = ; - rockchip,pull = ; - //rockchip,drive = ; + rockchip,pull = ; + }; uart0_rts: uart0-rts { rockchip,pins = ; - rockchip,pull = ; - //rockchip,drive = ; + rockchip,pull = ; + }; uart0_rts_gpio: uart0-rts-gpio { rockchip,pins = ; - rockchip,pull = ; - //rockchip,drive = ; + rockchip,pull = ; + }; }; @@ -113,8 +113,8 @@ uart1_xfer: uart1-xfer { rockchip,pins = , ; - rockchip,pull = ; - //rockchip,drive = ; + rockchip,pull = ; + }; @@ -124,8 +124,8 @@ uart2_xfer: uart2-xfer { rockchip,pins = , ; - rockchip,pull = ; - //rockchip,drive = ; + rockchip,pull = ; + }; /* no rts / cts for uart2 */ @@ -135,101 +135,101 @@ gpio0_i2c0 { i2c0_sda:i2c0-sda { rockchip,pins = ; - rockchip,pull = ; - //rockchip,drive = ; + rockchip,pull = ; + }; i2c0_scl:i2c0-scl { rockchip,pins = ; - rockchip,pull = ; - //rockchip,drive = ; + rockchip,pull = ; + }; i2c0_gpio: i2c0-gpio { rockchip,pins = , ; - rockchip,pull = ; - //rockchip,drive = ; + rockchip,pull = ; + }; }; gpio0_i2c1 { i2c1_sda:i2c1-sda { rockchip,pins = ; - rockchip,pull = ; - //rockchip,drive = ; + rockchip,pull = ; + }; i2c1_scl:i2c1-scl { rockchip,pins = ; - rockchip,pull = ; - //rockchip,drive = ; + rockchip,pull = ; + }; i2c1_gpio: i2c1-gpio { rockchip,pins = , ; - //rockchip,drive = ; + }; }; gpio2_i2c2 { i2c2_sda:i2c2-sda { rockchip,pins = ; - rockchip,pull = ; - //rockchip,drive = ; + rockchip,pull = ; + }; i2c2_scl:i2c2-scl { rockchip,pins = ; - rockchip,pull = ; - //rockchip,drive = ; + rockchip,pull = ; + }; i2c2_gpio: i2c2-gpio { rockchip,pins = , ; - rockchip,pull = ; - //rockchip,drive = ; + rockchip,pull = ; + }; }; gpio1_spi0 { spi0_txd:spi0-txd { rockchip,pins = ; - rockchip,pull = ; - //rockchip,drive = ; + rockchip,pull = ; + }; spi0_rxd:spi0-rxd { rockchip,pins = ; - rockchip,pull = ; - //rockchip,drive = ; + rockchip,pull = ; + }; spi0_clk:spi0-clk { rockchip,pins = ; - rockchip,pull = ; - //rockchip,drive = ; + rockchip,pull = ; + }; spi0_cs0:spi0-cs0 { rockchip,pins = ; - rockchip,pull = ; - //rockchip,drive = ; + rockchip,pull = ; + }; spi0_cs1:spi0-cs1 { rockchip,pins = ; - rockchip,pull = ; - //rockchip,drive = ; + rockchip,pull = ; + }; @@ -238,70 +238,71 @@ gpio1_hdmi { hdmi_cec:hdmi-cec { rockchip,pins = ; - rockchip,pull = ; - //rockchip,drive = ; + rockchip,pull = ; + //rockchip,drive = ; }; hdmi_sda:hdmi-sda { rockchip,pins = ; - rockchip,pull = ; - //rockchip,drive = ; + rockchip,pull = ; + //rockchip,drive = ; }; hdmi_scl:hdmi-scl { rockchip,pins = ; - rockchip,pull = ; - //rockchip,drive = ; + rockchip,pull = ; + //rockchip,drive = ; }; hdmi_hpd:hdmi-hpd { rockchip,pins = ; - rockchip,pull = ; - //rockchip,drive = ; + rockchip,pull = ; + //rockchip,drive = ; + }; hdmi_gpio: hdmi-gpio { rockchip,pins = , , , ; - rockchip,pull = ; - //rockchip,drive = ; + rockchip,pull = ; + //rockchip,drive = ; }; }; gpio1_i2s0 { i2s0_mclk:i2s0-mclk { rockchip,pins = ; - rockchip,pull = ; - //rockchip,drive = ; + rockchip,pull = ; + }; i2s0_sclk:i2s0-sclk { rockchip,pins = ; - rockchip,pull = ; - //rockchip,drive = ; + rockchip,pull = ; + }; i2s0_lrckrx:i2s0-lrckrx { rockchip,pins = ; - rockchip,pull = ; - //rockchip,drive = ; + rockchip,pull = ; + }; i2s0_lrcktx:i2s0-lrcktx { rockchip,pins = ; - rockchip,pull = ; - //rockchip,drive = ; + rockchip,pull = ; + }; i2s0_sdo:i2s0-sdo { rockchip,pins = ; - rockchip,pull = ; - //rockchip,drive = ; + rockchip,pull = ; + }; i2s0_sdi:i2s0-sdi { rockchip,pins = ; - rockchip,pull = ; - //rockchip,drive = ; + rockchip,pull = ; + }; i2s0_gpio: i2s0-gpio { @@ -311,31 +312,31 @@ , , ; - rockchip,pull = ; - //rockchip,drive = ; + rockchip,pull = ; + }; }; gpio1_spdif { spdif_tx: spdif-tx { rockchip,pins = ; - rockchip,pull = ; - //rockchip,drive = ; + rockchip,pull = ; + }; }; gpio1_emmc0 { emmc0_clk: emmc0-clk { rockchip,pins = ; - rockchip,pull = ; - //rockchip,drive = ; + rockchip,pull = ; + }; emmc0_cmd: emmc0-cmd { rockchip,pins = ; rockchip,pull = ; - //rockchip,drive = ; + }; @@ -343,7 +344,7 @@ emmc0_bus1: emmc0-bus-width1 { rockchip,pins = ; rockchip,pull = ; - //rockchip,drive = ; + }; @@ -353,7 +354,7 @@ , ; rockchip,pull = ; - //rockchip,drive = ; + }; }; @@ -361,21 +362,21 @@ gpio1_sdmmc0 { sdmmc0_clk: sdmmc0-clk { rockchip,pins = ; - rockchip,pull = ; - //rockchip,drive = ; + rockchip,pull = ; + }; sdmmc0_cmd: sdmmc0-cmd { rockchip,pins = ; rockchip,pull = ; - //rockchip,drive = ; + }; sdmmc0_dectn: sdmmc0-dectn{ rockchip,pins = ; rockchip,pull = ; - //rockchip,drive = ; + }; @@ -383,7 +384,7 @@ sdmmc0_bus1: sdmmc0-bus-width1 { rockchip,pins = ; rockchip,pull = ; - //rockchip,drive = ; + }; @@ -393,7 +394,7 @@ , ; rockchip,pull = ; - //rockchip,drive = ; + }; @@ -407,7 +408,7 @@ , //D2 ; //D3 rockchip,pull = ; - //rockchip,drive = ; + }; @@ -416,22 +417,22 @@ gpio0_sdio0 { sdio0_clk: sdio0_clk { rockchip,pins = ; - rockchip,pull = ; - //rockchip,drive = ; + rockchip,pull = ; + }; sdio0_cmd: sdio0_cmd { rockchip,pins = ; rockchip,pull = ; - //rockchip,drive = ; + }; sdio0_bus1: sdio0-bus-width1 { rockchip,pins = ; rockchip,pull = ; - //rockchip,drive = ; + }; @@ -441,7 +442,7 @@ , ; rockchip,pull = ; - //rockchip,drive = ; + }; @@ -454,7 +455,7 @@ , //D2 ; //D3 rockchip,pull = ; - //rockchip,drive = ; + }; }; @@ -462,29 +463,29 @@ gpio0_pwm{ pwm0_pin:pwm0 { rockchip,pins = ; - rockchip,pull = ; - //rockchip,drive = ; + rockchip,pull = ; + }; pwm1_pin:pwm1 { rockchip,pins = ; - rockchip,pull = ; - //rockchip,drive = ; + rockchip,pull = ; + }; pwm2_pin:pwm2 { rockchip,pins = ; - rockchip,pull = ; - //rockchip,drive = ; + rockchip,pull = ; + }; pwm3_pin:pwm3 { rockchip,pins = ; - rockchip,pull = ; - //rockchip,drive = ; + rockchip,pull = ; + }; }; @@ -492,29 +493,29 @@ gpio2_gmac { mac_txpins: mac-txpins { rockchip,pins = , , ; - rockchip,pull = ; - //rockchip,drive = ; + rockchip,pull = ; + }; mac_rxpins: mac-rxpins { rockchip,pins = , ,; - rockchip,pull = ; - //rockchip,drive = ; + rockchip,pull = ; + }; mac_crs: mac-crs { rockchip,pins = ; - rockchip,pull = ; - //rockchip,drive = ; + rockchip,pull = ; + }; mac_mdpins: mac-mdpins { rockchip,pins = , ; - rockchip,pull = ; - //rockchip,drive = ; + rockchip,pull = ; + }; }; diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c index 8a059b8c9498..95f59c08601e 100755 --- a/drivers/pinctrl/pinctrl-rockchip.c +++ b/drivers/pinctrl/pinctrl-rockchip.c @@ -1305,6 +1305,8 @@ static int rockchip_set_pull(struct rockchip_pin_bank *bank, data = BIT(bit + 16); if (pull == PIN_CONFIG_BIAS_DISABLE) data |= BIT(bit); + + if(pull != PIN_CONFIG_BIAS_PULL_PIN_DEFAULT) writel(data, reg); spin_unlock_irqrestore(&bank->slock, flags); @@ -1708,7 +1710,34 @@ static int _rockchip_pinconf_set(struct rockchip_pin_bank *bank, break; case RK3036: - //to do + + switch(config_type) + { + case TYPE_DRV_REG: + + if((bank->bank_num == 1) && (pin_num >= 0) && (pin_num <= 3)) + { + bit = pin_num*2 + 4; + reg = info->reg_drv; + spin_lock_irqsave(&bank->slock, flags); + + data = arg << bit; + data &= (3<slock, flags); + } + else + { + printk("%s:RK3036 GPIO%d-%d could not support driver setting\n",__func__, bank->bank_num, pin_num); + } + break; + default: + break; + + } + break; default: @@ -2033,6 +2062,8 @@ static int rockchip_pinctrl_parse_groups(struct device_node *np, pull = PIN_CONFIG_BIAS_PULL_DOWN; else if (val == 3) pull = PIN_CONFIG_BIAS_BUS_HOLD; + else if (val == 4) + pull = PIN_CONFIG_BIAS_PULL_PIN_DEFAULT; pinconfig[j++] = pinconf_to_config_packed(pull, val); } diff --git a/include/dt-bindings/pinctrl/rockchip.h b/include/dt-bindings/pinctrl/rockchip.h index 8735f39407bf..fe3fd3526c97 100755 --- a/include/dt-bindings/pinctrl/rockchip.h +++ b/include/dt-bindings/pinctrl/rockchip.h @@ -89,6 +89,12 @@ #define VALUE_PULL_DOWN 2 #define VALUE_PULL_KEEP 3 #define VALUE_PULL_DISABLE 4 //don't set and keep pull default +#define VALUE_PULL_DEFAULT 4 //don't set and keep pull default + + +//for rk2928,rk3036 +#define VALUE_PULL_UPDOWN_DISABLE 0 +#define VALUE_PULL_UPDOWN_ENABLE 1 #define VALUE_VOL_DEFAULT 0 #define VALUE_VOL_3V3 0 -- 2.34.1