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 1ebc6e39f20d..d91c25e253c8 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -824,6 +824,49 @@ static inline void hid_hw_stop(struct hid_device *hdev)
824 hdev->ll_driver->stop(hdev); 824 hdev->ll_driver->stop(hdev);
825} 825}
826 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 */
836static 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 */
850static 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
865static 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
827void hid_report_raw_event(struct hid_device *hid, int type, u8 *data, int size, 870void hid_report_raw_event(struct hid_device *hid, int type, u8 *data, int size,
828 int interrupt); 871 int interrupt);
829 872
@@ -842,12 +885,32 @@ int hid_pidff_init(struct hid_device *hid);
842#define hid_pidff_init NULL 885#define hid_pidff_init NULL
843#endif 886#endif
844 887
845#define dbg_hid(format, arg...) if (hid_debug) \ 888#define dbg_hid(format, arg...) \
846 printk(KERN_DEBUG "%s: " format ,\ 889do { \
847 __FILE__ , ## arg) 890 if (hid_debug) \
848#define err_hid(format, arg...) printk(KERN_ERR "%s: " format "\n" , \ 891 printk(KERN_DEBUG "%s: " format, __FILE__, ##arg); \
849 __FILE__ , ## arg) 892} while (0)
850#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__ */
851 914
852#endif 915#endif
853 916