diff options
author | Benjamin Tissoires <benjamin.tissoires@enac.fr> | 2010-12-13 09:59:13 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2010-12-14 05:40:51 -0500 |
commit | c25bcd340033bf5b8dc30c16a99e64259f099446 (patch) | |
tree | 0fb99db0208660e188494f8d0d1bf23c5cec0388 /drivers | |
parent | ad6d42670279da8f33f633f8a96a67cd7ef3b1da (diff) |
HID: hid-mosart: support suspend/resume
The device has 2 modes. The first one is an emulation of a touchscreen
by sending left and right button, and the second mode is the one used in
dual-touch (sending trackingID, touch and else).
In case of a suspend/resume, the device switch back to the first mode
described above (with left and right buttons).
This adds a hook in .reset_resume for the device to be switched to
the correct mode (I just copied the code in mosart_probe).
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/hid/hid-mosart.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/hid/hid-mosart.c b/drivers/hid/hid-mosart.c index acd8a4983c09..15d03811f96a 100644 --- a/drivers/hid/hid-mosart.c +++ b/drivers/hid/hid-mosart.c | |||
@@ -234,6 +234,19 @@ static int mosart_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
234 | return ret; | 234 | return ret; |
235 | } | 235 | } |
236 | 236 | ||
237 | #ifdef CONFIG_PM | ||
238 | static int mosart_reset_resume(struct hid_device *hdev) | ||
239 | { | ||
240 | struct hid_report_enum *re = hdev->report_enum | ||
241 | + HID_FEATURE_REPORT; | ||
242 | struct hid_report *r = re->report_id_hash[7]; | ||
243 | |||
244 | r->field[0]->value[0] = 0x02; | ||
245 | usbhid_submit_report(hdev, r, USB_DIR_OUT); | ||
246 | return 0; | ||
247 | } | ||
248 | #endif | ||
249 | |||
237 | static void mosart_remove(struct hid_device *hdev) | 250 | static void mosart_remove(struct hid_device *hdev) |
238 | { | 251 | { |
239 | hid_hw_stop(hdev); | 252 | hid_hw_stop(hdev); |
@@ -262,6 +275,9 @@ static struct hid_driver mosart_driver = { | |||
262 | .input_mapped = mosart_input_mapped, | 275 | .input_mapped = mosart_input_mapped, |
263 | .usage_table = mosart_grabbed_usages, | 276 | .usage_table = mosart_grabbed_usages, |
264 | .event = mosart_event, | 277 | .event = mosart_event, |
278 | #ifdef CONFIG_PM | ||
279 | .reset_resume = mosart_reset_resume, | ||
280 | #endif | ||
265 | }; | 281 | }; |
266 | 282 | ||
267 | static int __init mosart_init(void) | 283 | static int __init mosart_init(void) |