From patchwork Mon Jul 18 14:29:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kepplinger-Novakovic X-Patchwork-Id: 9234685 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3845260865 for ; Mon, 18 Jul 2016 14:29:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2BA39228C8 for ; Mon, 18 Jul 2016 14:29:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 20372269E2; Mon, 18 Jul 2016 14:29:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3CFDF26490 for ; Mon, 18 Jul 2016 14:29:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752367AbcGRO3d (ORCPT ); Mon, 18 Jul 2016 10:29:33 -0400 Received: from mout02.posteo.de ([185.67.36.66]:52835 "EHLO mout02.posteo.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752293AbcGRO31 (ORCPT ); Mon, 18 Jul 2016 10:29:27 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 1F7B920F84 for ; Mon, 18 Jul 2016 16:29:21 +0200 (CEST) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 3rtQXv31tPz104m; Mon, 18 Jul 2016 16:29:19 +0200 (CEST) From: Martin Kepplinger To: dmitry.torokhov@gmail.com Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, Martin Kepplinger Subject: [PATCH 4/4] input: tablet: pegasus_notetaker: Set device mode in reset_resume() if in use Date: Mon, 18 Jul 2016 16:29:09 +0200 Message-Id: <1468852149-2614-5-git-send-email-martink@posteo.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1468852149-2614-1-git-send-email-martink@posteo.de> References: <1468852149-2614-1-git-send-email-martink@posteo.de> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Martin Kepplinger --- drivers/input/tablet/pegasus_notetaker.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/input/tablet/pegasus_notetaker.c b/drivers/input/tablet/pegasus_notetaker.c index 07436c6..b172247 100644 --- a/drivers/input/tablet/pegasus_notetaker.c +++ b/drivers/input/tablet/pegasus_notetaker.c @@ -398,7 +398,19 @@ static int pegasus_resume(struct usb_interface *intf) static int pegasus_reset_resume(struct usb_interface *intf) { - return pegasus_resume(intf); + struct pegasus *pegasus = usb_get_intfdata(intf); + int retval = 0; + + mutex_lock(&pegasus->dev->mutex); + if (pegasus->dev->users) { + retval = pegasus_set_mode(pegasus, PEN_MODE_XY, + NOTETAKER_LED_MOUSE); + if (!retval && usb_submit_urb(pegasus->irq, GFP_NOIO) < 0) + retval = -EIO; + } + mutex_unlock(&pegasus->dev->mutex); + + return retval; } static const struct usb_device_id pegasus_ids[] = {