1. 程式人生 > >電容螢幕觸控式螢幕驅動——ft5406 晶片

電容螢幕觸控式螢幕驅動——ft5406 晶片

/*產生一個 SYN_MT_REPORT event來標記一個點的結束,告訴接收方接收當前手指的資訊並準備接收其它手指的觸控資訊*/    input_mt_sync(i2c.input_dev);            #ifdef DEBUG_MSG    printk(KERN_INFO "input press x=%d y%d\n",x,y);    #endif        case 4:i2c.event.x4 = (s16)(buf[0x15] & 0x0F)<<8 | (s16)buf[0x16];i2c.event.y4 = (s16)(buf[0x17] & 0x0F)<<8 | (s16)buf[0x18];             x = i2c.event.x4;            y = i2c.event.y4;    input_event(i2c.input_dev, EV_ABS, ABS_MT_TRACKING_ID, 4);    input_event(i2c.input_dev, EV_ABS, ABS_MT_POSITION_X, x);    input_event(i2c.input_dev, EV_ABS, ABS_MT_POSITION_Y, y);    input_event(i2c.input_dev, EV_ABS, ABS_MT_TOUCH_MAJOR, 1);    input_mt_sync(i2c.input_dev);            #ifdef DEBUG_MSG    printk(KERN_INFO "input press x=%d y%d\n",x,y);    #endifcase 3:i2c.event.x3 = (s16)(buf[0x0f] & 0x0F)<<8 | (s16)buf[0x10];i2c.event.y3 = (s16)(buf[0x11] & 0x0F)<<8 | (s16)buf[0x12];            x = i2c.event.x3;            y = i2c.event.y3;    input_event(i2c.input_dev, EV_ABS, ABS_MT_TRACKING_ID, 3);    input_event(i2c.input_dev, EV_ABS, ABS_MT_POSITION_X, x);    input_event(i2c.input_dev, EV_ABS, ABS_MT_POSITION_Y, y);    input_event(i2c.input_dev, EV_ABS, ABS_MT_TOUCH_MAJOR, 1);    input_mt_sync(i2c.input_dev);            #ifdef DEBUG_MSG    printk(KERN_INFO "input press x=%d y%d\n",x,y);    #endif        case 2:i2c.event.x2 = (s16)(buf[9] & 0x0F)<<8 | (s16)buf[10];i2c.event.y2 = (s16)(buf[11] & 0x0F)<<8 | (s16)buf[12];            x = i2c.event.x2;            y = i2c.event.y2;    input_event(i2c.input_dev, EV_ABS, ABS_MT_TRACKING_ID, 2);    input_event(i2c.input_dev, EV_ABS, ABS_MT_POSITION_X, x);    input_event(i2c.input_dev, EV_ABS, ABS_MT_POSITION_Y, y);    input_event(i2c.input_dev, EV_ABS, ABS_MT_TOUCH_MAJOR, 1);    input_mt_sync(i2c.input_dev);            #ifdef DEBUG_MSG    printk(KERN_INFO "input press x=%d y%d\n",x,y);    #endif        case 1:i2c.event.x1 = (s16)(buf[3] & 0x0F)<<8 | (s16)buf[4];i2c.event.y1 = (s16)(buf[5] & 0x0F)<<8 | (s16)buf[6];            x = i2c.event.x1;            y = i2c.event.y1;    input_event(i2c.input_dev, EV_ABS, ABS_MT_TRACKING_ID,1);    input_event(i2c.input_dev, EV_ABS, ABS_MT_POSITION_X, x);    input_event(i2c.input_dev, EV_ABS, ABS_MT_POSITION_Y, y);    input_event(i2c.input_dev, EV_ABS, ABS_MT_TOUCH_MAJOR, 1);    input_mt_sync(i2c.input_dev);            #ifdef DEBUG_MSG    printk(KERN_INFO "input press x=%d y%d\n",x,y);    #endif            break;default:    return -1;    }    }    else{input_event(i2c.input_dev, EV_ABS, ABS_MT_TOUCH_MAJOR, 0);input_mt_sync(i2c.input_dev);#ifdef DEBUG_MSGprintk(KERN_INFO "realse\n");#endifret = 1; // stop timer interrupt    }    input_sync(i2c.input_dev);return ret;}