GT9XX.h
//***************************PART1:ON/OFF define*******************************
#define GTP_CUSTOM_CFG 0#define GTP_CHANGE_X2Y 1 //swap x y
+ #define GTP_REVERSE_X 1 //REVERSE x
+ #define GTP_REVERSE_Y 0 //REVERSE Y
#define GTP_DRIVER_SEND_CFG 0 //driver send config
#define GTP_HAVE_TOUCH_KEY 0
#define GTP_POWER_CTRL_SLEEP 0 //power off when suspend
gt9xx.c
static void gtp_touch_down(struct goodix_ts_data* ts, s32 id, s32 x, s32 y, s32 w)
{
#if GTP_CHANGE_X2Y
GTP_SWAP(x, y);
#endif
//+++++++++++++++++++++++++++++++++++++++++++++
#if GTP_REVERSE_X
x = ts->abs_x_max-x;
#endif
#if GTP_REVERSE_Y
y = ts->abs_y_max-y;
#endif
//+++++++++++++++++++++++++++++++++++++++++++++
#if GTP_ICS_SLOT_REPORT
input_mt_slot(ts->input_dev, id);
input_mt_report_slot_state(ts->input_dev, MT_TOOL_FINGER, true);
input_report_abs(ts->input_dev, ABS_MT_POSITION_X, x);
input_report_abs(ts->input_dev, ABS_MT_POSITION_Y, y);
input_report_abs(ts->input_dev, ABS_MT_TOUCH_MAJOR, w);
input_report_abs(ts->input_dev, ABS_MT_WIDTH_MAJOR, w);
#else
input_report_key(ts->input_dev, BTN_TOUCH, 1);
input_report_abs(ts->input_dev, ABS_MT_POSITION_X, x);
input_report_abs(ts->input_dev, ABS_MT_POSITION_Y, y);
input_report_abs(ts->input_dev, ABS_MT_TOUCH_MAJOR, w);
input_report_abs(ts->input_dev, ABS_MT_WIDTH_MAJOR, w);
input_report_abs(ts->input_dev, ABS_MT_TRACKING_ID, id);
input_mt_sync(ts->input_dev);
#endif
GTP_DEBUG("ID:%d, X:%d, Y:%d, W:%d", id, x, y, w);
}
回贴