From: Ping Cheng Date: Mon, 19 Apr 2010 18:10:50 +0000 (-0700) Subject: Input: wacom - switch mode upon system resume X-Git-Tag: firefly_0821_release~10186^2~1749 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4186c4e6ebec12c705065b353c5fd7a1a87eea7d;p=firefly-linux-kernel-4.4.55.git Input: wacom - switch mode upon system resume commit 014f61504af276ba9d9544d8a7401d8f8526eb73 upstream. When Wacom devices wake up from a sleep, the switch mode command (wacom_query_tablet_data) is needed before wacom_open is called. wacom_query_tablet_data should not be executed inside wacom_open since wacom_open is called more than once during probe. Reported-and-tested-by: Anton Anikin Signed-off-by: Ping Cheng Signed-off-by: Dmitry Torokhov Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c index b5b69cc0aaf0..69fc4b8d8738 100644 --- a/drivers/input/tablet/wacom_sys.c +++ b/drivers/input/tablet/wacom_sys.c @@ -562,11 +562,15 @@ static int wacom_resume(struct usb_interface *intf) int rv; mutex_lock(&wacom->lock); - if (wacom->open) { + + /* switch to wacom mode first */ + wacom_query_tablet_data(intf); + + if (wacom->open) rv = usb_submit_urb(wacom->irq, GFP_NOIO); - wacom_query_tablet_data(intf); - } else + else rv = 0; + mutex_unlock(&wacom->lock); return rv;