kernel/arch/arm64/boot/dts/rockchip/NK-R36S0.dtsi | ●●●●● patch | view | raw | blame | history | |
kernel/drivers/gpio/gpiolib-sysfs.c | ●●●●● patch | view | raw | blame | history |
kernel/arch/arm64/boot/dts/rockchip/NK-R36S0.dtsi
.. .. @@ -145,7 +145,7 @@ 145 145 gpio_num = <&gpio3 RK_PC6 GPIO_ACTIVE_HIGH>; //WIFI_PWREN_GPIO3_C6_1V8 146 146 gpio_function = <0>; 147 147 }; 148 -148 + #if 0149 149 do1 { 150 150 gpio_num = <&gpio1 RK_PD0 GPIO_ACTIVE_LOW>; 151 151 gpio_function = <0>; .. .. @@ -185,6 +185,7 @@ 185 185 gpio_num = <&gpio2 RK_PD5 GPIO_ACTIVE_HIGH>; 186 186 gpio_function = <1>; 187 187 }; 188 + #endif188 189 }; 189 190 #if 0 190 191 nk_io_init { kernel/drivers/gpio/gpiolib-sysfs.c
.. .. @@ -80,13 +80,18 @@ 80 80 struct gpiod_data *data = dev_get_drvdata(dev); 81 81 struct gpio_desc *desc = data->desc; 82 82 ssize_t status; 83 + int offset;83 84 84 85 mutex_lock(&data->mutex); 85 86 87 + offset = gpio_chip_hwgpio(desc);86 88 if (sysfs_streq(buf, "high")) 87 89 status = gpiod_direction_output_raw(desc, 1); 88 90 else if (sysfs_streq(buf, "out") || sysfs_streq(buf, "low")) 89 - status = gpiod_direction_output_raw(desc, 0);91 + if (( offset == 26 ) || ( offset == 25 ) || ( offset == 27 ))92 + status = gpiod_direction_output_raw(desc, 1);93 + else94 + status = gpiod_direction_output_raw(desc, 0);90 95 else if (sysfs_streq(buf, "in")) 91 96 status = gpiod_direction_input(desc); 92 97 else