hc
2023-10-16 def2367077573b56f9fc4f824e5c0377a3a4175a
修改DO2-DO4初始为低
2 files modified
10 ■■■■ changed files
kernel/arch/arm64/boot/dts/rockchip/NK-R36S0.dtsi 3 ●●●● patch | view | raw | blame | history
kernel/drivers/gpio/gpiolib-sysfs.c 7 ●●●● patch | view | raw | blame | history
kernel/arch/arm64/boot/dts/rockchip/NK-R36S0.dtsi
....@@ -145,7 +145,7 @@
145145 gpio_num = <&gpio3 RK_PC6 GPIO_ACTIVE_HIGH>; //WIFI_PWREN_GPIO3_C6_1V8
146146 gpio_function = <0>;
147147 };
148
-
148
+ #if 0
149149 do1 {
150150 gpio_num = <&gpio1 RK_PD0 GPIO_ACTIVE_LOW>;
151151 gpio_function = <0>;
....@@ -185,6 +185,7 @@
185185 gpio_num = <&gpio2 RK_PD5 GPIO_ACTIVE_HIGH>;
186186 gpio_function = <1>;
187187 };
188
+ #endif
188189 };
189190 #if 0
190191 nk_io_init {
kernel/drivers/gpio/gpiolib-sysfs.c
....@@ -80,13 +80,18 @@
8080 struct gpiod_data *data = dev_get_drvdata(dev);
8181 struct gpio_desc *desc = data->desc;
8282 ssize_t status;
83
+ int offset;
8384
8485 mutex_lock(&data->mutex);
8586
87
+ offset = gpio_chip_hwgpio(desc);
8688 if (sysfs_streq(buf, "high"))
8789 status = gpiod_direction_output_raw(desc, 1);
8890 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
+ else
94
+ status = gpiod_direction_output_raw(desc, 0);
9095 else if (sysfs_streq(buf, "in"))
9196 status = gpiod_direction_input(desc);
9297 else