diff options
author | David Herrmann <dh.herrmann@googlemail.com> | 2011-08-17 05:43:21 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2011-08-23 04:55:11 -0400 |
commit | 26af17484a737aaa991a7ce578cb15809a582fbc (patch) | |
tree | 156964b3d484526339daa99cd32312dd77b9cf7e | |
parent | 3989ef6cfb80825af2f7933415797f052817ac3e (diff) |
HID: wiimote: Correctly call HID open/close callbacks
Even though the bluetooth hid backend does not react on open/close callbacks, we
should call them to be consistent with other hid drivers.
Also the new input open/close handlers will be used in future to prepare the
wiimote device for IR/extension input.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
-rw-r--r-- | drivers/hid/hid-wiimote.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/hid/hid-wiimote.c b/drivers/hid/hid-wiimote.c index 8a68bf515cad..d49f67c7a00c 100644 --- a/drivers/hid/hid-wiimote.c +++ b/drivers/hid/hid-wiimote.c | |||
@@ -239,6 +239,20 @@ static int wiimote_input_event(struct input_dev *dev, unsigned int type, | |||
239 | return 0; | 239 | return 0; |
240 | } | 240 | } |
241 | 241 | ||
242 | static int wiimote_input_open(struct input_dev *dev) | ||
243 | { | ||
244 | struct wiimote_data *wdata = input_get_drvdata(dev); | ||
245 | |||
246 | return hid_hw_open(wdata->hdev); | ||
247 | } | ||
248 | |||
249 | static void wiimote_input_close(struct input_dev *dev) | ||
250 | { | ||
251 | struct wiimote_data *wdata = input_get_drvdata(dev); | ||
252 | |||
253 | hid_hw_close(wdata->hdev); | ||
254 | } | ||
255 | |||
242 | static void handler_keys(struct wiimote_data *wdata, const __u8 *payload) | 256 | static void handler_keys(struct wiimote_data *wdata, const __u8 *payload) |
243 | { | 257 | { |
244 | input_report_key(wdata->input, wiiproto_keymap[WIIPROTO_KEY_LEFT], | 258 | input_report_key(wdata->input, wiiproto_keymap[WIIPROTO_KEY_LEFT], |
@@ -321,6 +335,8 @@ static struct wiimote_data *wiimote_create(struct hid_device *hdev) | |||
321 | 335 | ||
322 | input_set_drvdata(wdata->input, wdata); | 336 | input_set_drvdata(wdata->input, wdata); |
323 | wdata->input->event = wiimote_input_event; | 337 | wdata->input->event = wiimote_input_event; |
338 | wdata->input->open = wiimote_input_open; | ||
339 | wdata->input->close = wiimote_input_close; | ||
324 | wdata->input->dev.parent = &wdata->hdev->dev; | 340 | wdata->input->dev.parent = &wdata->hdev->dev; |
325 | wdata->input->id.bustype = wdata->hdev->bus; | 341 | wdata->input->id.bustype = wdata->hdev->bus; |
326 | wdata->input->id.vendor = wdata->hdev->vendor; | 342 | wdata->input->id.vendor = wdata->hdev->vendor; |