diff options
author | David S. Miller <davem@davemloft.net> | 2009-09-24 18:13:11 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-09-24 18:13:11 -0400 |
commit | 8b3f6af86378d0a10ca2f1ded1da124aef13b62c (patch) | |
tree | de6ca90295730343c495be8d98be8efa322140ef /include/linux/hid.h | |
parent | 139d6065c83071d5f66cd013a274a43699f8e2c1 (diff) | |
parent | 94e0fb086fc5663c38bbc0fe86d698be8314f82f (diff) |
Merge branch 'master' of /home/davem/src/GIT/linux-2.6/
Conflicts:
drivers/staging/Kconfig
drivers/staging/Makefile
drivers/staging/cpc-usb/TODO
drivers/staging/cpc-usb/cpc-usb_drv.c
drivers/staging/cpc-usb/cpc.h
drivers/staging/cpc-usb/cpc_int.h
drivers/staging/cpc-usb/cpcusb.h
Diffstat (limited to 'include/linux/hid.h')
-rw-r--r-- | include/linux/hid.h | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/include/linux/hid.h b/include/linux/hid.h index 53489fd4d700..10f628416740 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h | |||
@@ -494,12 +494,21 @@ 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 *); |
500 | 501 | ||
501 | /* handler for raw output data, used by hidraw */ | 502 | /* handler for raw output data, used by hidraw */ |
502 | int (*hid_output_raw_report) (struct hid_device *, __u8 *, size_t); | 503 | int (*hid_output_raw_report) (struct hid_device *, __u8 *, size_t); |
504 | |||
505 | /* debugging support via debugfs */ | ||
506 | unsigned short debug; | ||
507 | struct dentry *debug_dir; | ||
508 | struct dentry *debug_rdesc; | ||
509 | struct dentry *debug_events; | ||
510 | struct list_head debug_list; | ||
511 | wait_queue_head_t debug_wait; | ||
503 | }; | 512 | }; |
504 | 513 | ||
505 | static inline void *hid_get_drvdata(struct hid_device *hdev) | 514 | static inline void *hid_get_drvdata(struct hid_device *hdev) |
@@ -657,9 +666,7 @@ struct hid_ll_driver { | |||
657 | 666 | ||
658 | /* HID core API */ | 667 | /* HID core API */ |
659 | 668 | ||
660 | #ifdef CONFIG_HID_DEBUG | ||
661 | extern int hid_debug; | 669 | extern int hid_debug; |
662 | #endif | ||
663 | 670 | ||
664 | extern int hid_add_device(struct hid_device *); | 671 | extern int hid_add_device(struct hid_device *); |
665 | extern void hid_destroy_device(struct hid_device *); | 672 | extern void hid_destroy_device(struct hid_device *); |
@@ -685,6 +692,7 @@ struct hid_device *hid_allocate_device(void); | |||
685 | int hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size); | 692 | int hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size); |
686 | int hid_check_keys_pressed(struct hid_device *hid); | 693 | int hid_check_keys_pressed(struct hid_device *hid); |
687 | int hid_connect(struct hid_device *hid, unsigned int connect_mask); | 694 | int hid_connect(struct hid_device *hid, unsigned int connect_mask); |
695 | void hid_disconnect(struct hid_device *hid); | ||
688 | 696 | ||
689 | /** | 697 | /** |
690 | * hid_map_usage - map usage input bits | 698 | * hid_map_usage - map usage input bits |
@@ -794,6 +802,7 @@ static inline int __must_check hid_hw_start(struct hid_device *hdev, | |||
794 | */ | 802 | */ |
795 | static inline void hid_hw_stop(struct hid_device *hdev) | 803 | static inline void hid_hw_stop(struct hid_device *hdev) |
796 | { | 804 | { |
805 | hid_disconnect(hdev); | ||
797 | hdev->ll_driver->stop(hdev); | 806 | hdev->ll_driver->stop(hdev); |
798 | } | 807 | } |
799 | 808 | ||
@@ -815,21 +824,9 @@ int hid_pidff_init(struct hid_device *hid); | |||
815 | #define hid_pidff_init NULL | 824 | #define hid_pidff_init NULL |
816 | #endif | 825 | #endif |
817 | 826 | ||
818 | #ifdef CONFIG_HID_DEBUG | ||
819 | #define dbg_hid(format, arg...) if (hid_debug) \ | 827 | #define dbg_hid(format, arg...) if (hid_debug) \ |
820 | printk(KERN_DEBUG "%s: " format ,\ | 828 | printk(KERN_DEBUG "%s: " format ,\ |
821 | __FILE__ , ## arg) | 829 | __FILE__ , ## arg) |
822 | #define dbg_hid_line(format, arg...) if (hid_debug) \ | ||
823 | printk(format, ## arg) | ||
824 | #else | ||
825 | static inline int __attribute__((format(printf, 1, 2))) | ||
826 | dbg_hid(const char *fmt, ...) | ||
827 | { | ||
828 | return 0; | ||
829 | } | ||
830 | #define dbg_hid_line dbg_hid | ||
831 | #endif /* HID_DEBUG */ | ||
832 | |||
833 | #define err_hid(format, arg...) printk(KERN_ERR "%s: " format "\n" , \ | 830 | #define err_hid(format, arg...) printk(KERN_ERR "%s: " format "\n" , \ |
834 | __FILE__ , ## arg) | 831 | __FILE__ , ## arg) |
835 | #endif /* HID_FF */ | 832 | #endif /* HID_FF */ |