diff options
author | Jiri Kosina <jkosina@suse.cz> | 2006-12-08 12:40:53 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-12-08 13:43:12 -0500 |
commit | 229695e51efc4ed5e04ab471c82591d0f432909d (patch) | |
tree | 9e333780589010c61224f185a4a83323305e7d8d /drivers/usb | |
parent | dde5845a529ff753364a6d1aea61180946270bfa (diff) |
[PATCH] Generic HID layer - API
- fixed generic API (added neccessary EXPORT_SYMBOL, fixed hid.h to provide correct
prototypes)
- extended hid_device with open/close/event function pointers to driver-specific
functions
- added driver specific driver_data to hid_device
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/input/hid-core.c | 9 | ||||
-rw-r--r-- | drivers/usb/input/hid-ff.c | 2 | ||||
-rw-r--r-- | drivers/usb/input/hiddev.c | 2 |
3 files changed, 11 insertions, 2 deletions
diff --git a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c index 06e169b6a17e..462947f74135 100644 --- a/drivers/usb/input/hid-core.c +++ b/drivers/usb/input/hid-core.c | |||
@@ -497,7 +497,7 @@ void hid_submit_report(struct hid_device *hid, struct hid_report *report, unsign | |||
497 | spin_unlock_irqrestore(&hid->ctrllock, flags); | 497 | spin_unlock_irqrestore(&hid->ctrllock, flags); |
498 | } | 498 | } |
499 | 499 | ||
500 | static int hidinput_input_event(struct input_dev *dev, unsigned int type, unsigned int code, int value) | 500 | static int usb_hidinput_input_event(struct input_dev *dev, unsigned int type, unsigned int code, int value) |
501 | { | 501 | { |
502 | struct hid_device *hid = dev->private; | 502 | struct hid_device *hid = dev->private; |
503 | struct hid_field *field; | 503 | struct hid_field *field; |
@@ -1231,6 +1231,10 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf) | |||
1231 | le16_to_cpu(dev->descriptor.idVendor), | 1231 | le16_to_cpu(dev->descriptor.idVendor), |
1232 | le16_to_cpu(dev->descriptor.idProduct)); | 1232 | le16_to_cpu(dev->descriptor.idProduct)); |
1233 | 1233 | ||
1234 | hid->bus = BUS_USB; | ||
1235 | hid->vendor = dev->descriptor.idVendor; | ||
1236 | hid->product = dev->descriptor.idProduct; | ||
1237 | |||
1234 | usb_make_path(dev, hid->phys, sizeof(hid->phys)); | 1238 | usb_make_path(dev, hid->phys, sizeof(hid->phys)); |
1235 | strlcat(hid->phys, "/input", sizeof(hid->phys)); | 1239 | strlcat(hid->phys, "/input", sizeof(hid->phys)); |
1236 | len = strlen(hid->phys); | 1240 | len = strlen(hid->phys); |
@@ -1250,6 +1254,9 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf) | |||
1250 | hid->urbctrl->setup_dma = hid->cr_dma; | 1254 | hid->urbctrl->setup_dma = hid->cr_dma; |
1251 | hid->urbctrl->transfer_dma = hid->ctrlbuf_dma; | 1255 | hid->urbctrl->transfer_dma = hid->ctrlbuf_dma; |
1252 | hid->urbctrl->transfer_flags |= (URB_NO_TRANSFER_DMA_MAP | URB_NO_SETUP_DMA_MAP); | 1256 | hid->urbctrl->transfer_flags |= (URB_NO_TRANSFER_DMA_MAP | URB_NO_SETUP_DMA_MAP); |
1257 | hid->hidinput_input_event = usb_hidinput_input_event; | ||
1258 | hid->hidinput_open = hidinput_open; | ||
1259 | hid->hidinput_close = hidinput_close; | ||
1253 | 1260 | ||
1254 | return hid; | 1261 | return hid; |
1255 | 1262 | ||
diff --git a/drivers/usb/input/hid-ff.c b/drivers/usb/input/hid-ff.c index 4187f4ee9a9c..7ecdafa8eb7b 100644 --- a/drivers/usb/input/hid-ff.c +++ b/drivers/usb/input/hid-ff.c | |||
@@ -79,3 +79,5 @@ int hid_ff_init(struct hid_device* hid) | |||
79 | 79 | ||
80 | return init->init(hid); | 80 | return init->init(hid); |
81 | } | 81 | } |
82 | EXPORT_SYMBOL_GPL(hid_ff_init); | ||
83 | |||
diff --git a/drivers/usb/input/hiddev.c b/drivers/usb/input/hiddev.c index cbd3b60d93bb..07d7996575cd 100644 --- a/drivers/usb/input/hiddev.c +++ b/drivers/usb/input/hiddev.c | |||
@@ -197,7 +197,7 @@ void hiddev_hid_event(struct hid_device *hid, struct hid_field *field, | |||
197 | 197 | ||
198 | hiddev_send_event(hid, &uref); | 198 | hiddev_send_event(hid, &uref); |
199 | } | 199 | } |
200 | 200 | EXPORT_SYMBOL_GPL(hiddev_hid_event); | |
201 | 201 | ||
202 | void hiddev_report_event(struct hid_device *hid, struct hid_report *report) | 202 | void hiddev_report_event(struct hid_device *hid, struct hid_report *report) |
203 | { | 203 | { |