@@ -452,68 +452,67 @@ static int gsx_gesture_ist(struct goodix_ts_core *core_data,
452452 ts_debug("udfps_enabled= %d aod_status=%d", core_data->udfps_enabled, core_data->aod_status);
453453 ts_debug("sleep_finger: %d", !core_data->sleep_finger);*/
454454
455- if (core_data -> udfps_enabled || core_data -> aod_status ) {
456- if (( FP_Event_Gesture == 1 ) && ( temp_data [2 ] == 0x46 ) ) {
457-
458- x = temp_data [4 ] | (temp_data [5 ] << 8 );
459- y = temp_data [6 ] | (temp_data [7 ] << 8 );
460- overlapping_area = temp_data [8 ];
461- area = temp_data [9 ];
462-
463- core_data -> udfps_pressed = 1 ;
464- sysfs_notify (& core_data -> pdev -> dev .kobj , NULL , "udfps_pressed" );
465- input_mt_slot (core_data -> input_dev , 0 );
466- input_mt_report_slot_state (core_data -> input_dev , MT_TOOL_FINGER , true);
467- input_report_key (core_data -> input_dev , BTN_INFO , 1 );
468- /*input_report_key(core_data->input_dev, KEY_INFO, 1);*/
469- input_report_key (core_data -> input_dev , BTN_TOUCH , 1 );
470- input_report_key (core_data -> input_dev , BTN_TOOL_FINGER , 1 );
471- input_report_abs (core_data -> input_dev , ABS_MT_TOOL_TYPE , MT_TOOL_FINGER );
472- input_report_abs (core_data -> input_dev , ABS_MT_POSITION_X , x );
473- input_report_abs (core_data -> input_dev , ABS_MT_POSITION_Y , y );
474- input_report_abs (core_data -> input_dev , ABS_MT_WIDTH_MINOR , overlapping_area );
475- /*input_report_abs(core_data->input_dev, ABS_MT_TOUCH_MINOR, area);*/
476-
477- core_data -> fod_pressed = true;
478- __set_bit (0 , & core_data -> touch_id );
479-
480-
481- ts_debug ( "Gesture report, x=%d , y=%d , overlapping_area=%d , area=%d" ,
482- x , y , overlapping_area , area );
483-
484- /*wait for report key event*/
485- FP_Event_Gesture = 0 ;
486- input_sync ( core_data -> input_dev ) ;
487- }
488-
489- if (( FP_Event_Gesture == 1 ) && ( temp_data [ 2 ] == 0x4c )) {
490- /*wait for report key event*/
491- FP_Event_Gesture = 0 ;
492- input_report_key (core_data -> input_dev , KEY_GOTO , 1 );
493- input_sync (core_data -> input_dev );
494- input_report_key (core_data -> input_dev , KEY_GOTO , 0 );
495- input_sync ( core_data -> input_dev ) ;
496- core_data -> sleep_finger = 0 ;
497- ts_debug ( "Gesture report L" ) ;
498- }
499-
500- if (( FP_Event_Gesture == 1 ) && ( temp_data [ 2 ] == 0xff ) ) {
501- if ( core_data -> fod_pressed ) {
502- ts_debug ( "Gesture report up" );
503- input_mt_slot (core_data -> input_dev , 0 );
504- input_mt_report_slot_state (core_data -> input_dev , MT_TOOL_FINGER , false );
505- input_report_abs (core_data -> input_dev , ABS_MT_WIDTH_MINOR , 0 );
506- input_report_key (core_data -> input_dev , BTN_INFO , 0 );
507- /* input_report_key(core_data->input_dev, KEY_INFO , 0);*/
508- input_report_key (core_data -> input_dev , BTN_TOUCH , 0 );
509- input_report_key (core_data -> input_dev , BTN_TOOL_FINGER , 0 );
510- input_sync ( core_data -> input_dev );
511- __clear_bit ( 0 , & core_data -> touch_id ) ;
512- core_data -> fod_pressed = false;
513- }
514- core_data -> sleep_finger = 0 ;
455+ if (( core_data -> udfps_enabled || core_data -> aod_status ) && FP_Event_Gesture ) {
456+ switch ( temp_data [2 ]) {
457+ case 0x46 :
458+ x = temp_data [4 ] | (temp_data [5 ] << 8 );
459+ y = temp_data [6 ] | (temp_data [7 ] << 8 );
460+ overlapping_area = temp_data [8 ];
461+ area = temp_data [9 ];
462+
463+ core_data -> udfps_pressed = 1 ;
464+ sysfs_notify (& core_data -> pdev -> dev .kobj , NULL , "udfps_pressed" );
465+ input_mt_slot (core_data -> input_dev , 0 );
466+ input_mt_report_slot_state (core_data -> input_dev , MT_TOOL_FINGER , true);
467+ input_report_key (core_data -> input_dev , BTN_INFO , 1 );
468+ /*input_report_key(core_data->input_dev, KEY_INFO, 1);*/
469+ input_report_key (core_data -> input_dev , BTN_TOUCH , 1 );
470+ input_report_key (core_data -> input_dev , BTN_TOOL_FINGER , 1 );
471+ input_report_abs (core_data -> input_dev , ABS_MT_TOOL_TYPE , MT_TOOL_FINGER );
472+ input_report_abs (core_data -> input_dev , ABS_MT_POSITION_X , x );
473+ input_report_abs (core_data -> input_dev , ABS_MT_POSITION_Y , y );
474+ input_report_abs (core_data -> input_dev , ABS_MT_WIDTH_MINOR , overlapping_area );
475+ /*input_report_abs(core_data->input_dev, ABS_MT_TOUCH_MINOR, area);*/
476+
477+ core_data -> fod_pressed = true;
478+ __set_bit (0 , & core_data -> touch_id );
479+
480+ ts_debug ( "Gesture report, x=%d, y=%d, overlapping_area=%d, area=%d" ,
481+ x , y , overlapping_area , area );
482+
483+ /*wait for report key event*/
484+ FP_Event_Gesture = 0 ;
485+ input_sync ( core_data -> input_dev ) ;
486+ break ;
487+
488+ case 0x4c :
489+ /*wait for report key event*/
490+ FP_Event_Gesture = 0 ;
491+ input_report_key ( core_data -> input_dev , KEY_GOTO , 1 ) ;
492+ input_sync (core_data -> input_dev );
493+ input_report_key (core_data -> input_dev , KEY_GOTO , 0 );
494+ input_sync (core_data -> input_dev );
495+ core_data -> sleep_finger = 0 ;
496+ ts_debug ( "Gesture report L" ) ;
497+ break ;
498+
499+ case 0xff :
500+ if (core_data -> fod_pressed ) {
501+ ts_debug ( "Gesture report up" );
502+ input_mt_slot ( core_data -> input_dev , 0 );
503+ input_mt_report_slot_state (core_data -> input_dev , MT_TOOL_FINGER , false );
504+ input_report_abs (core_data -> input_dev , ABS_MT_WIDTH_MINOR , 0 );
505+ input_report_key (core_data -> input_dev , BTN_INFO , 0 );
506+ /* input_report_key(core_data->input_dev, KEY_INFO , 0);*/
507+ input_report_key (core_data -> input_dev , BTN_TOUCH , 0 );
508+ input_report_key (core_data -> input_dev , BTN_TOOL_FINGER , 0 );
509+ input_sync (core_data -> input_dev );
510+ __clear_bit ( 0 , & core_data -> touch_id );
511+ core_data -> fod_pressed = false ;
512+ }
513+ core_data -> sleep_finger = 0 ;
514+ break ;
515515 }
516-
517516 write_lock (& gsx_gesture -> rwlock );
518517 memcpy (gsx_gesture -> gesture_data , temp_data , sizeof (temp_data ));
519518 write_unlock (& gsx_gesture -> rwlock );
0 commit comments