1 /**************************************************************************** 2 **************************************************************************** 3 *** 4 *** This header was automatically generated from a Linux kernel header 5 *** of the same name, to make information necessary for userspace to 6 *** call into the kernel available to libc. It contains only constants, 7 *** structures, and macros generated from the original header, and thus, 8 *** contains no copyrightable information. 9 *** 10 *** To edit the content of this header, modify the corresponding 11 *** source file (e.g. under external/kernel-headers/original/) then 12 *** run bionic/libc/kernel/tools/update_all.py 13 *** 14 *** Any manual change here will be lost the next time this script will 15 *** be run. You've been warned! 16 *** 17 **************************************************************************** 18 ****************************************************************************/ 19 #ifndef _TOUCH_OFFLOAD_H 20 #define _TOUCH_OFFLOAD_H 21 #define TOUCH_OFFLOAD_MAGIC '7' 22 #define BUS_TYPE_I2C 0 23 #define BUS_TYPE_SPI 1 24 #define BUS_TYPE_I3C 2 25 #define HEATMAP_SIZE_FULL (1 << 31) 26 #define TOUCH_DATA_TYPE_COORD 0x01 27 #define TOUCH_DATA_TYPE_RAW 0x02 28 #define TOUCH_DATA_TYPE_FILTERED 0x04 29 #define TOUCH_DATA_TYPE_BASELINE 0x08 30 #define TOUCH_DATA_TYPE_STRENGTH 0x10 31 #define TOUCH_SCAN_TYPE_MUTUAL 0x40 32 #define TOUCH_SCAN_TYPE_SELF 0x80 33 struct TouchOffloadCaps { 34 int tx_size; 35 int rx_size; 36 int bus_type; 37 __u32 bus_speed_hz; 38 int heatmap_size; 39 int touch_data_types; 40 int touch_scan_types; 41 bool continuous_reporting; 42 bool noise_reporting; 43 bool cancel_reporting; 44 bool size_reporting; 45 bool filter_grip; 46 bool filter_palm; 47 int num_sensitivity_settings; 48 }; 49 struct TouchOffloadConfig { 50 bool continuous_reporting; 51 bool noise_reporting; 52 bool cancel_reporting; 53 bool filter_grip; 54 bool filter_palm; 55 int sensitivity_setting; 56 bool read_coords; 57 int mutual_data_types; 58 int self_data_types; 59 }; 60 struct TouchOffloadFrameHeader { 61 __u32 frame_size; 62 __u64 index; 63 __u64 timestamp; 64 } __attribute__((packed)); 65 enum CoordStatus { 66 COORD_STATUS_INACTIVE = 0x00, 67 COORD_STATUS_FINGER = 0x01, 68 COORD_STATUS_EDGE = 0x02, 69 COORD_STATUS_PALM = 0x03, 70 COORD_STATUS_CANCEL = 0x04 71 }; 72 #define MAX_COORDS 10 73 struct TouchOffloadCoord { 74 __u16 x; 75 __u16 y; 76 enum CoordStatus status; 77 __u8 filler[32]; 78 } __attribute__((packed)); 79 struct TouchOffloadDataCoord { 80 __u32 size_bytes; 81 struct TouchOffloadCoord coords[MAX_COORDS]; 82 } __attribute__((packed)); 83 #define TOUCH_OFFLOAD_FRAME_SIZE_COORD (sizeof(struct TouchOffloadDataCoord)) 84 struct TouchOffloadData2d { 85 __u32 size_bytes; 86 __u16 tx_size; 87 __u16 rx_size; 88 __u8 data[1]; 89 } __attribute__((packed)); 90 #define TOUCH_OFFLOAD_DATA_SIZE_2D(rx,tx) (sizeof(__u16) * (rx) * (tx)) 91 #define TOUCH_OFFLOAD_FRAME_SIZE_2D(rx,tx) (sizeof(struct TouchOffloadData2d) - 1 + TOUCH_OFFLOAD_DATA_SIZE_2D((rx), (tx))) 92 struct TouchOffloadData1d { 93 __u32 size_bytes; 94 __u16 tx_size; 95 __u16 rx_size; 96 __u8 data[1]; 97 } __attribute__((packed)); 98 #define TOUCH_OFFLOAD_DATA_SIZE_1D(rx,tx) (sizeof(__u16) * ((rx) + (tx))) 99 #define TOUCH_OFFLOAD_FRAME_SIZE_1D(rx,tx) (sizeof(struct TouchOffloadData1d) - 1 + TOUCH_OFFLOAD_DATA_SIZE_1D((rx), (tx))) 100 struct TouchOffloadIocGetCaps { 101 struct TouchOffloadCaps caps; 102 }; 103 struct TouchOffloadIocConfigure { 104 struct TouchOffloadConfig config; 105 }; 106 struct TouchOffloadIocReport { 107 __u8 numCoords; 108 struct TouchOffloadCoord coords[MAX_COORDS]; 109 }; 110 #define TOUCH_OFFLOAD_IOC_RD_GETCAPS _IOR(TOUCH_OFFLOAD_MAGIC, 0, struct TouchOffloadIocGetCaps) 111 #define TOUCH_OFFLOAD_IOC_WR_CONFIGURE _IOW(TOUCH_OFFLOAD_MAGIC, 1, struct TouchOffloadIocConfigure) 112 #define TOUCH_OFFLOAD_IOC_START _IOC(TOUCH_OFFLOAD_MAGIC, 2) 113 #define TOUCH_OFFLOAD_IOC_WR_REPORT _IOW(TOUCH_OFFLOAD_MAGIC, 3, struct TouchOffloadIocReport) 114 #define TOUCH_OFFLOAD_IOC_STOP _IOC(TOUCH_OFFLOAD_MAGIC, 4) 115 #endif 116