From patchwork Mon Dec 13 14:59:13 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Tissoires X-Patchwork-Id: 406582 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oBDFAMce019055 for ; Mon, 13 Dec 2010 15:10:22 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757664Ab0LMPJf (ORCPT ); Mon, 13 Dec 2010 10:09:35 -0500 Received: from 89-230.252-81.static-ip.oleane.fr ([81.252.230.89]:39627 "EHLO smtp.lii-enac.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758005Ab0LMPJe (ORCPT ); Mon, 13 Dec 2010 10:09:34 -0500 Received: from gloupti.lii-enac.fr (unknown [10.0.0.110]) by smtp.lii-enac.fr (DoorWays) with ESMTP id DC9DD9523D; Mon, 13 Dec 2010 15:59:06 +0100 (CET) From: Benjamin Tissoires To: Dmitry Torokhov , Jiri Kosina , Stephane Chatty , Henrik Rydberg , linux-input@vger.kernel.org Cc: Benjamin Tissoires Subject: [PATCH 2/2] hid-mosart: support suspend/resume Date: Mon, 13 Dec 2010 15:59:13 +0100 Message-Id: <1292252353-3029-3-git-send-email-benjamin.tissoires@enac.fr> X-Mailer: git-send-email 1.7.3.2 In-Reply-To: <1292252353-3029-1-git-send-email-benjamin.tissoires@enac.fr> References: <1292252353-3029-1-git-send-email-benjamin.tissoires@enac.fr> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Mon, 13 Dec 2010 15:10:23 +0000 (UTC) diff --git a/drivers/hid/hid-mosart.c b/drivers/hid/hid-mosart.c index acd8a49..15d0381 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) return ret; } +#ifdef CONFIG_PM +static int mosart_reset_resume(struct hid_device *hdev) +{ + struct hid_report_enum *re = hdev->report_enum + + HID_FEATURE_REPORT; + struct hid_report *r = re->report_id_hash[7]; + + r->field[0]->value[0] = 0x02; + usbhid_submit_report(hdev, r, USB_DIR_OUT); + return 0; +} +#endif + static void mosart_remove(struct hid_device *hdev) { hid_hw_stop(hdev); @@ -262,6 +275,9 @@ static struct hid_driver mosart_driver = { .input_mapped = mosart_input_mapped, .usage_table = mosart_grabbed_usages, .event = mosart_event, +#ifdef CONFIG_PM + .reset_resume = mosart_reset_resume, +#endif }; static int __init mosart_init(void)