diff options
Diffstat (limited to 'include/linux/hid.h')
-rw-r--r-- | include/linux/hid.h | 81 |
1 files changed, 74 insertions, 7 deletions
diff --git a/include/linux/hid.h b/include/linux/hid.h index bb0f56f5c01e..d91c25e253c8 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h | |||
@@ -402,7 +402,7 @@ struct hid_field { | |||
402 | __u16 dpad; /* dpad input code */ | 402 | __u16 dpad; /* dpad input code */ |
403 | }; | 403 | }; |
404 | 404 | ||
405 | #define HID_MAX_FIELDS 64 | 405 | #define HID_MAX_FIELDS 128 |
406 | 406 | ||
407 | struct hid_report { | 407 | struct hid_report { |
408 | struct list_head list; | 408 | struct list_head list; |
@@ -593,6 +593,7 @@ struct hid_usage_id { | |||
593 | * @report_fixup: called before report descriptor parsing (NULL means nop) | 593 | * @report_fixup: called before report descriptor parsing (NULL means nop) |
594 | * @input_mapping: invoked on input registering before mapping an usage | 594 | * @input_mapping: invoked on input registering before mapping an usage |
595 | * @input_mapped: invoked on input registering after mapping an usage | 595 | * @input_mapped: invoked on input registering after mapping an usage |
596 | * @feature_mapping: invoked on feature registering | ||
596 | * @suspend: invoked on suspend (NULL means nop) | 597 | * @suspend: invoked on suspend (NULL means nop) |
597 | * @resume: invoked on resume if device was not reset (NULL means nop) | 598 | * @resume: invoked on resume if device was not reset (NULL means nop) |
598 | * @reset_resume: invoked on resume if device was reset (NULL means nop) | 599 | * @reset_resume: invoked on resume if device was reset (NULL means nop) |
@@ -636,6 +637,9 @@ struct hid_driver { | |||
636 | int (*input_mapped)(struct hid_device *hdev, | 637 | int (*input_mapped)(struct hid_device *hdev, |
637 | struct hid_input *hidinput, struct hid_field *field, | 638 | struct hid_input *hidinput, struct hid_field *field, |
638 | struct hid_usage *usage, unsigned long **bit, int *max); | 639 | struct hid_usage *usage, unsigned long **bit, int *max); |
640 | void (*feature_mapping)(struct hid_device *hdev, | ||
641 | struct hid_input *hidinput, struct hid_field *field, | ||
642 | struct hid_usage *usage); | ||
639 | #ifdef CONFIG_PM | 643 | #ifdef CONFIG_PM |
640 | int (*suspend)(struct hid_device *hdev, pm_message_t message); | 644 | int (*suspend)(struct hid_device *hdev, pm_message_t message); |
641 | int (*resume)(struct hid_device *hdev); | 645 | int (*resume)(struct hid_device *hdev); |
@@ -820,6 +824,49 @@ static inline void hid_hw_stop(struct hid_device *hdev) | |||
820 | hdev->ll_driver->stop(hdev); | 824 | hdev->ll_driver->stop(hdev); |
821 | } | 825 | } |
822 | 826 | ||
827 | /** | ||
828 | * hid_hw_open - signal underlaying HW to start delivering events | ||
829 | * | ||
830 | * @hdev: hid device | ||
831 | * | ||
832 | * Tell underlying HW to start delivering events from the device. | ||
833 | * This function should be called sometime after successful call | ||
834 | * to hid_hiw_start(). | ||
835 | */ | ||
836 | static inline int __must_check hid_hw_open(struct hid_device *hdev) | ||
837 | { | ||
838 | return hdev->ll_driver->open(hdev); | ||
839 | } | ||
840 | |||
841 | /** | ||
842 | * hid_hw_close - signal underlaying HW to stop delivering events | ||
843 | * | ||
844 | * @hdev: hid device | ||
845 | * | ||
846 | * This function indicates that we are not interested in the events | ||
847 | * from this device anymore. Delivery of events may or may not stop, | ||
848 | * depending on the number of users still outstanding. | ||
849 | */ | ||
850 | static inline void hid_hw_close(struct hid_device *hdev) | ||
851 | { | ||
852 | hdev->ll_driver->close(hdev); | ||
853 | } | ||
854 | |||
855 | /** | ||
856 | * hid_hw_power - requests underlying HW to go into given power mode | ||
857 | * | ||
858 | * @hdev: hid device | ||
859 | * @level: requested power level (one of %PM_HINT_* defines) | ||
860 | * | ||
861 | * This function requests underlying hardware to enter requested power | ||
862 | * mode. | ||
863 | */ | ||
864 | |||
865 | static inline int hid_hw_power(struct hid_device *hdev, int level) | ||
866 | { | ||
867 | return hdev->ll_driver->power ? hdev->ll_driver->power(hdev, level) : 0; | ||
868 | } | ||
869 | |||
823 | void hid_report_raw_event(struct hid_device *hid, int type, u8 *data, int size, | 870 | void hid_report_raw_event(struct hid_device *hid, int type, u8 *data, int size, |
824 | int interrupt); | 871 | int interrupt); |
825 | 872 | ||
@@ -838,12 +885,32 @@ int hid_pidff_init(struct hid_device *hid); | |||
838 | #define hid_pidff_init NULL | 885 | #define hid_pidff_init NULL |
839 | #endif | 886 | #endif |
840 | 887 | ||
841 | #define dbg_hid(format, arg...) if (hid_debug) \ | 888 | #define dbg_hid(format, arg...) \ |
842 | printk(KERN_DEBUG "%s: " format ,\ | 889 | do { \ |
843 | __FILE__ , ## arg) | 890 | if (hid_debug) \ |
844 | #define err_hid(format, arg...) printk(KERN_ERR "%s: " format "\n" , \ | 891 | printk(KERN_DEBUG "%s: " format, __FILE__, ##arg); \ |
845 | __FILE__ , ## arg) | 892 | } while (0) |
846 | #endif /* HID_FF */ | 893 | |
894 | #define hid_printk(level, hid, fmt, arg...) \ | ||
895 | dev_printk(level, &(hid)->dev, fmt, ##arg) | ||
896 | #define hid_emerg(hid, fmt, arg...) \ | ||
897 | dev_emerg(&(hid)->dev, fmt, ##arg) | ||
898 | #define hid_crit(hid, fmt, arg...) \ | ||
899 | dev_crit(&(hid)->dev, fmt, ##arg) | ||
900 | #define hid_alert(hid, fmt, arg...) \ | ||
901 | dev_alert(&(hid)->dev, fmt, ##arg) | ||
902 | #define hid_err(hid, fmt, arg...) \ | ||
903 | dev_err(&(hid)->dev, fmt, ##arg) | ||
904 | #define hid_notice(hid, fmt, arg...) \ | ||
905 | dev_notice(&(hid)->dev, fmt, ##arg) | ||
906 | #define hid_warn(hid, fmt, arg...) \ | ||
907 | dev_warn(&(hid)->dev, fmt, ##arg) | ||
908 | #define hid_info(hid, fmt, arg...) \ | ||
909 | dev_info(&(hid)->dev, fmt, ##arg) | ||
910 | #define hid_dbg(hid, fmt, arg...) \ | ||
911 | dev_dbg(&(hid)->dev, fmt, ##arg) | ||
912 | |||
913 | #endif /* __KERNEL__ */ | ||
847 | 914 | ||
848 | #endif | 915 | #endif |
849 | 916 | ||