diff options
author | Henrik Rydberg <rydberg@euromail.se> | 2012-07-30 07:28:18 -0400 |
---|---|---|
committer | Henrik Rydberg <rydberg@euromail.se> | 2012-09-19 13:50:20 -0400 |
commit | 9ebf3d7687192923e3d44fdbcd8d9f8375053fb8 (patch) | |
tree | 6973ce11e93dc97c3d5766bbc8f8b45814c0688e /drivers/hid | |
parent | 22739293402966db7ca3eb0148632d986fe30465 (diff) |
HID: Add an input configured notification callback
A hid device may create several input devices, and a driver may need
to prepare or finalize the configuration per input device. Currently,
there is no sane way for a driver to know when a device has been
configured. This patch adds a callback providing that information.
Reviewed-and-tested-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Tested-by: Ping Cheng <pingc@wacom.com>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'drivers/hid')
-rw-r--r-- | drivers/hid/hid-input.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index 811bfad64609..d917c0d53685 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c | |||
@@ -1154,6 +1154,7 @@ static void report_features(struct hid_device *hid) | |||
1154 | 1154 | ||
1155 | int hidinput_connect(struct hid_device *hid, unsigned int force) | 1155 | int hidinput_connect(struct hid_device *hid, unsigned int force) |
1156 | { | 1156 | { |
1157 | struct hid_driver *drv = hid->driver; | ||
1157 | struct hid_report *report; | 1158 | struct hid_report *report; |
1158 | struct hid_input *hidinput = NULL; | 1159 | struct hid_input *hidinput = NULL; |
1159 | struct input_dev *input_dev; | 1160 | struct input_dev *input_dev; |
@@ -1228,6 +1229,8 @@ int hidinput_connect(struct hid_device *hid, unsigned int force) | |||
1228 | * UGCI) cram a lot of unrelated inputs into the | 1229 | * UGCI) cram a lot of unrelated inputs into the |
1229 | * same interface. */ | 1230 | * same interface. */ |
1230 | hidinput->report = report; | 1231 | hidinput->report = report; |
1232 | if (drv->input_configured) | ||
1233 | drv->input_configured(hid, hidinput); | ||
1231 | if (input_register_device(hidinput->input)) | 1234 | if (input_register_device(hidinput->input)) |
1232 | goto out_cleanup; | 1235 | goto out_cleanup; |
1233 | hidinput = NULL; | 1236 | hidinput = NULL; |
@@ -1235,8 +1238,12 @@ int hidinput_connect(struct hid_device *hid, unsigned int force) | |||
1235 | } | 1238 | } |
1236 | } | 1239 | } |
1237 | 1240 | ||
1238 | if (hidinput && input_register_device(hidinput->input)) | 1241 | if (hidinput) { |
1239 | goto out_cleanup; | 1242 | if (drv->input_configured) |
1243 | drv->input_configured(hid, hidinput); | ||
1244 | if (input_register_device(hidinput->input)) | ||
1245 | goto out_cleanup; | ||
1246 | } | ||
1240 | 1247 | ||
1241 | return 0; | 1248 | return 0; |
1242 | 1249 | ||