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.h27
1 files changed, 23 insertions, 4 deletions
diff --git a/include/linux/hid.h b/include/linux/hid.h
index deed5f9a1e1c..8ac51d6e81e0 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -72,6 +72,7 @@
72#include <linux/workqueue.h> 72#include <linux/workqueue.h>
73#include <linux/input.h> 73#include <linux/input.h>
74#include <linux/semaphore.h> 74#include <linux/semaphore.h>
75#include <linux/power_supply.h>
75 76
76/* 77/*
77 * We parse each description item into this structure. Short items data 78 * We parse each description item into this structure. Short items data
@@ -190,6 +191,7 @@ struct hid_item {
190#define HID_UP_UNDEFINED 0x00000000 191#define HID_UP_UNDEFINED 0x00000000
191#define HID_UP_GENDESK 0x00010000 192#define HID_UP_GENDESK 0x00010000
192#define HID_UP_SIMULATION 0x00020000 193#define HID_UP_SIMULATION 0x00020000
194#define HID_UP_GENDEVCTRLS 0x00060000
193#define HID_UP_KEYBOARD 0x00070000 195#define HID_UP_KEYBOARD 0x00070000
194#define HID_UP_LED 0x00080000 196#define HID_UP_LED 0x00080000
195#define HID_UP_BUTTON 0x00090000 197#define HID_UP_BUTTON 0x00090000
@@ -239,6 +241,8 @@ struct hid_item {
239#define HID_GD_RIGHT 0x00010092 241#define HID_GD_RIGHT 0x00010092
240#define HID_GD_LEFT 0x00010093 242#define HID_GD_LEFT 0x00010093
241 243
244#define HID_DC_BATTERYSTRENGTH 0x00060020
245
242#define HID_DG_DIGITIZER 0x000d0001 246#define HID_DG_DIGITIZER 0x000d0001
243#define HID_DG_PEN 0x000d0002 247#define HID_DG_PEN 0x000d0002
244#define HID_DG_LIGHTPEN 0x000d0003 248#define HID_DG_LIGHTPEN 0x000d0003
@@ -482,6 +486,18 @@ struct hid_device { /* device report descriptor */
482 struct hid_driver *driver; 486 struct hid_driver *driver;
483 struct hid_ll_driver *ll_driver; 487 struct hid_ll_driver *ll_driver;
484 488
489#ifdef CONFIG_HID_BATTERY_STRENGTH
490 /*
491 * Power supply information for HID devices which report
492 * battery strength. power_supply is registered iff
493 * battery.name is non-NULL.
494 */
495 struct power_supply battery;
496 __s32 battery_min;
497 __s32 battery_max;
498 __s32 battery_val;
499#endif
500
485 unsigned int status; /* see STAT flags above */ 501 unsigned int status; /* see STAT flags above */
486 unsigned claimed; /* Claimed by hidinput, hiddev? */ 502 unsigned claimed; /* Claimed by hidinput, hiddev? */
487 unsigned quirks; /* Various quirks the device can pull on us */ 503 unsigned quirks; /* Various quirks the device can pull on us */
@@ -697,10 +713,11 @@ extern void hid_destroy_device(struct hid_device *);
697 713
698extern int __must_check __hid_register_driver(struct hid_driver *, 714extern int __must_check __hid_register_driver(struct hid_driver *,
699 struct module *, const char *mod_name); 715 struct module *, const char *mod_name);
700static inline int __must_check hid_register_driver(struct hid_driver *driver) 716
701{ 717/* use a define to avoid include chaining to get THIS_MODULE & friends */
702 return __hid_register_driver(driver, THIS_MODULE, KBUILD_MODNAME); 718#define hid_register_driver(driver) \
703} 719 __hid_register_driver(driver, THIS_MODULE, KBUILD_MODNAME)
720
704extern void hid_unregister_driver(struct hid_driver *); 721extern void hid_unregister_driver(struct hid_driver *);
705 722
706extern void hidinput_hid_event(struct hid_device *, struct hid_field *, struct hid_usage *, __s32); 723extern void hidinput_hid_event(struct hid_device *, struct hid_field *, struct hid_usage *, __s32);
@@ -711,6 +728,8 @@ extern void hidinput_disconnect(struct hid_device *);
711int hid_set_field(struct hid_field *, unsigned, __s32); 728int hid_set_field(struct hid_field *, unsigned, __s32);
712int hid_input_report(struct hid_device *, int type, u8 *, int, int); 729int hid_input_report(struct hid_device *, int type, u8 *, int, int);
713int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int code, struct hid_field **field); 730int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int code, struct hid_field **field);
731struct hid_field *hidinput_get_led_field(struct hid_device *hid);
732unsigned int hidinput_count_leds(struct hid_device *hid);
714void hid_output_report(struct hid_report *report, __u8 *data); 733void hid_output_report(struct hid_report *report, __u8 *data);
715struct hid_device *hid_allocate_device(void); 734struct hid_device *hid_allocate_device(void);
716struct hid_report *hid_register_report(struct hid_device *device, unsigned type, unsigned id); 735struct hid_report *hid_register_report(struct hid_device *device, unsigned type, unsigned id);