[rft]suspend/resume for appledisplay driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

this implements suspend and resume for the appledisplay driver.
Could somebody with the hardware please test it?

	Regards
		Oliver

--

commit f7f46fbc621027a40675bfc5f741dd563077d44e
Author: Oliver Neukum <oneukum@linux-d698.(none)>
Date:   Thu Jul 2 17:21:52 2009 +0200

    usb: suspend/resume for appledisplay driver

diff --git a/drivers/usb/misc/appledisplay.c b/drivers/usb/misc/appledisplay.c
index 1d8e39a..5d0319f 100644
--- a/drivers/usb/misc/appledisplay.c
+++ b/drivers/usb/misc/appledisplay.c
@@ -343,10 +343,34 @@ static void appledisplay_disconnect(struct usb_interface *iface)
 	printk(KERN_INFO "appledisplay: Apple Cinema Display disconnected\n");
 }
 
+static int appledisplay_suspend(struct usb_interface *iface, pm_message_t message)
+{
+	struct appledisplay *pdata = usb_get_intfdata(iface);
+
+	usb_kill_urb(pdata->urb);
+	cancel_delayed_work(&pdata->work);
+
+	return 0;
+}
+
+static int appledisplay_resume(struct usb_interface *iface)
+{
+	struct appledisplay *pdata = usb_get_intfdata(iface);
+	int rv;
+
+	/* during sleep the button has most likely been released */
+	pdata->button_pressed = 0;
+
+	rv = usb_submit_urb(pdata->urb, GFP_NOIO);
+	return rv;
+}
+
 static struct usb_driver appledisplay_driver = {
 	.name		= "appledisplay",
 	.probe		= appledisplay_probe,
 	.disconnect	= appledisplay_disconnect,
+	.suspend	= appledisplay_suspend,
+	.resume		= appledisplay_resume,
 	.id_table	= appledisplay_table,
 };
 

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux