kernel/arch/arm64/boot/dts/rockchip/NK-R36S0.dtsi | ●●●●● patch | view | raw | blame | history | |
kernel/arch/arm64/boot/dts/rockchip/rk3568-evb.dtsi | ●●●●● patch | view | raw | blame | history | |
kernel/drivers/misc/nkio/nk_io_core.c | ●●●●● patch | view | raw | blame | history | |
kernel/drivers/misc/nkio/nkio.h | ●●●●● patch | view | raw | blame | history |
kernel/arch/arm64/boot/dts/rockchip/NK-R36S0.dtsi
.. .. @@ -17,7 +17,7 @@ 17 17 18 18 rk_headset: rk-headset { 19 19 compatible = "rockchip_headset"; 20 - headset_gpio = <&gpio3 RK_PC2 GPIO_ACTIVE_LOW>;20 + headset_gpio = <&gpio0 RK_PD5 GPIO_ACTIVE_LOW>;21 21 pinctrl-names = "default"; 22 22 pinctrl-0 = <&hp_det>; 23 23 }; .. .. @@ -32,15 +32,6 @@ 32 32 vin-supply = <&vcc3v3_sys>; 33 33 }; 34 34 35 - vcc3v3_vga: vcc3v3-vga {36 - compatible = "regulator-fixed";37 - regulator-name = "vcc3v3_vga";38 - regulator-always-on;39 - regulator-boot-on;40 - gpio = <&gpio0 RK_PD5 GPIO_ACTIVE_HIGH>;41 - enable-active-high;42 - vin-supply = <&vcc3v3_sys>;43 - };44 35 45 36 pcie30_avdd0v9: pcie30-avdd0v9 { 46 37 compatible = "regulator-fixed"; .. .. @@ -97,7 +88,7 @@ 97 88 98 89 nk_io_init { 99 90 compatible = "nk_io_control"; 100 - usb_en_oc_gpio = <&gpio0 RK_PA5 GPIO_ACTIVE_HIGH>; //USB_EN_OC_GPIO0_A591 +// usb_en_oc_gpio = <&gpio0 RK_PA5 GPIO_ACTIVE_HIGH>; //USB_EN_OC_GPIO0_A5101 92 lcd_bk_en_gpio = <&gpio0 RK_PB0 GPIO_ACTIVE_HIGH>; //LCD0_BKLT_EN_3V3 102 93 lcd_pwblk_gpio = <&gpio0 RK_PB7 GPIO_ACTIVE_HIGH>; //LCD0_BKLT_EN_3V3 103 94 vcc3_io_en_gpio = <&gpio0 RK_PC4 GPIO_ACTIVE_HIGH>; //VCC3_IO_EN_GPIO0_C4_3V3 .. .. @@ -110,12 +101,14 @@ 110 101 reset_4g_gpio = <&gpio1 RK_PB2 GPIO_ACTIVE_HIGH>; //4G_RST_GPIO01_B2_3V3 111 102 air_mode_4g_gpio = <&gpio1 RK_PB0 GPIO_ACTIVE_HIGH>; //4G_AIR_MODE_GPIO01_B0_3V3 112 103 wake_4g_gpio = <&gpio1 RK_PB1 GPIO_ACTIVE_HIGH>; //4G_WAKEUP_GPIO01_B1_3V3 113 -104 + hp_en_gpio = <&gpio3 RK_PA6 GPIO_ACTIVE_HIGH>;//HP_EN_GPIO3_A6_3V3105 + spk_out_gpio = <&gpio4 RK_PC2 GPIO_ACTIVE_HIGH>;//AMP_SD_GPIO4_C2_3V3106 +114 107 edp_enable_gpio = <&gpio0 RK_PC4 GPIO_ACTIVE_HIGH>; 115 - edp_gpio0 = <&gpio3 RK_PD2 GPIO_ACTIVE_LOW>; //7511_GPIO0-GPIO3_D2116 - edp_gpio1 = <&gpio3 RK_PD3 GPIO_ACTIVE_LOW>; //7511_GPIO1-GPIO3_D3117 - edp_gpio2 = <&gpio3 RK_PD4 GPIO_ACTIVE_LOW>; //7511_GPIO2-GPIO3_D4118 - edp_gpio3 = <&gpio3 RK_PD5 GPIO_ACTIVE_LOW>; //7511_GPIO3-GPIO3_D5108 + edp_gpio0 = <&gpio3 RK_PD2 GPIO_ACTIVE_HIGH>; //7511_GPIO0-GPIO3_D2109 + edp_gpio1 = <&gpio3 RK_PD3 GPIO_ACTIVE_HIGH>; //7511_GPIO1-GPIO3_D3110 + edp_gpio2 = <&gpio3 RK_PD4 GPIO_ACTIVE_HIGH>; //7511_GPIO2-GPIO3_D4111 + edp_gpio3 = <&gpio3 RK_PD5 GPIO_ACTIVE_HIGH>; //7511_GPIO3-GPIO3_D5119 112 edp_reset = <&gpio3 RK_PD1 GPIO_ACTIVE_LOW>; //7511_RST_GPIO3_D1 120 113 // tp_reset = <&gpio3 RK_PA7 GPIO_ACTIVE_HIGH>; 121 114 // vddio_mipi = <&gpio1 RK_PA4 GPIO_ACTIVE_HIGH>; .. .. @@ -434,7 +427,7 @@ 434 427 // }; 435 428 headphone { 436 429 hp_det: hp-det { 437 - rockchip,pins = <3 RK_PC2 RK_FUNC_GPIO &pcfg_pull_down>;430 + rockchip,pins = <0 RK_PD5 RK_FUNC_GPIO &pcfg_pull_down>;438 431 }; 439 432 }; 440 433 .. .. @@ -451,7 +444,24 @@ 451 444 }; 452 445 nk_io_init{ 453 446 nk_io_gpio: nk-io-gpio{ 454 - rockchip,pins = <0 RK_PC6 RK_FUNC_GPIO &pcfg_pull_up>;447 + rockchip,pins = <0 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>,448 + <0 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>,449 + <0 RK_PC4 RK_FUNC_GPIO &pcfg_pull_none>,450 + <4 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>,451 + <4 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>,452 + <1 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>,453 + <0 RK_PC7 RK_FUNC_GPIO &pcfg_pull_none>,454 + <1 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>,455 + <1 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>,456 + <1 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>,457 + <3 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>,458 + <4 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>,459 + <3 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>,460 + <3 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>,461 + <3 RK_PD4 RK_FUNC_GPIO &pcfg_pull_none>,462 + <3 RK_PD5 RK_FUNC_GPIO &pcfg_pull_none>,463 + <3 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>,464 + <0 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>;455 465 }; 456 466 }; 457 467 }; kernel/arch/arm64/boot/dts/rockchip/rk3568-evb.dtsi
.. .. @@ -273,6 +273,8 @@ 273 273 vcc5v0_otg: vcc5v0-otg-regulator { 274 274 compatible = "regulator-fixed"; 275 275 regulator-name = "vcc5v0_otg"; 276 + egulator-boot-on;277 + regulator-always-on;276 278 regulator-min-microvolt = <5000000>; 277 279 regulator-max-microvolt = <5000000>; 278 280 enable-active-high; kernel/drivers/misc/nkio/nk_io_core.c
.. .. @@ -139,27 +139,6 @@ 139 139 } 140 140 141 141 142 - //usb_en_oc_gpio143 - ret = of_get_named_gpio_flags(node, "usb_en_oc_gpio", 0, &flags);144 - if (ret < 0) {145 - printk("%s() Can not read property usb_en_oc_gpio\n", __FUNCTION__);146 - goto err;147 - } else {148 - pdata->usb_en_oc_gpio = ret;149 - gpio_free(ret);150 - ret = devm_gpio_request(&pdev->dev, pdata->usb_en_oc_gpio, "usb_en_oc_gpio");151 - if (ret < 0){152 - printk("%s() devm_gpio_request usb_en_oc_gpio request ERROR\n", __FUNCTION__);153 - goto err;154 - }155 -156 - ret = gpio_direction_output(pdata->usb_en_oc_gpio,1);157 - if(ret < 0){158 - printk("%s() gpio_direction_input usb_en_oc_gpio set ERROR\n", __FUNCTION__);159 - goto err;160 - }161 - }162 -163 142 //hub_host2_5V_rest_gpio 164 143 ret = of_get_named_gpio_flags(node, "hub_host2_5V_rest_gpio", 0, &flags); 165 144 if (ret < 0) { .. .. @@ -292,7 +271,57 @@ 292 271 } 293 272 } 294 273 274 + //hp_en_gpio275 + ret = of_get_named_gpio_flags(node, "hp_en_gpio", 0, &flags);276 + if (ret < 0) {277 + printk("%s() Can not read property hp_en_gpio\n", __FUNCTION__);278 + } else {279 + pdata->hp_en_gpio = ret;295 280 281 + ret = devm_gpio_request(&pdev->dev, pdata->hp_en_gpio, "hp_en_gpio");282 + if(ret < 0){283 + printk("%s() devm_gpio_request hp_en_gpio request ERROR\n", __FUNCTION__);284 + }285 + ret = gpio_direction_output(pdata->hp_en_gpio,1);286 + if(ret < 0){287 + printk("%s() gpio_direction_output hp_en_gpio set ERROR\n", __FUNCTION__);288 + }289 + }290 +291 + //wifi_power_en_gpio292 + ret = of_get_named_gpio_flags(node, "wifi_power_en_gpio", 0, &flags);293 + if (ret < 0) {294 + printk("%s() Can not read property wifi_power_en_gpio\n", __FUNCTION__);295 + } else {296 + pdata->wifi_power_en_gpio = ret;297 +298 + ret = devm_gpio_request(&pdev->dev, pdata->wifi_power_en_gpio, "wifi_power_en_gpio");299 + if(ret < 0){300 + printk("%s() devm_gpio_request wifi_power_en_gpio request ERROR\n", __FUNCTION__);301 + }302 + ret = gpio_direction_output(pdata->wifi_power_en_gpio,1);303 + if(ret < 0){304 + printk("%s() gpio_direction_output wifi_power_en_gpio set ERROR\n", __FUNCTION__);305 + }306 + }307 +308 +309 + //spk_out_gpio310 + ret = of_get_named_gpio_flags(node, "spk_out_gpio", 0, &flags);311 + if (ret < 0) {312 + printk("%s() Can not read property spk_out_gpio\n", __FUNCTION__);313 + } else {314 + pdata->spk_out_gpio = ret;315 +316 + ret = devm_gpio_request(&pdev->dev, pdata->spk_out_gpio, "spk_out_gpio");317 + if(ret < 0){318 + printk("%s() devm_gpio_request spk_out_gpio request ERROR\n", __FUNCTION__);319 + }320 + ret = gpio_direction_output(pdata->spk_out_gpio,0);321 + if(ret < 0){322 + printk("%s() gpio_direction_output spk_out_gpio set ERROR\n", __FUNCTION__);323 + }324 + }296 325 //air_mode_4g_gpio 297 326 ret = of_get_named_gpio_flags(node, "air_mode_4g_gpio", 0, &flags); 298 327 if (ret < 0) { kernel/drivers/misc/nkio/nkio.h
.. .. @@ -7,8 +7,8 @@ 7 7 unsigned int vcc_3_3v_io; 8 8 unsigned int vcc_12v_io; 9 9 unsigned int usb_5v_gpio; 10 - //unsigned int hub_5V_rest_gpio;11 - //unsigned int hub_5V_gpio;10 + unsigned int wifi_power_en_gpio;11 + unsigned int hp_en_gpio;12 12 unsigned int led_gpio; 13 13 unsigned int mic_switch_gpio; 14 14 unsigned int audio_switch_gpio; .. .. @@ -27,7 +27,7 @@ 27 27 unsigned int hub_host3_5v_gpio; 28 28 unsigned int edp_power_supply_gpio; 29 29 unsigned int edp_enable_gpio; 30 - unsigned int tp_enable;30 + unsigned int spk_out_gpio;31 31 unsigned int vddio_mipi; 32 32 // unsigned int tp_reset; 33 33 };