aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/hid.h
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2009-09-15 10:27:45 -0400
committerJiri Kosina <jkosina@suse.cz>2009-09-17 09:15:11 -0400
commitc4c259bcc27c4242b012106afdba183622b1735f (patch)
tree5db41b8ea3d43f3a10479257da302590a6b974f2 /include/linux/hid.h
parentd1ff65226c5afe55f9af38a439058f41b71e114f (diff)
HID: consolidate connect and disconnect into core code
HID core registers input, hidraw and hiddev devices, but leaves unregistering it up to the individual driver, which is not really nice. Let's move all the logic to the core. Reported-by: Marcel Holtmann <marcel@holtmann.org> Reported-by: Brian Rogers <brian@xyzw.org> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'include/linux/hid.h')
-rw-r--r--include/linux/hid.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/hid.h b/include/linux/hid.h
index a0ebdace7baa..10f628416740 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -494,6 +494,7 @@ struct hid_device { /* device report descriptor */
494 494
495 /* hiddev event handler */ 495 /* hiddev event handler */
496 int (*hiddev_connect)(struct hid_device *, unsigned int); 496 int (*hiddev_connect)(struct hid_device *, unsigned int);
497 void (*hiddev_disconnect)(struct hid_device *);
497 void (*hiddev_hid_event) (struct hid_device *, struct hid_field *field, 498 void (*hiddev_hid_event) (struct hid_device *, struct hid_field *field,
498 struct hid_usage *, __s32); 499 struct hid_usage *, __s32);
499 void (*hiddev_report_event) (struct hid_device *, struct hid_report *); 500 void (*hiddev_report_event) (struct hid_device *, struct hid_report *);
@@ -691,6 +692,7 @@ struct hid_device *hid_allocate_device(void);
691int hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size); 692int hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size);
692int hid_check_keys_pressed(struct hid_device *hid); 693int hid_check_keys_pressed(struct hid_device *hid);
693int hid_connect(struct hid_device *hid, unsigned int connect_mask); 694int hid_connect(struct hid_device *hid, unsigned int connect_mask);
695void hid_disconnect(struct hid_device *hid);
694 696
695/** 697/**
696 * hid_map_usage - map usage input bits 698 * hid_map_usage - map usage input bits
@@ -800,6 +802,7 @@ static inline int __must_check hid_hw_start(struct hid_device *hdev,
800 */ 802 */
801static inline void hid_hw_stop(struct hid_device *hdev) 803static inline void hid_hw_stop(struct hid_device *hdev)
802{ 804{
805 hid_disconnect(hdev);
803 hdev->ll_driver->stop(hdev); 806 hdev->ll_driver->stop(hdev);
804} 807}
805 808