From 229695e51efc4ed5e04ab471c82591d0f432909d Mon Sep 17 00:00:00 2001 From: Jiri Kosina Date: Fri, 8 Dec 2006 18:40:53 +0100 Subject: [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 Signed-off-by: Marcel Holtmann Cc: Dmitry Torokhov Signed-off-by: Greg Kroah-Hartman --- drivers/usb/input/hid-core.c | 9 ++++++++- drivers/usb/input/hid-ff.c | 2 ++ drivers/usb/input/hiddev.c | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) (limited to 'drivers/usb/input') diff --git a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c index 06e169b6a17..462947f7413 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 spin_unlock_irqrestore(&hid->ctrllock, flags); } -static int hidinput_input_event(struct input_dev *dev, unsigned int type, unsigned int code, int value) +static int usb_hidinput_input_event(struct input_dev *dev, unsigned int type, unsigned int code, int value) { struct hid_device *hid = dev->private; struct hid_field *field; @@ -1231,6 +1231,10 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf) le16_to_cpu(dev->descriptor.idVendor), le16_to_cpu(dev->descriptor.idProduct)); + hid->bus = BUS_USB; + hid->vendor = dev->descriptor.idVendor; + hid->product = dev->descriptor.idProduct; + usb_make_path(dev, hid->phys, sizeof(hid->phys)); strlcat(hid->phys, "/input", sizeof(hid->phys)); len = strlen(hid->phys); @@ -1250,6 +1254,9 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf) hid->urbctrl->setup_dma = hid->cr_dma; hid->urbctrl->transfer_dma = hid->ctrlbuf_dma; hid->urbctrl->transfer_flags |= (URB_NO_TRANSFER_DMA_MAP | URB_NO_SETUP_DMA_MAP); + hid->hidinput_input_event = usb_hidinput_input_event; + hid->hidinput_open = hidinput_open; + hid->hidinput_close = hidinput_close; return hid; diff --git a/drivers/usb/input/hid-ff.c b/drivers/usb/input/hid-ff.c index 4187f4ee9a9..7ecdafa8eb7 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) return init->init(hid); } +EXPORT_SYMBOL_GPL(hid_ff_init); + diff --git a/drivers/usb/input/hiddev.c b/drivers/usb/input/hiddev.c index cbd3b60d93b..07d7996575c 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, hiddev_send_event(hid, &uref); } - +EXPORT_SYMBOL_GPL(hiddev_hid_event); void hiddev_report_event(struct hid_device *hid, struct hid_report *report) { -- cgit v1.2.3-70-g09d2