Lines Matching defs:buf
51 static void ektf2127_parse_coordinates(const u8 *buf, unsigned int touch_count,
60 touches[i].x = (buf[index] & 0x0f);
62 touches[i].x |= buf[index + 2];
64 touches[i].y = (buf[index] & 0xf0);
66 touches[i].y |= buf[index + 1];
70 static void ektf2127_report_event(struct ektf2127_ts *ts, const u8 *buf)
76 touch_count = buf[1] & 0x07;
84 ektf2127_parse_coordinates(buf, touch_count, touches);
100 const u8 *buf, bool active)
106 int x = (buf[0] & 0xf0) << 4 | buf[1];
107 int y = (buf[0] & 0x0f) << 8 | buf[2];
113 static void ektf2127_report2_event(struct ektf2127_ts *ts, const u8 *buf)
115 ektf2127_report2_contact(ts, 0, &buf[1], !!(buf[7] & 2));
116 ektf2127_report2_contact(ts, 1, &buf[4], !!(buf[7] & 4));
126 char buf[EKTF2127_TOUCH_REPORT_SIZE];
129 ret = i2c_master_recv(ts->client, buf, EKTF2127_TOUCH_REPORT_SIZE);
135 switch (buf[0]) {
137 ektf2127_report_event(ts, buf);
141 ektf2127_report2_event(ts, buf);
145 if (buf[1] == EKTF2127_ENV_NOISY)
154 dev_err(dev, "Unexpected packet header byte %#02x\n", buf[0]);
212 u8 buf[4];
217 buf[0] = EKTF2127_REQUEST;
218 buf[1] = width ? EKTF2127_WIDTH : EKTF2127_HEIGHT;
219 buf[2] = 0x00;
220 buf[3] = 0x00;
221 ret = i2c_master_send(client, buf, sizeof(buf));
222 if (ret != sizeof(buf)) {
231 ret = i2c_master_recv(client, buf, sizeof(buf));
232 if (ret != sizeof(buf)) {
238 if (buf[0] != EKTF2127_RESPONSE || buf[1] != what_code) {
240 what, buf[0], buf[1]);
244 return (((buf[3] & 0xf0) << 4) | buf[2]) - 1;
252 u8 buf[4];
283 i2c_master_recv(ts->client, buf, sizeof(buf));