From: Martin Kepplinger <martink@posteo.de>
To: dmitry.torokhov@gmail.com
Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org,
kernel-testers@vger.kernel.org, linux-usb@vger.kernel.org,
Martin Kepplinger <martink@posteo.de>
Subject: [PATCH v2] input: tablet: pegasus_notetaker: USB PM fixes
Date: Tue, 14 Jun 2016 13:20:15 +0200 [thread overview]
Message-ID: <1465903215-2351-1-git-send-email-martink@posteo.de> (raw)
* Fix usb_autopm calls to be balanced
* In reset_resume() we need to set the device mode
* In suspend() we must cancel the workqueue's work
Signed-off-by: Martin Kepplinger <martink@posteo.de>
---
Thanks Oliver, I think I got it now.
Dmitry, again, do you want to have a new version of the whole driver
instead of this?
drivers/input/tablet/pegasus_notetaker.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/input/tablet/pegasus_notetaker.c b/drivers/input/tablet/pegasus_notetaker.c
index 83aa583..0c000d8 100644
--- a/drivers/input/tablet/pegasus_notetaker.c
+++ b/drivers/input/tablet/pegasus_notetaker.c
@@ -211,14 +211,9 @@ static int pegasus_open(struct input_dev *dev)
static void pegasus_close(struct input_dev *dev)
{
struct pegasus *pegasus = input_get_drvdata(dev);
- int autopm_error;
- autopm_error = usb_autopm_get_interface(pegasus->intf);
usb_kill_urb(pegasus->irq);
cancel_work_sync(&pegasus->init);
-
- if (!autopm_error)
- usb_autopm_put_interface(pegasus->intf);
}
static int pegasus_probe(struct usb_interface *intf,
@@ -364,6 +359,7 @@ static int pegasus_suspend(struct usb_interface *intf, pm_message_t message)
mutex_lock(&pegasus->dev->mutex);
usb_kill_urb(pegasus->irq);
+ cancel_work_sync(&pegasus->init);
mutex_unlock(&pegasus->dev->mutex);
return 0;
@@ -384,6 +380,11 @@ static int pegasus_resume(struct usb_interface *intf)
static int pegasus_reset_resume(struct usb_interface *intf)
{
+ struct pegasus *pegasus = usb_get_intfdata(intf);
+
+ if (pegasus->dev->users)
+ pegasus_set_mode(pegasus, PEN_MODE_XY, NOTETAKER_LED_MOUSE);
+
return pegasus_resume(intf);
}
--
2.1.4
next reply other threads:[~2016-06-14 11:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-14 11:20 Martin Kepplinger [this message]
[not found] ` <1465903215-2351-1-git-send-email-martink-1KBjaw7Xf1+zQB+pC5nmwQ@public.gmane.org>
2016-06-14 11:37 ` [PATCH v2] input: tablet: pegasus_notetaker: USB PM fixes Oliver Neukum
2016-06-15 13:01 ` [PATCH v9] input: tablet: add Pegasus Notetaker tablet driver Martin Kepplinger
2016-06-23 15:50 ` Martin Kepplinger
2016-06-23 17:18 ` [PATCH v2] input: tablet: pegasus_notetaker: USB PM fixes Dmitry Torokhov
2016-06-28 16:17 ` Martin Kepplinger
[not found] ` <246597fa-6a85-1128-853d-3ebdf6f41032-1KBjaw7Xf1+zQB+pC5nmwQ@public.gmane.org>
2016-07-08 21:08 ` Dmitry Torokhov
2016-07-09 12:07 ` Martin Kepplinger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1465903215-2351-1-git-send-email-martink@posteo.de \
--to=martink@posteo.de \
--cc=dmitry.torokhov@gmail.com \
--cc=kernel-testers@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).