aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/hid.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/hid.h')
-rw-r--r--include/linux/hid.h75
1 files changed, 69 insertions, 6 deletions
diff --git a/include/linux/hid.h b/include/linux/hid.h
index bb0f56f5c01e..20b9801f669b 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -820,6 +820,49 @@ static inline void hid_hw_stop(struct hid_device *hdev)
820 hdev->ll_driver->stop(hdev); 820 hdev->ll_driver->stop(hdev);
821} 821}
822 822
823/**
824 * hid_hw_open - signal underlaying HW to start delivering events
825 *
826 * @hdev: hid device
827 *
828 * Tell underlying HW to start delivering events from the device.
829 * This function should be called sometime after successful call
830 * to hid_hiw_start().
831 */
832static inline int __must_check hid_hw_open(struct hid_device *hdev)
833{
834 return hdev->ll_driver->open(hdev);
835}
836
837/**
838 * hid_hw_close - signal underlaying HW to stop delivering events
839 *
840 * @hdev: hid device
841 *
842 * This function indicates that we are not interested in the events
843 * from this device anymore. Delivery of events may or may not stop,
844 * depending on the number of users still outstanding.
845 */
846static inline void hid_hw_close(struct hid_device *hdev)
847{
848 hdev->ll_driver->close(hdev);
849}
850
851/**
852 * hid_hw_power - requests underlying HW to go into given power mode
853 *
854 * @hdev: hid device
855 * @level: requested power level (one of %PM_HINT_* defines)
856 *
857 * This function requests underlying hardware to enter requested power
858 * mode.
859 */
860
861static inline int hid_hw_power(struct hid_device *hdev, int level)
862{
863 return hdev->ll_driver->power ? hdev->ll_driver->power(hdev, level) : 0;
864}
865
823void hid_report_raw_event(struct hid_device *hid, int type, u8 *data, int size, 866void hid_report_raw_event(struct hid_device *hid, int type, u8 *data, int size,
824 int interrupt); 867 int interrupt);
825 868
@@ -838,12 +881,32 @@ int hid_pidff_init(struct hid_device *hid);
838#define hid_pidff_init NULL 881#define hid_pidff_init NULL
839#endif 882#endif
840 883
841#define dbg_hid(format, arg...) if (hid_debug) \ 884#define dbg_hid(format, arg...) \
842 printk(KERN_DEBUG "%s: " format ,\ 885do { \
843 __FILE__ , ## arg) 886 if (hid_debug) \
844#define err_hid(format, arg...) printk(KERN_ERR "%s: " format "\n" , \ 887 printk(KERN_DEBUG "%s: " format, __FILE__, ##arg); \
845 __FILE__ , ## arg) 888} while (0)
846#endif /* HID_FF */ 889
890#define hid_printk(level, hid, fmt, arg...) \
891 dev_printk(level, &(hid)->dev, fmt, ##arg)
892#define hid_emerg(hid, fmt, arg...) \
893 dev_emerg(&(hid)->dev, fmt, ##arg)
894#define hid_crit(hid, fmt, arg...) \
895 dev_crit(&(hid)->dev, fmt, ##arg)
896#define hid_alert(hid, fmt, arg...) \
897 dev_alert(&(hid)->dev, fmt, ##arg)
898#define hid_err(hid, fmt, arg...) \
899 dev_err(&(hid)->dev, fmt, ##arg)
900#define hid_notice(hid, fmt, arg...) \
901 dev_notice(&(hid)->dev, fmt, ##arg)
902#define hid_warn(hid, fmt, arg...) \
903 dev_warn(&(hid)->dev, fmt, ##arg)
904#define hid_info(hid, fmt, arg...) \
905 dev_info(&(hid)->dev, fmt, ##arg)
906#define hid_dbg(hid, fmt, arg...) \
907 dev_dbg(&(hid)->dev, fmt, ##arg)
908
909#endif /* __KERNEL__ */
847 910
848#endif 911#endif
849 912