* [PATCH] input: tablet: pegasus_notetaker: USB PM fixes
@ 2016-06-13 13:31 Martin Kepplinger
2016-06-13 14:12 ` Oliver Neukum
0 siblings, 1 reply; 2+ messages in thread
From: Martin Kepplinger @ 2016-06-13 13:31 UTC (permalink / raw)
To: dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-input-u79uwXL29TY76Z2rM5mHXA,
kernel-testers-u79uwXL29TY76Z2rM5mHXA,
linux-usb-u79uwXL29TY76Z2rM5mHXA, Martin Kepplinger
In close() we only need usb_autopm_put_interface(), in reset_resume()
we need to set the device mode, and in suspend(), we must cancel
the workqueue's work.
Signed-off-by: Martin Kepplinger <martink-1KBjaw7Xf1+zQB+pC5nmwQ@public.gmane.org>
---
Thanks Oliver for these changes. For me, everything works as before.
Dmitry, do you want a new version of the whole thing instead of this
fix?
thanks
martin
drivers/input/tablet/pegasus_notetaker.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/input/tablet/pegasus_notetaker.c b/drivers/input/tablet/pegasus_notetaker.c
index 83aa583..0c339e7 100644
--- a/drivers/input/tablet/pegasus_notetaker.c
+++ b/drivers/input/tablet/pegasus_notetaker.c
@@ -211,14 +211,11 @@ 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);
+ usb_autopm_put_interface(pegasus->intf);
}
static int pegasus_probe(struct usb_interface *intf,
@@ -364,6 +361,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 +382,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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] input: tablet: pegasus_notetaker: USB PM fixes
2016-06-13 13:31 [PATCH] input: tablet: pegasus_notetaker: USB PM fixes Martin Kepplinger
@ 2016-06-13 14:12 ` Oliver Neukum
0 siblings, 0 replies; 2+ messages in thread
From: Oliver Neukum @ 2016-06-13 14:12 UTC (permalink / raw)
To: Martin Kepplinger
Cc: dmitry.torokhov, kernel-testers, linux-input, linux-kernel,
linux-usb
On Mon, 2016-06-13 at 15:31 +0200, Martin Kepplinger wrote:
> In close() we only need usb_autopm_put_interface(), in reset_resume()
Sorry, that is a misunderstanding. You need not carry
about power management in close() at all. But it must
be balanced of course.
Regards
Oliver
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-06-13 14:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-13 13:31 [PATCH] input: tablet: pegasus_notetaker: USB PM fixes Martin Kepplinger
2016-06-13 14:12 ` Oliver Neukum
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 NNTP newsgroup(s).