diff options
Diffstat (limited to 'drivers/input/mouse/elantech.h')
-rw-r--r-- | drivers/input/mouse/elantech.h | 57 |
1 files changed, 40 insertions, 17 deletions
diff --git a/drivers/input/mouse/elantech.h b/drivers/input/mouse/elantech.h index fabb2b99615..9e5f1aabea7 100644 --- a/drivers/input/mouse/elantech.h +++ b/drivers/input/mouse/elantech.h @@ -16,14 +16,17 @@ /* * Command values for Synaptics style queries */ +#define ETP_FW_ID_QUERY 0x00 #define ETP_FW_VERSION_QUERY 0x01 #define ETP_CAPABILITIES_QUERY 0x02 +#define ETP_SAMPLE_QUERY 0x03 /* * Command values for register reading or writing */ #define ETP_REGISTER_READ 0x10 #define ETP_REGISTER_WRITE 0x11 +#define ETP_REGISTER_READWRITE 0x00 /* * Hardware version 2 custom PS/2 command value @@ -66,16 +69,13 @@ #define ETP_YMAX_V1 (384 - ETP_EDGE_FUZZ_V1) /* - * It seems the resolution for hardware version 2 doubled. - * Hence the X and Y ranges are doubled too. - * The bezel around the pad also appears to be smaller + * The resolution for older v2 hardware doubled. + * (newer v2's firmware provides command so we can query) */ -#define ETP_EDGE_FUZZ_V2 8 - -#define ETP_XMIN_V2 ( 0 + ETP_EDGE_FUZZ_V2) -#define ETP_XMAX_V2 (1152 - ETP_EDGE_FUZZ_V2) -#define ETP_YMIN_V2 ( 0 + ETP_EDGE_FUZZ_V2) -#define ETP_YMAX_V2 ( 768 - ETP_EDGE_FUZZ_V2) +#define ETP_XMIN_V2 0 +#define ETP_XMAX_V2 1152 +#define ETP_YMIN_V2 0 +#define ETP_YMAX_V2 768 #define ETP_PMIN_V2 0 #define ETP_PMAX_V2 255 @@ -83,17 +83,37 @@ #define ETP_WMAX_V2 15 /* - * For two finger touches the coordinate of each finger gets reported - * separately but with reduced resolution. + * v3 hardware has 2 kinds of packet types, + * v4 hardware has 3. + */ +#define PACKET_UNKNOWN 0x01 +#define PACKET_DEBOUNCE 0x02 +#define PACKET_V3_HEAD 0x03 +#define PACKET_V3_TAIL 0x04 +#define PACKET_V4_HEAD 0x05 +#define PACKET_V4_MOTION 0x06 +#define PACKET_V4_STATUS 0x07 + +/* + * track up to 5 fingers for v4 hardware + */ +#define ETP_MAX_FINGERS 5 + +/* + * weight value for v4 hardware */ -#define ETP_2FT_FUZZ 4 +#define ETP_WEIGHT_VALUE 5 -#define ETP_2FT_XMIN ( 0 + ETP_2FT_FUZZ) -#define ETP_2FT_XMAX (288 - ETP_2FT_FUZZ) -#define ETP_2FT_YMIN ( 0 + ETP_2FT_FUZZ) -#define ETP_2FT_YMAX (192 - ETP_2FT_FUZZ) +/* + * The base position for one finger, v4 hardware + */ +struct finger_pos { + unsigned int x; + unsigned int y; +}; struct elantech_data { + unsigned char reg_07; unsigned char reg_10; unsigned char reg_11; unsigned char reg_20; @@ -104,13 +124,16 @@ struct elantech_data { unsigned char reg_25; unsigned char reg_26; unsigned char debug; - unsigned char capabilities; + unsigned char capabilities[3]; bool paritycheck; bool jumpy_cursor; bool reports_pressure; unsigned char hw_version; unsigned int fw_version; unsigned int single_finger_reports; + unsigned int y_max; + unsigned int width; + struct finger_pos mt[ETP_MAX_FINGERS]; unsigned char parity[256]; }; |