diff options
Diffstat (limited to 'include/linux/hid.h')
-rw-r--r-- | include/linux/hid.h | 52 |
1 files changed, 9 insertions, 43 deletions
diff --git a/include/linux/hid.h b/include/linux/hid.h index 7e1f37db7582..7330a0fef0c0 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h @@ -1,12 +1,8 @@ -#ifndef __HID_H -#define __HID_H - /* * Copyright (c) 1999 Andreas Gal * Copyright (c) 2000-2001 Vojtech Pavlik * Copyright (c) 2006-2007 Jiri Kosina */ - /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,43 +22,9 @@ * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail: * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#ifndef __HID_H +#define __HID_H -/* - * USB HID (Human Interface Device) interface class code - */ - -#define USB_INTERFACE_CLASS_HID 3 - -/* - * USB HID interface subclass and protocol codes - */ - -#define USB_INTERFACE_SUBCLASS_BOOT 1 -#define USB_INTERFACE_PROTOCOL_KEYBOARD 1 -#define USB_INTERFACE_PROTOCOL_MOUSE 2 - -/* - * HID class requests - */ - -#define HID_REQ_GET_REPORT 0x01 -#define HID_REQ_GET_IDLE 0x02 -#define HID_REQ_GET_PROTOCOL 0x03 -#define HID_REQ_SET_REPORT 0x09 -#define HID_REQ_SET_IDLE 0x0A -#define HID_REQ_SET_PROTOCOL 0x0B - -/* - * HID class descriptor types - */ - -#define HID_DT_HID (USB_TYPE_CLASS | 0x01) -#define HID_DT_REPORT (USB_TYPE_CLASS | 0x02) -#define HID_DT_PHYSICAL (USB_TYPE_CLASS | 0x03) - -#define HID_MAX_DESCRIPTOR_SIZE 4096 - -#ifdef __KERNEL__ #include <linux/types.h> #include <linux/slab.h> @@ -73,6 +35,7 @@ #include <linux/input.h> #include <linux/semaphore.h> #include <linux/power_supply.h> +#include <uapi/linux/hid.h> /* * We parse each description item into this structure. Short items data @@ -204,6 +167,7 @@ struct hid_item { #define HID_UP_MSVENDOR 0xff000000 #define HID_UP_CUSTOM 0x00ff0000 #define HID_UP_LOGIVENDOR 0xffbc0000 +#define HID_UP_SENSOR 0x00200000 #define HID_USAGE 0x0000ffff @@ -329,6 +293,7 @@ struct hid_item { */ #define HID_GROUP_GENERIC 0x0001 #define HID_GROUP_MULTITOUCH 0x0002 +#define HID_GROUP_SENSOR_HUB 0x0003 /* * This is the global environment of the parser. This information is @@ -379,6 +344,7 @@ struct hid_collection { struct hid_usage { unsigned hid; /* hid usage code */ unsigned collection_index; /* index into collection array */ + unsigned usage_index; /* index into usage array */ /* hidinput data */ __u16 code; /* input driver code */ __u8 type; /* input driver type */ @@ -721,6 +687,7 @@ struct hid_ll_driver { extern int hid_debug; +extern bool hid_ignore(struct hid_device *); extern int hid_add_device(struct hid_device *); extern void hid_destroy_device(struct hid_device *); @@ -743,6 +710,7 @@ int hid_input_report(struct hid_device *, int type, u8 *, int, int); int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int code, struct hid_field **field); struct hid_field *hidinput_get_led_field(struct hid_device *hid); unsigned int hidinput_count_leds(struct hid_device *hid); +__s32 hidinput_calc_abs_res(const struct hid_field *field, __u16 code); void hid_output_report(struct hid_report *report, __u8 *data); struct hid_device *hid_allocate_device(void); struct hid_report *hid_register_report(struct hid_device *device, unsigned type, unsigned id); @@ -753,6 +721,7 @@ int hid_connect(struct hid_device *hid, unsigned int connect_mask); void hid_disconnect(struct hid_device *hid); const struct hid_device_id *hid_match_id(struct hid_device *hdev, const struct hid_device_id *id); +s32 hid_snto32(__u32 value, unsigned n); /** * hid_map_usage - map usage input bits @@ -943,7 +912,4 @@ do { \ #define hid_dbg(hid, fmt, arg...) \ dev_dbg(&(hid)->dev, fmt, ##arg) -#endif /* __KERNEL__ */ - #endif - |