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);
417 struct hid_device *hdev = to_hid_device(dev);
418 struct elan_drvdata *drvdata = hid_get_drvdata(hdev);
431 ret = hid_hw_raw_request(hdev, dmabuf[0], dmabuf, ELAN_LED_REPORT_SIZE,
438 hid_err(hdev, "Failed to set mute led brightness: %d\n", ret);
446 static int elan_init_mute_led(struct hid_device *hdev)
448 struct elan_drvdata *drvdata = hid_get_drvdata(hdev);
456 mute_led->dev = &hdev->dev;
458 return devm_led_classdev_register(&hdev->dev, mute_led);
461 static int elan_probe(struct hid_device *hdev, const struct hid_device_id *id)
466 drvdata = devm_kzalloc(&hdev->dev, sizeof(*drvdata), GFP_KERNEL);
471 hid_set_drvdata(hdev, drvdata);
473 ret = hid_parse(hdev);
475 hid_err(hdev, "Hid Parse failed\n");
479 ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT);
481 hid_err(hdev, "Hid hw start failed\n");
485 if (is_not_elan_touchpad(hdev))
489 hid_err(hdev, "Input device is not registered\n");
494 ret = elan_start_multitouch(hdev);
499 ret = elan_init_mute_led(hdev);
506 hid_hw_stop(hdev);