hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/drivers/input/touchscreen/gt1x/gt1x_generic.c
....@@ -243,7 +243,7 @@
243243 gt1x_update_firmware(arg1);
244244 return count;
245245 }
246
-
246
+#if 0 //close for GKI
247247 if (strcmp(mode_str, "sendconfig") == 0) {
248248 cfg_len = gt1x_parse_config(arg1, temp_config);
249249 if (cfg_len < 0) {
....@@ -252,7 +252,7 @@
252252 gt1x_send_cfg(temp_config, gt1x_cfg_length);
253253 return count;
254254 }
255
-
255
+#endif
256256 if (strcmp(mode_str, "debug_gesture") == 0) {
257257 #if GTP_GESTURE_WAKEUP
258258 gt1x_gesture_debug(!!mode);
....@@ -266,7 +266,7 @@
266266 }
267267 #endif
268268
269
-static u8 ascii2hex(u8 a)
269
+static u8 __maybe_unused ascii2hex(u8 a)
270270 {
271271 s8 value = 0;
272272 if (a >= '0' && a <= '9') {
....@@ -281,6 +281,7 @@
281281 return value;
282282 }
283283
284
+#if 0 //close for GKI
284285 int gt1x_parse_config(char *filename, u8 *config)
285286 {
286287 mm_segment_t old_fs;
....@@ -357,6 +358,7 @@
357358
358359 return cur_len;
359360 }
361
+#endif
360362
361363 s32 _do_i2c_read(struct i2c_msg *msgs, u16 addr, u8 *buffer, s32 len)
362364 {
....@@ -661,10 +663,12 @@
661663
662664 void gt1x_select_addr(void)
663665 {
664
- GTP_GPIO_OUTPUT(GTP_RST_PORT, 0);
666
+ if (gpio_is_valid(gt1x_rst_gpio))
667
+ GTP_GPIO_OUTPUT(GTP_RST_PORT, 0);
665668 GTP_GPIO_OUTPUT(GTP_INT_PORT, gt1x_i2c_client->addr == 0x14);
666669 usleep_range(2000, 3000);
667
- GTP_GPIO_OUTPUT(GTP_RST_PORT, 1);
670
+ if (gpio_is_valid(gt1x_rst_gpio))
671
+ GTP_GPIO_OUTPUT(GTP_RST_PORT, 1);
668672 usleep_range(2000, 3000);
669673 }
670674
....@@ -2398,6 +2402,8 @@
23982402 #if GTP_WITH_STYLUS
23992403 gt1x_pen_init();
24002404 #endif
2405
+ if (ret != 0)
2406
+ gt1x_power_switch(SWITCH_OFF);
24012407
24022408 return ret;
24032409 }