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/hid/hid-input.c | |
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/hid/hid-input.c')
-rw-r--r-- | drivers/hid/hid-input.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index d459005062e0..6d3d80ba9582 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c | |||
@@ -727,8 +727,9 @@ void hidinput_report_event(struct hid_device *hid, struct hid_report *report) | |||
727 | list_for_each_entry(hidinput, &hid->inputs, list) | 727 | list_for_each_entry(hidinput, &hid->inputs, list) |
728 | input_sync(hidinput->input); | 728 | input_sync(hidinput->input); |
729 | } | 729 | } |
730 | EXPORT_SYMBOL_GPL(hidinput_report_event); | ||
730 | 731 | ||
731 | static int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int code, struct hid_field **field) | 732 | int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int code, struct hid_field **field) |
732 | { | 733 | { |
733 | struct hid_report *report; | 734 | struct hid_report *report; |
734 | int i, j; | 735 | int i, j; |
@@ -743,6 +744,7 @@ static int hidinput_find_field(struct hid_device *hid, unsigned int type, unsign | |||
743 | } | 744 | } |
744 | return -1; | 745 | return -1; |
745 | } | 746 | } |
747 | EXPORT_SYMBOL_GPL(hidinput_find_field); | ||
746 | 748 | ||
747 | /* | 749 | /* |
748 | * Register the input device; print a message. | 750 | * Register the input device; print a message. |
@@ -752,7 +754,6 @@ static int hidinput_find_field(struct hid_device *hid, unsigned int type, unsign | |||
752 | 754 | ||
753 | int hidinput_connect(struct hid_device *hid) | 755 | int hidinput_connect(struct hid_device *hid) |
754 | { | 756 | { |
755 | struct usb_device *dev = hid->dev; | ||
756 | struct hid_report *report; | 757 | struct hid_report *report; |
757 | struct hid_input *hidinput = NULL; | 758 | struct hid_input *hidinput = NULL; |
758 | struct input_dev *input_dev; | 759 | struct input_dev *input_dev; |
@@ -786,14 +787,17 @@ int hidinput_connect(struct hid_device *hid) | |||
786 | } | 787 | } |
787 | 788 | ||
788 | input_dev->private = hid; | 789 | input_dev->private = hid; |
789 | input_dev->event = hidinput_input_event; | 790 | input_dev->event = hid->hidinput_input_event; |
790 | input_dev->open = hidinput_open; | 791 | input_dev->open = hid->hidinput_open; |
791 | input_dev->close = hidinput_close; | 792 | input_dev->close = hid->hidinput_close; |
792 | 793 | ||
793 | input_dev->name = hid->name; | 794 | input_dev->name = hid->name; |
794 | input_dev->phys = hid->phys; | 795 | input_dev->phys = hid->phys; |
795 | input_dev->uniq = hid->uniq; | 796 | input_dev->uniq = hid->uniq; |
796 | usb_to_input_id(dev, &input_dev->id); | 797 | input_dev->id.bustype = hid->bus; |
798 | input_dev->id.vendor = hid->vendor; | ||
799 | input_dev->id.product = hid->product; | ||
800 | input_dev->id.version = hid->version; | ||
797 | input_dev->cdev.dev = &hid->intf->dev; | 801 | input_dev->cdev.dev = &hid->intf->dev; |
798 | 802 | ||
799 | hidinput->input = input_dev; | 803 | hidinput->input = input_dev; |
@@ -827,6 +831,7 @@ int hidinput_connect(struct hid_device *hid) | |||
827 | 831 | ||
828 | return 0; | 832 | return 0; |
829 | } | 833 | } |
834 | EXPORT_SYMBOL_GPL(hidinput_connect); | ||
830 | 835 | ||
831 | void hidinput_disconnect(struct hid_device *hid) | 836 | void hidinput_disconnect(struct hid_device *hid) |
832 | { | 837 | { |
@@ -838,3 +843,5 @@ void hidinput_disconnect(struct hid_device *hid) | |||
838 | kfree(hidinput); | 843 | kfree(hidinput); |
839 | } | 844 | } |
840 | } | 845 | } |
846 | EXPORT_SYMBOL_GPL(hidinput_disconnect); | ||
847 | |||