Lines Matching defs:hdev

51 static int is_not_elan_touchpad(struct hid_device *hdev)
53 if (hid_is_usb(hdev)) {
54 struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
63 static int elan_input_mapping(struct hid_device *hdev, struct hid_input *hi,
67 if (is_not_elan_touchpad(hdev))
79 static int elan_get_device_param(struct hid_device *hdev,
90 ret = hid_hw_raw_request(hdev, ELAN_FEATURE_REPORT, dmabuf,
94 hid_err(hdev, "Set report error for parm %d: %d\n", param, ret);
98 ret = hid_hw_raw_request(hdev, ELAN_FEATURE_REPORT, dmabuf,
102 hid_err(hdev, "Get report error for parm %d: %d\n", param, ret);
118 static int elan_get_device_params(struct hid_device *hdev)
120 struct elan_drvdata *drvdata = hid_get_drvdata(hdev);
128 ret = elan_get_device_param(hdev, dmabuf, ELAN_PARAM_MAX_X);
134 ret = elan_get_device_param(hdev, dmabuf, ELAN_PARAM_MAX_Y);
140 ret = elan_get_device_param(hdev, dmabuf, ELAN_PARAM_RES);
152 static int elan_input_configured(struct hid_device *hdev, struct hid_input *hi)
156 struct elan_drvdata *drvdata = hid_get_drvdata(hdev);
158 if (is_not_elan_touchpad(hdev))
161 ret = elan_get_device_params(hdev);
165 input = devm_input_allocate_device(&hdev->dev);
170 input->phys = hdev->phys;
171 input->uniq = hdev->uniq;
172 input->id.bustype = hdev->bus;
173 input->id.vendor = hdev->vendor;
174 input->id.product = hdev->product;
175 input->id.version = hdev->version;
176 input->dev.parent = &hdev->dev;
190 hid_err(hdev, "Failed to init elan MT slots: %d\n", ret);
199 hid_err(hdev, "Failed to register elan input device: %d\n",
359 static int elan_raw_event(struct hid_device *hdev,
362 struct elan_drvdata *drvdata = hid_get_drvdata(hdev);
364 if (is_not_elan_touchpad(hdev))
384 static int elan_start_multitouch(struct hid_device *hdev)
398 ret = hid_hw_raw_request(hdev, dmabuf[0], dmabuf, sizeof(buf),
404 hid_err(hdev, "Failed to start multitouch: %d\n", ret);
414 struct hid_device *hdev = to_hid_device(dev);
415 struct elan_drvdata *drvdata = hid_get_drvdata(hdev);
426 struct hid_device *hdev = to_hid_device(dev);
427 struct elan_drvdata *drvdata = hid_get_drvdata(hdev);
440 ret = hid_hw_raw_request(hdev, dmabuf[0], dmabuf, ELAN_LED_REPORT_SIZE,
446 hid_err(hdev, "Failed to set mute led brightness: %d\n", ret);
454 static int elan_init_mute_led(struct hid_device *hdev)
456 struct elan_drvdata *drvdata = hid_get_drvdata(hdev);
463 mute_led->dev = &hdev->dev;
465 return devm_led_classdev_register(&hdev->dev, mute_led);
468 static int elan_probe(struct hid_device *hdev, const struct hid_device_id *id)
473 drvdata = devm_kzalloc(&hdev->dev, sizeof(*drvdata), GFP_KERNEL);
478 hid_set_drvdata(hdev, drvdata);
480 ret = hid_parse(hdev);
482 hid_err(hdev, "Hid Parse failed\n");
486 ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT);
488 hid_err(hdev, "Hid hw start failed\n");
492 if (is_not_elan_touchpad(hdev))
496 hid_err(hdev, "Input device is not registered\n");
501 ret = elan_start_multitouch(hdev);
506 ret = elan_init_mute_led(hdev);
513 hid_hw_stop(hdev);
517 static void elan_remove(struct hid_device *hdev)
519 hid_hw_stop(hdev);