Lines Matching defs:hdev
289 struct hid_device *hdev;
308 ret = hid_hw_power(led->hdev, PM_HINT_FULLON);
310 hid_err(led->hdev, "failed: device not resumed %d\n", ret);
314 ret = hid_hw_output_report(led->hdev, led->buf, sizeof(led->buf));
316 ret = hid_hw_raw_request(led->hdev, 0, led->buf,
321 hid_err(led->hdev, "failed to set keyboard backlight: %d\n",
325 hid_hw_power(led->hdev, PM_HINT_NORMAL);
330 static int hammer_register_leds(struct hid_device *hdev)
339 kbd_backlight->hdev = hdev;
349 error = led_classdev_register(&hdev->dev, &kbd_backlight->cdev);
353 hid_set_drvdata(hdev, kbd_backlight);
361 static void hammer_unregister_leds(struct hid_device *hdev)
363 struct hammer_kbd_leds *kbd_backlight = hid_get_drvdata(hdev);
378 static int hammer_input_mapping(struct hid_device *hdev, struct hid_input *hi,
425 static bool hammer_has_usage(struct hid_device *hdev, unsigned int report_type,
428 struct hid_report_enum *re = &hdev->report_enum[report_type];
448 static bool hammer_has_folded_event(struct hid_device *hdev)
450 return hammer_has_usage(hdev, HID_INPUT_REPORT,
454 static bool hammer_has_backlight_control(struct hid_device *hdev)
456 return hammer_has_usage(hdev, HID_OUTPUT_REPORT,
460 static int hammer_probe(struct hid_device *hdev,
465 error = hid_parse(hdev);
469 error = hid_hw_start(hdev, HID_CONNECT_DEFAULT);
479 if (hammer_has_folded_event(hdev)) {
480 hdev->quirks |= HID_QUIRK_ALWAYS_POLL;
481 error = hid_hw_open(hdev);
486 if (hammer_has_backlight_control(hdev)) {
487 error = hammer_register_leds(hdev);
489 hid_warn(hdev,
497 static void hammer_remove(struct hid_device *hdev)
501 if (hammer_has_folded_event(hdev)) {
502 hid_hw_close(hdev);
523 hammer_unregister_leds(hdev);
525 hid_hw_stop(hdev);