From 5ba755e4043bbf6be5816b7cce5baae89c074e9c Mon Sep 17 00:00:00 2001 From: Jaikumar Ganesh Date: Tue, 20 Sep 2011 16:40:43 -0700 Subject: HID: Add input_register callback. Add input_register callback which gets called after hid_configure_usage is called for all the reports and before the input device is registered. This allows individual drivers to do extra work like input mapping just before device registration. Based on discussions with David Herrmann Change-Id: Idab6fb4f7b1e5e569bd0410967288717e9d34c98 Signed-off-by: Jaikumar Ganesh --- drivers/hid/hid-input.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'drivers/hid') diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index 002781c5a61..9317156d9db 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c @@ -1201,6 +1201,9 @@ int hidinput_connect(struct hid_device *hid, unsigned int force) * UGCI) cram a lot of unrelated inputs into the * same interface. */ hidinput->report = report; + if (hid->driver->input_register && + hid->driver->input_register(hid, hidinput)) + goto out_cleanup; if (input_register_device(hidinput->input)) goto out_cleanup; hidinput = NULL; @@ -1215,6 +1218,10 @@ int hidinput_connect(struct hid_device *hid, unsigned int force) goto out_unwind; } + if (hid->driver->input_register && + hid->driver->input_register(hid, hidinput)) + goto out_cleanup; + if (hidinput && input_register_device(hidinput->input)) goto out_cleanup; -- cgit v1.2.3