Lines Matching +full:3 +full:- +full:byte

1 // SPDX-License-Identifier: GPL-2.0-or-later
16 #include "hid-ids.h"
54 struct usb_interface *intf = to_usb_interface(hdev->dev.parent); in is_not_elan_touchpad()
56 return (intf->altsetting->desc.bInterfaceNumber != in is_not_elan_touchpad()
70 if (field->report->id == ELAN_SINGLE_FINGER || in elan_input_mapping()
71 field->report->id == ELAN_MT_FIRST_FINGER || in elan_input_mapping()
72 field->report->id == ELAN_MT_SECOND_FINGER || in elan_input_mapping()
73 field->report->id == ELAN_MT_I2C) in elan_input_mapping()
74 return -1; in elan_input_mapping()
87 dmabuf[3] = param; in elan_get_device_param()
126 return -ENOMEM; in elan_get_device_params()
132 drvdata->max_x = (dmabuf[4] << 8) | dmabuf[3]; in elan_get_device_params()
138 drvdata->max_y = (dmabuf[4] << 8) | dmabuf[3]; in elan_get_device_params()
144 drvdata->res_x = elan_convert_res(dmabuf[3]); in elan_get_device_params()
145 drvdata->res_y = elan_convert_res(dmabuf[4]); in elan_get_device_params()
165 input = devm_input_allocate_device(&hdev->dev); in elan_input_configured()
167 return -ENOMEM; in elan_input_configured()
169 input->name = "Elan Touchpad"; in elan_input_configured()
170 input->phys = hdev->phys; in elan_input_configured()
171 input->uniq = hdev->uniq; in elan_input_configured()
172 input->id.bustype = hdev->bus; in elan_input_configured()
173 input->id.vendor = hdev->vendor; in elan_input_configured()
174 input->id.product = hdev->product; in elan_input_configured()
175 input->id.version = hdev->version; in elan_input_configured()
176 input->dev.parent = &hdev->dev; in elan_input_configured()
178 input_set_abs_params(input, ABS_MT_POSITION_X, 0, drvdata->max_x, in elan_input_configured()
180 input_set_abs_params(input, ABS_MT_POSITION_Y, 0, drvdata->max_y, in elan_input_configured()
185 __set_bit(BTN_LEFT, input->keybit); in elan_input_configured()
186 __set_bit(INPUT_PROP_BUTTONPAD, input->propbit); in elan_input_configured()
194 input_abs_set_res(input, ABS_X, drvdata->res_x); in elan_input_configured()
195 input_abs_set_res(input, ABS_Y, drvdata->res_y); in elan_input_configured()
205 drvdata->input = input; in elan_input_configured()
213 struct input_dev *input = drvdata->input; in elan_report_mt_slot()
222 y = drvdata->max_y - in elan_report_mt_slot()
235 struct input_dev *input = drvdata->input; in elan_usb_report_input()
238 * There is 3 types of reports: for single touch, in elan_usb_report_input()
239 * for multitouch - first finger and for multitouch - second finger in elan_usb_report_input()
243 * byte 1: 1 0 0 0 0 0 0 1 // 0x81 or 0x82 in elan_usb_report_input()
244 * byte 2: 0 0 0 0 0 0 0 0 // looks like unused in elan_usb_report_input()
245 * byte 3: f5 f4 f3 f2 f1 0 0 L in elan_usb_report_input()
246 * byte 4: x12 x11 x10 x9 0? y11 y10 y9 in elan_usb_report_input()
247 * byte 5: x8 x7 x6 x5 x4 x3 x2 x1 in elan_usb_report_input()
248 * byte 6: y8 y7 y6 y5 y4 y3 y2 y1 in elan_usb_report_input()
249 * byte 7: sy4 sy3 sy2 sy1 sx4 sx3 sx2 sx1 in elan_usb_report_input()
250 * byte 8: p8 p7 p6 p5 p4 p3 p2 p1 in elan_usb_report_input()
254 * byte 1: 1 0 0 0 0 0 1 1 // 0x83 in elan_usb_report_input()
255 * byte 2: x12 x11 x10 x9 0 y11 y10 y9 in elan_usb_report_input()
256 * byte 3: x8 x7 x6 x5 x4 x3 x2 x1 in elan_usb_report_input()
257 * byte 4: y8 y7 y6 y5 y4 y3 y2 y1 in elan_usb_report_input()
258 * byte 5: sy4 sy3 sy2 sy1 sx4 sx3 sx2 sx1 in elan_usb_report_input()
259 * byte 6: p8 p7 p6 p5 p4 p3 p2 p1 in elan_usb_report_input()
260 * byte 7: 0 0 0 0 0 0 0 0 in elan_usb_report_input()
261 * byte 8: 0 0 0 0 0 0 0 0 in elan_usb_report_input()
263 * f5-f1: finger touch bits in elan_usb_report_input()
268 * returned buf, buf[3]=no-x-traces, buf[4]=no-y-traces. in elan_usb_report_input()
274 if (data[2] & BIT(i + 3)) in elan_usb_report_input()
275 elan_report_mt_slot(drvdata, data + 3, i); in elan_usb_report_input()
288 memcpy(drvdata->prev_report, data, in elan_usb_report_input()
289 sizeof(drvdata->prev_report)); in elan_usb_report_input()
295 u8 *prev_report = drvdata->prev_report; in elan_usb_report_input()
301 if (prev_report[2] & BIT(i + 3)) { in elan_usb_report_input()
304 elan_report_mt_slot(drvdata, prev_report + 3, i); in elan_usb_report_input()
321 struct input_dev *input = drvdata->input; in elan_i2c_report_input()
331 * byte 1: 1 0 0 1 1 1 0 1 // 0x5d in elan_i2c_report_input()
332 * byte 2: f5 f4 f3 f2 f1 0 0 L in elan_i2c_report_input()
333 * byte 3: x12 x11 x10 x9 0? y11 y10 y9 in elan_i2c_report_input()
334 * byte 4: x8 x7 x6 x5 x4 x3 x2 x1 in elan_i2c_report_input()
335 * byte 5: y8 y7 y6 y5 y4 y3 y2 y1 in elan_i2c_report_input()
336 * byte 6: sy4 sy3 sy2 sy1 sx4 sx3 sx2 sx1 in elan_i2c_report_input()
337 * byte 7: p8 p7 p6 p5 p4 p3 p2 p1 in elan_i2c_report_input()
338 * byte 8-12: Same as byte 3-7 for second finger down in elan_i2c_report_input()
339 * byte 13-17: Same as byte 3-7 for third finger down in elan_i2c_report_input()
340 * byte 18-22: Same as byte 3-7 for fourth finger down in elan_i2c_report_input()
341 * byte 23-27: Same as byte 3-7 for fifth finger down in elan_i2c_report_input()
346 if (data[1] & BIT(i + 3)) { in elan_i2c_report_input()
389 * This byte sequence will enable multitouch mode and disable in elan_start_multitouch()
396 return -ENOMEM; in elan_start_multitouch()
416 struct device *dev = led_cdev->dev->parent; in elan_mute_led_set_brigtness()
423 return -ENOMEM; in elan_mute_led_set_brigtness()
437 if (ret != -ENODEV) in elan_mute_led_set_brigtness()
439 return ret < 0 ? ret : -EIO; in elan_mute_led_set_brigtness()
442 drvdata->mute_led_state = led_state; in elan_mute_led_set_brigtness()
449 struct led_classdev *mute_led = &drvdata->mute_led; in elan_init_mute_led()
451 mute_led->name = "elan:red:mute"; in elan_init_mute_led()
452 mute_led->default_trigger = "audio-mute"; in elan_init_mute_led()
453 mute_led->brightness_set_blocking = elan_mute_led_set_brigtness; in elan_init_mute_led()
454 mute_led->max_brightness = LED_ON; in elan_init_mute_led()
455 mute_led->flags = LED_HW_PLUGGABLE; in elan_init_mute_led()
456 mute_led->dev = &hdev->dev; in elan_init_mute_led()
458 return devm_led_classdev_register(&hdev->dev, mute_led); in elan_init_mute_led()
466 drvdata = devm_kzalloc(&hdev->dev, sizeof(*drvdata), GFP_KERNEL); in elan_probe()
469 return -ENOMEM; in elan_probe()
488 if (!drvdata->input) { in elan_probe()
490 ret = -ENAVAIL; in elan_probe()
498 if (id->driver_data & ELAN_HAS_LED) { in elan_probe()