diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /include/linux/hid.h | |
parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'include/linux/hid.h')
-rw-r--r-- | include/linux/hid.h | 91 |
1 files changed, 81 insertions, 10 deletions
diff --git a/include/linux/hid.h b/include/linux/hid.h index 42a0f1d11365..42f7e2fb501f 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h | |||
@@ -316,6 +316,7 @@ struct hid_item { | |||
316 | #define HID_QUIRK_FULLSPEED_INTERVAL 0x10000000 | 316 | #define HID_QUIRK_FULLSPEED_INTERVAL 0x10000000 |
317 | #define HID_QUIRK_NO_INIT_REPORTS 0x20000000 | 317 | #define HID_QUIRK_NO_INIT_REPORTS 0x20000000 |
318 | #define HID_QUIRK_NO_IGNORE 0x40000000 | 318 | #define HID_QUIRK_NO_IGNORE 0x40000000 |
319 | #define HID_QUIRK_NO_INPUT_SYNC 0x80000000 | ||
319 | 320 | ||
320 | /* | 321 | /* |
321 | * This is the global environment of the parser. This information is | 322 | * This is the global environment of the parser. This information is |
@@ -401,7 +402,7 @@ struct hid_field { | |||
401 | __u16 dpad; /* dpad input code */ | 402 | __u16 dpad; /* dpad input code */ |
402 | }; | 403 | }; |
403 | 404 | ||
404 | #define HID_MAX_FIELDS 64 | 405 | #define HID_MAX_FIELDS 128 |
405 | 406 | ||
406 | struct hid_report { | 407 | struct hid_report { |
407 | struct list_head list; | 408 | struct list_head list; |
@@ -503,6 +504,9 @@ struct hid_device { /* device report descriptor */ | |||
503 | struct hid_usage *, __s32); | 504 | struct hid_usage *, __s32); |
504 | void (*hiddev_report_event) (struct hid_device *, struct hid_report *); | 505 | void (*hiddev_report_event) (struct hid_device *, struct hid_report *); |
505 | 506 | ||
507 | /* handler for raw input (Get_Report) data, used by hidraw */ | ||
508 | int (*hid_get_raw_report) (struct hid_device *, unsigned char, __u8 *, size_t, unsigned char); | ||
509 | |||
506 | /* handler for raw output data, used by hidraw */ | 510 | /* handler for raw output data, used by hidraw */ |
507 | int (*hid_output_raw_report) (struct hid_device *, __u8 *, size_t, unsigned char); | 511 | int (*hid_output_raw_report) (struct hid_device *, __u8 *, size_t, unsigned char); |
508 | 512 | ||
@@ -592,6 +596,7 @@ struct hid_usage_id { | |||
592 | * @report_fixup: called before report descriptor parsing (NULL means nop) | 596 | * @report_fixup: called before report descriptor parsing (NULL means nop) |
593 | * @input_mapping: invoked on input registering before mapping an usage | 597 | * @input_mapping: invoked on input registering before mapping an usage |
594 | * @input_mapped: invoked on input registering after mapping an usage | 598 | * @input_mapped: invoked on input registering after mapping an usage |
599 | * @feature_mapping: invoked on feature registering | ||
595 | * @suspend: invoked on suspend (NULL means nop) | 600 | * @suspend: invoked on suspend (NULL means nop) |
596 | * @resume: invoked on resume if device was not reset (NULL means nop) | 601 | * @resume: invoked on resume if device was not reset (NULL means nop) |
597 | * @reset_resume: invoked on resume if device was reset (NULL means nop) | 602 | * @reset_resume: invoked on resume if device was reset (NULL means nop) |
@@ -626,8 +631,8 @@ struct hid_driver { | |||
626 | int (*event)(struct hid_device *hdev, struct hid_field *field, | 631 | int (*event)(struct hid_device *hdev, struct hid_field *field, |
627 | struct hid_usage *usage, __s32 value); | 632 | struct hid_usage *usage, __s32 value); |
628 | 633 | ||
629 | void (*report_fixup)(struct hid_device *hdev, __u8 *buf, | 634 | __u8 *(*report_fixup)(struct hid_device *hdev, __u8 *buf, |
630 | unsigned int size); | 635 | unsigned int *size); |
631 | 636 | ||
632 | int (*input_mapping)(struct hid_device *hdev, | 637 | int (*input_mapping)(struct hid_device *hdev, |
633 | struct hid_input *hidinput, struct hid_field *field, | 638 | struct hid_input *hidinput, struct hid_field *field, |
@@ -635,6 +640,9 @@ struct hid_driver { | |||
635 | int (*input_mapped)(struct hid_device *hdev, | 640 | int (*input_mapped)(struct hid_device *hdev, |
636 | struct hid_input *hidinput, struct hid_field *field, | 641 | struct hid_input *hidinput, struct hid_field *field, |
637 | struct hid_usage *usage, unsigned long **bit, int *max); | 642 | struct hid_usage *usage, unsigned long **bit, int *max); |
643 | void (*feature_mapping)(struct hid_device *hdev, | ||
644 | struct hid_field *field, | ||
645 | struct hid_usage *usage); | ||
638 | #ifdef CONFIG_PM | 646 | #ifdef CONFIG_PM |
639 | int (*suspend)(struct hid_device *hdev, pm_message_t message); | 647 | int (*suspend)(struct hid_device *hdev, pm_message_t message); |
640 | int (*resume)(struct hid_device *hdev); | 648 | int (*resume)(struct hid_device *hdev); |
@@ -791,7 +799,7 @@ static inline int __must_check hid_parse(struct hid_device *hdev) | |||
791 | * | 799 | * |
792 | * Call this in probe function *after* hid_parse. This will setup HW buffers | 800 | * Call this in probe function *after* hid_parse. This will setup HW buffers |
793 | * and start the device (if not deffered to device open). hid_hw_stop must be | 801 | * and start the device (if not deffered to device open). hid_hw_stop must be |
794 | * called if this was successfull. | 802 | * called if this was successful. |
795 | */ | 803 | */ |
796 | static inline int __must_check hid_hw_start(struct hid_device *hdev, | 804 | static inline int __must_check hid_hw_start(struct hid_device *hdev, |
797 | unsigned int connect_mask) | 805 | unsigned int connect_mask) |
@@ -819,6 +827,49 @@ static inline void hid_hw_stop(struct hid_device *hdev) | |||
819 | hdev->ll_driver->stop(hdev); | 827 | hdev->ll_driver->stop(hdev); |
820 | } | 828 | } |
821 | 829 | ||
830 | /** | ||
831 | * hid_hw_open - signal underlaying HW to start delivering events | ||
832 | * | ||
833 | * @hdev: hid device | ||
834 | * | ||
835 | * Tell underlying HW to start delivering events from the device. | ||
836 | * This function should be called sometime after successful call | ||
837 | * to hid_hiw_start(). | ||
838 | */ | ||
839 | static inline int __must_check hid_hw_open(struct hid_device *hdev) | ||
840 | { | ||
841 | return hdev->ll_driver->open(hdev); | ||
842 | } | ||
843 | |||
844 | /** | ||
845 | * hid_hw_close - signal underlaying HW to stop delivering events | ||
846 | * | ||
847 | * @hdev: hid device | ||
848 | * | ||
849 | * This function indicates that we are not interested in the events | ||
850 | * from this device anymore. Delivery of events may or may not stop, | ||
851 | * depending on the number of users still outstanding. | ||
852 | */ | ||
853 | static inline void hid_hw_close(struct hid_device *hdev) | ||
854 | { | ||
855 | hdev->ll_driver->close(hdev); | ||
856 | } | ||
857 | |||
858 | /** | ||
859 | * hid_hw_power - requests underlying HW to go into given power mode | ||
860 | * | ||
861 | * @hdev: hid device | ||
862 | * @level: requested power level (one of %PM_HINT_* defines) | ||
863 | * | ||
864 | * This function requests underlying hardware to enter requested power | ||
865 | * mode. | ||
866 | */ | ||
867 | |||
868 | static inline int hid_hw_power(struct hid_device *hdev, int level) | ||
869 | { | ||
870 | return hdev->ll_driver->power ? hdev->ll_driver->power(hdev, level) : 0; | ||
871 | } | ||
872 | |||
822 | void hid_report_raw_event(struct hid_device *hid, int type, u8 *data, int size, | 873 | void hid_report_raw_event(struct hid_device *hid, int type, u8 *data, int size, |
823 | int interrupt); | 874 | int interrupt); |
824 | 875 | ||
@@ -837,12 +888,32 @@ int hid_pidff_init(struct hid_device *hid); | |||
837 | #define hid_pidff_init NULL | 888 | #define hid_pidff_init NULL |
838 | #endif | 889 | #endif |
839 | 890 | ||
840 | #define dbg_hid(format, arg...) if (hid_debug) \ | 891 | #define dbg_hid(format, arg...) \ |
841 | printk(KERN_DEBUG "%s: " format ,\ | 892 | do { \ |
842 | __FILE__ , ## arg) | 893 | if (hid_debug) \ |
843 | #define err_hid(format, arg...) printk(KERN_ERR "%s: " format "\n" , \ | 894 | printk(KERN_DEBUG "%s: " format, __FILE__, ##arg); \ |
844 | __FILE__ , ## arg) | 895 | } while (0) |
845 | #endif /* HID_FF */ | 896 | |
897 | #define hid_printk(level, hid, fmt, arg...) \ | ||
898 | dev_printk(level, &(hid)->dev, fmt, ##arg) | ||
899 | #define hid_emerg(hid, fmt, arg...) \ | ||
900 | dev_emerg(&(hid)->dev, fmt, ##arg) | ||
901 | #define hid_crit(hid, fmt, arg...) \ | ||
902 | dev_crit(&(hid)->dev, fmt, ##arg) | ||
903 | #define hid_alert(hid, fmt, arg...) \ | ||
904 | dev_alert(&(hid)->dev, fmt, ##arg) | ||
905 | #define hid_err(hid, fmt, arg...) \ | ||
906 | dev_err(&(hid)->dev, fmt, ##arg) | ||
907 | #define hid_notice(hid, fmt, arg...) \ | ||
908 | dev_notice(&(hid)->dev, fmt, ##arg) | ||
909 | #define hid_warn(hid, fmt, arg...) \ | ||
910 | dev_warn(&(hid)->dev, fmt, ##arg) | ||
911 | #define hid_info(hid, fmt, arg...) \ | ||
912 | dev_info(&(hid)->dev, fmt, ##arg) | ||
913 | #define hid_dbg(hid, fmt, arg...) \ | ||
914 | dev_dbg(&(hid)->dev, fmt, ##arg) | ||
915 | |||
916 | #endif /* __KERNEL__ */ | ||
846 | 917 | ||
847 | #endif | 918 | #endif |
848 | 919 | ||