Lines Matching refs:data
48 * Per-touchscreen data.
60 unsigned char data[ELO_MAX_LENGTH];
65 static void elo_process_data_10(struct elo *elo, unsigned char data)
69 elo->data[elo->idx] = data;
74 if (data != ELO10_LEAD_BYTE) {
76 "unsynchronized data: 0x%02x\n", data);
83 if (data != elo->csum) {
86 data, elo->csum);
89 if (elo->data[1] != elo->expected_packet) {
90 if (elo->data[1] != ELO10_TOUCH_PACKET)
93 elo->data[1]);
96 if (likely(elo->data[1] == ELO10_TOUCH_PACKET)) {
97 input_report_abs(dev, ABS_X, (elo->data[4] << 8) | elo->data[3]);
98 input_report_abs(dev, ABS_Y, (elo->data[6] << 8) | elo->data[5]);
99 if (elo->data[2] & ELO10_PRESSURE)
101 (elo->data[8] << 8) | elo->data[7]);
102 input_report_key(dev, BTN_TOUCH, elo->data[2] & ELO10_TOUCH);
104 } else if (elo->data[1] == ELO10_ACK_PACKET) {
105 if (elo->data[2] == '0')
109 memcpy(elo->response, &elo->data[1], ELO10_PACKET_LEN);
114 elo->csum += data;
117 static void elo_process_data_6(struct elo *elo, unsigned char data)
121 elo->data[elo->idx] = data;
126 if ((data & 0xc0) != 0xc0)
131 if ((data & 0xc0) != 0x80)
136 if ((data & 0xc0) != 0x40)
141 if (data & 0xc0) {
146 input_report_abs(dev, ABS_X, ((elo->data[0] & 0x3f) << 6) | (elo->data[1] & 0x3f));
147 input_report_abs(dev, ABS_Y, ((elo->data[2] & 0x3f) << 6) | (elo->data[3] & 0x3f));
158 if (data) {
165 if ((data & 0xf0) == 0) {
166 input_report_abs(dev, ABS_PRESSURE, elo->data[5]);
167 input_report_key(dev, BTN_TOUCH, !!elo->data[5]);
175 static void elo_process_data_3(struct elo *elo, unsigned char data)
179 elo->data[elo->idx] = data;
184 if ((data & 0x7f) != 0x01)
188 input_report_key(dev, BTN_TOUCH, !(elo->data[1] & 0x80));
189 input_report_abs(dev, ABS_X, elo->data[1]);
190 input_report_abs(dev, ABS_Y, elo->data[2]);
198 unsigned char data, unsigned int flags)
204 elo_process_data_10(elo, data);
209 elo_process_data_6(elo, data);
213 elo_process_data_3(elo, data);