Lines Matching +full:max +full:- +full:fingers
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()
65 unsigned long **bit, int *max) in elan_input_mapping() argument
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()
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()
239 * for multitouch - first finger and for multitouch - second finger 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()
282 * When touched with two fingers Elan touchpad will emit two HID reports 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()
321 struct input_dev *input = drvdata->input; in elan_i2c_report_input()
327 * as in USB mode, but then with all fingers in a single packet. 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()
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()