diff options
author | Jaikumar Ganesh <jaikumarg@android.com> | 2011-09-20 16:40:43 -0700 |
---|---|---|
committer | Arve Hjønnevåg <arve@android.com> | 2013-07-01 13:40:37 -0700 |
commit | 5925993fe56e1a4ddb26d2085fdd16f6a6153365 (patch) | |
tree | ce4ce08a6a0447f72fdf045d6ecbe2fc673c34da /drivers/hid/hid-input.c | |
parent | e584105db8de7ff57c8a4d6c8e2d2efa4827b7bb (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>
Changed to add return code to input_configured instead of
adding input_register
Signed-off-by: Arve Hjønnevåg <arve@android.com>
Diffstat (limited to 'drivers/hid/hid-input.c')
-rw-r--r-- | drivers/hid/hid-input.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index 945b8158ec4..4602d291c9b 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c @@ -1321,8 +1321,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 (drv->input_configured) - drv->input_configured(hid, hidinput); + if (drv->input_configured && + drv->input_configured(hid, hidinput)) + goto out_cleanup; if (input_register_device(hidinput->input)) goto out_cleanup; hidinput = NULL; @@ -1343,8 +1344,9 @@ int hidinput_connect(struct hid_device *hid, unsigned int force) } if (hidinput) { - if (drv->input_configured) - drv->input_configured(hid, hidinput); + if (drv->input_configured && + drv->input_configured(hid, hidinput)) + goto out_cleanup; if (input_register_device(hidinput->input)) goto out_cleanup; } |