电容屏被广泛使用,多点触摸机制也随之发展,可惜29内核不支持多点上报,30以后内核才支持。
特此记录移植过程。
1、修改include/linux/input.h
Index: include/linux/input.h
=================================================================== --- include/linux/input.h (revision 1550) +++ include/linux/input.h (working copy) @@ -106,6 +106,7 @@ #define SYN_REPORT 0 #define SYN_CONFIG 1 +#define SYN_MT_REPORT 2 /* * Keys and buttons @@ -644,6 +645,18 @@ #define ABS_TOOL_WIDTH 0x1c #define ABS_VOLUME 0x20 #define ABS_MISC 0x28 + +#define ABS_MT_TOUCH_MAJOR 0x30 /* Major axis of touching ellipse */ +#define ABS_MT_TOUCH_MINOR 0x31 /* Minor axis (omit if circular) */ +#define ABS_MT_WIDTH_MAJOR 0x32 /* Major axis of approaching ellipse */ +#define ABS_MT_WIDTH_MINOR 0x33 /* Minor axis (omit if circular) */ +#define ABS_MT_ORIENTATION 0x34 /* Ellipse orientation */ +#define ABS_MT_POSITION_X 0x35 /* Center X ellipse position */ +#define ABS_MT_POSITION_Y 0x36 /* Center Y ellipse position */ +#define ABS_MT_TOOL_TYPE 0x37 /* Type of touching device */ +#define ABS_MT_BLOB_ID 0x38 /* Group a set of packets as a blob */ +#define ABS_MT_TRACKING_ID 0x39 /* Unique ID of initiated contact */ + #define ABS_MAX 0x3f #define ABS_CNT (ABS_MAX+1) @@ -742,6 +755,12 @@ #define BUS_ATARI 0x1B /* + * MT_TOOL types + */ +#define MT_TOOL_FINGER 0 +#define MT_TOOL_PEN 1 + +/* * Values describing the status of a force-feedback effect */ #define FF_STATUS_STOPPED 0x00 @@ -1310,6 +1329,11 @@ input_event(dev, EV_SYN, SYN_REPORT, 0); } +static inline void input_mt_sync(struct input_dev *dev) +{ + input_event(dev, EV_SYN, SYN_MT_REPORT, 0); +} + void input_set_capability(struct input_dev *dev, unsigned int type, unsigned int code);
2、修改drivers/input/input.c