diff options
author | Jaikumar Ganesh <jaikumarg@android.com> | 2011-09-20 16:40:43 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:39:07 -0800 |
commit | 20232f65d99109171f6fd54bd2c02fa47f000d40 (patch) | |
tree | 22229a5cac1aa56a9f67737f83ace52a65de8f60 /drivers/hid | |
parent | c3c5c90e1c07da1e8433bbf042e8f55ef40d4ce6 (diff) |
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 <dh.herrmann@googlemail.com>
Change-Id: Idab6fb4f7b1e5e569bd0410967288717e9d34c98
Signed-off-by: Jaikumar Ganesh <jaikumarg@android.com>
Diffstat (limited to 'drivers/hid')
-rw-r--r-- | drivers/hid/hid-input.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index 6559e2e3364e..1b71bcd7ba21 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c @@ -971,6 +971,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; @@ -978,6 +981,10 @@ int hidinput_connect(struct hid_device *hid, unsigned int force) } } + if (hid->driver->input_register && + hid->driver->input_register(hid, hidinput)) + goto out_cleanup; + if (hidinput && input_register_device(hidinput->input)) goto out_cleanup; |