/**************************** touch down / up *******************************/ static void tpd_down(int cx, int cy, int cd, int cp, int *px, int *py) { tpd_lpfx[tpd_lpfc]=cx; tpd_lpfy[tpd_lpfc]=cy; tpd_lpfc=(tpd_lpfc+4)%5; #ifdef TPD_HAVE_TREMBLE_ELIMINATION /*tremble elimination */ if(( (*px-cx)*(*px-cx)+(*py-cy)*(*py-cy)) < 17) cx=*px,cy=*py; else *px = cx, *py = cy; #endif //TPD_DEBUG("[DOWN] [x%4d y%4d d%1d p%6d)",cx, cy, cd, cp); #ifdef TPD_HAVE_BUTTON if(cy>=TPD_BUTTON_HEIGHT) { if(buf.count<5) tpd_button(cx,cy,1); return; } if(cy<TPD_BUTTON_HEIGHT && tpd->btn_state && cp<TPD_PRESSURE_MAX) tpd_button(cx,cy,0); #endif cp=(255*(TPD_PRESSURE_MAX-cp))/(TPD_PRESSURE_MAX-TPD_PRESSURE_MIN); do { input_report_abs(tpd->dev, ABS_X, cx); input_report_abs(tpd->dev, ABS_Y, cy); input_report_abs(tpd->dev, ABS_PRESSURE, cp); input_report_key(tpd->dev, BTN_TOUCH, 1); } while(0); input_sync(tpd->dev); buf.effective++; buf.last = buf.count+1; TPD_DEBUG_PRINT_DOWN; TPD_EM_PRINT(raw_x, raw_y, cx, cy, (raw_z1 << 16 | raw_z2), 1); //printk("f[%5d %5d %5d]", cx, cy, cp); }
void tpd_up(int raw_x, int raw_y, int x, int y, int p) { //input_report_abs(tpd->dev, ABS_PRESSURE, 0); input_report_key(tpd->dev, BTN_TOUCH, 0); //input_report_abs(tpd->dev, ABS_MT_TOUCH_MAJOR, 0); //input_report_abs(tpd->dev, ABS_MT_WIDTH_MAJOR, 0); //input_report_abs(tpd->dev, ABS_MT_POSITION_X, x); //input_report_abs(tpd->dev, ABS_MT_POSITION_Y, y); input_mt_sync(tpd->dev); TPD_DEBUG("U[%4d %4d %4d]\n", x, y, 0); TPD_EM_PRINT(raw_x, raw_y, x, y, p, 0); }
void tpd_down(int raw_x, int raw_y, int x, int y, int p) { input_report_abs(tpd->dev, ABS_PRESSURE, 128); input_report_key(tpd->dev, BTN_TOUCH, 1); input_report_abs(tpd->dev, ABS_MT_TOUCH_MAJOR, 128); input_report_abs(tpd->dev, ABS_MT_WIDTH_MAJOR, 128); input_report_abs(tpd->dev, ABS_MT_POSITION_X, x); input_report_abs(tpd->dev, ABS_MT_POSITION_Y, y); input_mt_sync(tpd->dev); TPD_DEBUG("D[%4d %4d %4d]\n", x, y, p); TPD_EM_PRINT(raw_x, raw_y, x, y, p, 1); }
static void tpd_down(int raw_x, int raw_y, int x, int y, int p) { input_report_abs(tpd->dev, ABS_PRESSURE, p); input_report_key(tpd->dev, BTN_TOUCH, 1); input_report_abs(tpd->dev, ABS_MT_TOUCH_MAJOR, p); input_report_abs(tpd->dev, ABS_MT_POSITION_X, x); input_report_abs(tpd->dev, ABS_MT_POSITION_Y, y); //printk("D[%4d %4d %4d] ", x, y, p); input_mt_sync(tpd->dev); TPD_DOWN_DEBUG_TRACK(x,y); TPD_EM_PRINT(raw_x, raw_y, x, y, p, 1); }
int tpd_up(int raw_x, int raw_y, int x, int y) { input_report_abs(tpd->dev, ABS_PRESSURE, 0); input_report_key(tpd->dev, BTN_TOUCH, 0); input_report_abs(tpd->dev, ABS_MT_TOUCH_MAJOR, 0); input_report_abs(tpd->dev, ABS_MT_POSITION_X, x); input_report_abs(tpd->dev, ABS_MT_POSITION_Y, y); TPD_DEBUG("U[%4d %4d %4d] ", x, y, 0); input_mt_sync(tpd->dev); TPD_UP_DEBUG_TRACK(x,y); TPD_EM_PRINT(raw_x, raw_y, x, y, 0, 0); return 1; }
void tpd_down(int raw_x, int raw_y, int x, int y, int p) { if(tpd && tpd->dev && tpd_register_flag==1) { input_report_abs(tpd->dev, ABS_PRESSURE, p/PRESSURE_FACTOR); input_report_key(tpd->dev, BTN_TOUCH, 1); input_report_abs(tpd->dev, ABS_MT_TOUCH_MAJOR, p/PRESSURE_FACTOR); input_report_abs(tpd->dev, ABS_MT_WIDTH_MAJOR, p/PRESSURE_FACTOR); input_report_abs(tpd->dev, ABS_MT_POSITION_X, x); input_report_abs(tpd->dev, ABS_MT_POSITION_Y, y); input_mt_sync(tpd->dev); TPD_DEBUG("D[%4d %4d %4d]\n", x, y, p); TPD_EM_PRINT(raw_x, raw_y, x, y, p, 1); } }
void tpd_up(int raw_x, int raw_y, int x, int y, int p) { if(tpd && tpd->dev && tpd_register_flag==1) { input_report_abs(tpd->dev, ABS_PRESSURE, 0); input_report_key(tpd->dev, BTN_TOUCH, 0); input_report_abs(tpd->dev, ABS_MT_TOUCH_MAJOR, 0); input_report_abs(tpd->dev, ABS_MT_WIDTH_MAJOR, 0); input_report_abs(tpd->dev, ABS_MT_POSITION_X, x); input_report_abs(tpd->dev, ABS_MT_POSITION_Y, y); input_mt_sync(tpd->dev); TPD_DEBUG("U[%4d %4d %4d]\n", x, y, 0); printk("mtk-tpd:U[%4d %4d %4d]\n", x, y, 0); TPD_EM_PRINT(raw_x, raw_y, x, y, p, 0); } }
static int tpd_up(int raw_x, int raw_y, int x, int y,int *count) { if(*count>0) { input_report_abs(tpd->dev, ABS_PRESSURE, 0); input_report_key(tpd->dev, BTN_TOUCH, 0); input_report_abs(tpd->dev, ABS_MT_TOUCH_MAJOR, 0); input_report_abs(tpd->dev, ABS_MT_POSITION_X, x); input_report_abs(tpd->dev, ABS_MT_POSITION_Y, y); //printk("U[%4d %4d %4d] ", x, y, 0); input_mt_sync(tpd->dev); TPD_UP_DEBUG_TRACK(x,y); TPD_EM_PRINT(raw_x, raw_y, x, y, 0, 0); (*count)--; return 1; } return 0; }
static void tpd_up(int cx, int cy, int cd, int cp) { int i, pending = 0; //TPD_DEBUG("[ UP ] [x%4d y%4d d%1d p%6d)\n",cx, cy, cd, cp); tpd_buffer_init(); #ifdef TPD_HAVE_BUTTON if(tpd->btn_state) tpd_button(cx,cy,0); else #endif do { input_report_abs(tpd->dev, ABS_X, cx); input_report_abs(tpd->dev, ABS_Y, cy); input_report_abs(tpd->dev, ABS_PRESSURE, 0); input_report_key(tpd->dev, BTN_TOUCH, 0); input_sync(tpd->dev); } while(0); for(i=0;i<5;i++) { tpd_lpfx[i]=0;tpd_lpfy[i]=0;tpd_lpfc=0; } TPD_DEBUG_PRINT_UP; TPD_EM_PRINT(raw_x, raw_y, cx, cy, (raw_z1 << 16 | raw_z2), 0); //printk("u[%5d %5d %5d]", cx, cy, cp); }