hc
2023-02-15 812ded0d8d6800728c4c11abed7546d735449123
kernel/drivers/misc/nkio/nk_io_core.c
....@@ -139,27 +139,6 @@
139139 }
140140
141141
142
- //usb_en_oc_gpio
143
- 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
-
163142 //hub_host2_5V_rest_gpio
164143 ret = of_get_named_gpio_flags(node, "hub_host2_5V_rest_gpio", 0, &flags);
165144 if (ret < 0) {
....@@ -292,7 +271,57 @@
292271 }
293272 }
294273
274
+ //hp_en_gpio
275
+ 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;
295280
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_gpio
292
+ 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_gpio
310
+ 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
+ }
296325 //air_mode_4g_gpio
297326 ret = of_get_named_gpio_flags(node, "air_mode_4g_gpio", 0, &flags);
298327 if (ret < 0) {