提交 dde5845a 编写于 作者: J Jiri Kosina 提交者: Greg Kroah-Hartman

[PATCH] Generic HID layer - code split

The "big main" split of USB HID code into generic HID code and
USB-transport specific HID handling.
Signed-off-by: NJiri Kosina <jkosina@suse.cz>
Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 64bb67b1
此差异已折叠。
此差异已折叠。
此差异已折叠。
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#undef DEBUG #undef DEBUG
#include <linux/usb.h> #include <linux/usb.h>
#include "hid.h" #include <linux/hid.h>
/* /*
* This table contains pointers to initializers. To add support for new * This table contains pointers to initializers. To add support for new
......
此差异已折叠。
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#include <linux/input.h> #include <linux/input.h>
#include <linux/usb.h> #include <linux/usb.h>
#include "hid.h" #include <linux/hid.h>
struct device_type { struct device_type {
u16 idVendor; u16 idVendor;
......
...@@ -28,7 +28,9 @@ ...@@ -28,7 +28,9 @@
#include <linux/input.h> #include <linux/input.h>
#include <linux/usb.h> #include <linux/usb.h>
#include "hid.h" #include <linux/hid.h>
#include "usbhid.h"
#define PID_EFFECTS_MAX 64 #define PID_EFFECTS_MAX 64
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#undef DEBUG #undef DEBUG
#include <linux/usb.h> #include <linux/usb.h>
#include "hid.h" #include <linux/hid.h>
/* Usages for thrustmaster devices I know about */ /* Usages for thrustmaster devices I know about */
#define THRUSTMASTER_USAGE_RUMBLE_LR (HID_UP_GENDESK | 0xbb) #define THRUSTMASTER_USAGE_RUMBLE_LR (HID_UP_GENDESK | 0xbb)
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#include <linux/input.h> #include <linux/input.h>
#include <linux/usb.h> #include <linux/usb.h>
#include "hid.h" #include <linux/hid.h>
struct zpff_device { struct zpff_device {
struct hid_report *report; struct hid_report *report;
......
...@@ -32,8 +32,9 @@ ...@@ -32,8 +32,9 @@
#include <linux/smp_lock.h> #include <linux/smp_lock.h>
#include <linux/input.h> #include <linux/input.h>
#include <linux/usb.h> #include <linux/usb.h>
#include "hid.h" #include <linux/hid.h>
#include <linux/hiddev.h> #include <linux/hiddev.h>
#include "usbhid.h"
#ifdef CONFIG_USB_DYNAMIC_MINORS #ifdef CONFIG_USB_DYNAMIC_MINORS
#define HIDDEV_MINOR_BASE 0 #define HIDDEV_MINOR_BASE 0
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
* *
* Copyright (c) 1999 Andreas Gal * Copyright (c) 1999 Andreas Gal
* Copyright (c) 2000-2001 Vojtech Pavlik * Copyright (c) 2000-2001 Vojtech Pavlik
* Copyright (c) 2006 Jiri Kosina
*/ */
/* /*
...@@ -33,6 +34,7 @@ ...@@ -33,6 +34,7 @@
#include <linux/list.h> #include <linux/list.h>
#include <linux/timer.h> #include <linux/timer.h>
#include <linux/workqueue.h> #include <linux/workqueue.h>
#include <linux/input.h>
/* /*
* USB HID (Human Interface Device) interface class code * USB HID (Human Interface Device) interface class code
...@@ -260,7 +262,7 @@ struct hid_item { ...@@ -260,7 +262,7 @@ struct hid_item {
#define HID_QUIRK_POWERBOOK_HAS_FN 0x00001000 #define HID_QUIRK_POWERBOOK_HAS_FN 0x00001000
#define HID_QUIRK_POWERBOOK_FN_ON 0x00002000 #define HID_QUIRK_POWERBOOK_FN_ON 0x00002000
#define HID_QUIRK_INVERT_HWHEEL 0x00004000 #define HID_QUIRK_INVERT_HWHEEL 0x00004000
#define HID_QUIRK_POWERBOOK_ISO_KEYBOARD 0x00008000 #define HID_QUIRK_POWERBOOK_ISO_KEYBOARD 0x00008000
#define HID_QUIRK_BAD_RELATIVE_KEYS 0x00010000 #define HID_QUIRK_BAD_RELATIVE_KEYS 0x00010000
/* /*
...@@ -496,9 +498,7 @@ struct hid_descriptor { ...@@ -496,9 +498,7 @@ struct hid_descriptor {
#define resolv_event(a,b) do { } while (0) #define resolv_event(a,b) do { } while (0)
#endif #endif
#endif #ifdef CONFIG_HID
#ifdef CONFIG_USB_HIDINPUT
/* Applications from HID Usage Tables 4/8/99 Version 1.1 */ /* Applications from HID Usage Tables 4/8/99 Version 1.1 */
/* We ignore a few input applications that are not widely used */ /* We ignore a few input applications that are not widely used */
#define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || (a == 0x000c0001)) #define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || (a == 0x000c0001))
...@@ -514,13 +514,12 @@ static inline int hidinput_connect(struct hid_device *hid) { return -ENODEV; } ...@@ -514,13 +514,12 @@ static inline int hidinput_connect(struct hid_device *hid) { return -ENODEV; }
static inline void hidinput_disconnect(struct hid_device *hid) { } static inline void hidinput_disconnect(struct hid_device *hid) { }
#endif #endif
int hid_open(struct hid_device *);
void hid_close(struct hid_device *);
int hid_set_field(struct hid_field *, unsigned, __s32); int hid_set_field(struct hid_field *, unsigned, __s32);
void hid_submit_report(struct hid_device *, struct hid_report *, unsigned char dir); int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int code, struct hid_field **field);
void hid_init_reports(struct hid_device *hid); void hid_input_field(struct hid_device *hid, struct hid_field *field, __u8 *data, int interrupt);
int hid_wait_io(struct hid_device* hid); void hid_output_report(struct hid_report *report, __u8 *data);
void hid_free_device(struct hid_device *device);
struct hid_device *hid_parse_report(__u8 *start, unsigned size);
#ifdef CONFIG_HID_FF #ifdef CONFIG_HID_FF
int hid_ff_init(struct hid_device *hid); int hid_ff_init(struct hid_device *hid);
...@@ -537,4 +536,5 @@ static inline int hid_pidff_init(struct hid_device *hid) { return -ENODEV; } ...@@ -537,4 +536,5 @@ static inline int hid_pidff_init(struct hid_device *hid) { return -ENODEV; }
#else #else
static inline int hid_ff_init(struct hid_device *hid) { return -1; } static inline int hid_ff_init(struct hid_device *hid) { return -1; }
#endif #endif
#endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册