| .. | .. |
|---|
| 243 | 243 | gt1x_update_firmware(arg1); |
|---|
| 244 | 244 | return count; |
|---|
| 245 | 245 | } |
|---|
| 246 | | - |
|---|
| 246 | +#if 0 //close for GKI |
|---|
| 247 | 247 | if (strcmp(mode_str, "sendconfig") == 0) { |
|---|
| 248 | 248 | cfg_len = gt1x_parse_config(arg1, temp_config); |
|---|
| 249 | 249 | if (cfg_len < 0) { |
|---|
| .. | .. |
|---|
| 252 | 252 | gt1x_send_cfg(temp_config, gt1x_cfg_length); |
|---|
| 253 | 253 | return count; |
|---|
| 254 | 254 | } |
|---|
| 255 | | - |
|---|
| 255 | +#endif |
|---|
| 256 | 256 | if (strcmp(mode_str, "debug_gesture") == 0) { |
|---|
| 257 | 257 | #if GTP_GESTURE_WAKEUP |
|---|
| 258 | 258 | gt1x_gesture_debug(!!mode); |
|---|
| .. | .. |
|---|
| 266 | 266 | } |
|---|
| 267 | 267 | #endif |
|---|
| 268 | 268 | |
|---|
| 269 | | -static u8 ascii2hex(u8 a) |
|---|
| 269 | +static u8 __maybe_unused ascii2hex(u8 a) |
|---|
| 270 | 270 | { |
|---|
| 271 | 271 | s8 value = 0; |
|---|
| 272 | 272 | if (a >= '0' && a <= '9') { |
|---|
| .. | .. |
|---|
| 281 | 281 | return value; |
|---|
| 282 | 282 | } |
|---|
| 283 | 283 | |
|---|
| 284 | +#if 0 //close for GKI |
|---|
| 284 | 285 | int gt1x_parse_config(char *filename, u8 *config) |
|---|
| 285 | 286 | { |
|---|
| 286 | 287 | mm_segment_t old_fs; |
|---|
| .. | .. |
|---|
| 357 | 358 | |
|---|
| 358 | 359 | return cur_len; |
|---|
| 359 | 360 | } |
|---|
| 361 | +#endif |
|---|
| 360 | 362 | |
|---|
| 361 | 363 | s32 _do_i2c_read(struct i2c_msg *msgs, u16 addr, u8 *buffer, s32 len) |
|---|
| 362 | 364 | { |
|---|
| .. | .. |
|---|
| 661 | 663 | |
|---|
| 662 | 664 | void gt1x_select_addr(void) |
|---|
| 663 | 665 | { |
|---|
| 664 | | - GTP_GPIO_OUTPUT(GTP_RST_PORT, 0); |
|---|
| 666 | + if (gpio_is_valid(gt1x_rst_gpio)) |
|---|
| 667 | + GTP_GPIO_OUTPUT(GTP_RST_PORT, 0); |
|---|
| 665 | 668 | GTP_GPIO_OUTPUT(GTP_INT_PORT, gt1x_i2c_client->addr == 0x14); |
|---|
| 666 | 669 | 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); |
|---|
| 668 | 672 | usleep_range(2000, 3000); |
|---|
| 669 | 673 | } |
|---|
| 670 | 674 | |
|---|
| .. | .. |
|---|
| 2398 | 2402 | #if GTP_WITH_STYLUS |
|---|
| 2399 | 2403 | gt1x_pen_init(); |
|---|
| 2400 | 2404 | #endif |
|---|
| 2405 | + if (ret != 0) |
|---|
| 2406 | + gt1x_power_switch(SWITCH_OFF); |
|---|
| 2401 | 2407 | |
|---|
| 2402 | 2408 | return ret; |
|---|
| 2403 | 2409 | } |
|---|