public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] introduce .wakeup_event ops
@ 2009-08-19  7:24 Shaohua Li
  2009-08-19 11:52 ` Matthew Garrett
  2009-08-19 14:49 ` Alan Stern
  0 siblings, 2 replies; 21+ messages in thread
From: Shaohua Li @ 2009-08-19  7:24 UTC (permalink / raw)
  To: linux acpi, pm list; +Cc: Rafael J. Wysocki, Alan Stern, mjg59


Introduce .wakeup_event(). When a device gets a wakeup event,
the callback is called. The callback usually should check if the device
really invokes wakeup event and disable wakeup event if yes.

Usually driver should does nothing in the op as bus can handle it. But in some
cases, like pci bus, UHCI controller doesn't use standard PME registers for
wakeup, instead of using special approach. In this case, UHCI controller driver
should implement this op.

---
 include/linux/pm.h |    8 ++++++++
 1 file changed, 8 insertions(+)

Index: linux/include/linux/pm.h
===================================================================
--- linux.orig/include/linux/pm.h	2009-08-19 11:44:41.000000000 +0800
+++ linux/include/linux/pm.h	2009-08-19 13:44:03.000000000 +0800
@@ -191,6 +191,13 @@ typedef struct pm_message {
  *	power state if all of the necessary conditions are satisfied.  Check
  *	these conditions and handle the device as appropriate, possibly queueing
  *	a suspend request for it.
+ *
+ * @wakeup_event: Checks if a wakeup event occurs. In bus level, the op might
+ *	check all devices under the bus and call device_receive_wakeup_event()
+ *	for devices which invoke wakeup event. In device level, the op just
+ *	returns if a wakeup event occurs. Note, if device follows standard
+ *	mechanism for wakeup which bus level can handle, device level op can be
+ *	empty.
  */
 
 struct dev_pm_ops {
@@ -211,6 +218,7 @@ struct dev_pm_ops {
 	int (*runtime_suspend)(struct device *dev);
 	int (*runtime_resume)(struct device *dev);
 	void (*runtime_idle)(struct device *dev);
+	bool (*wakeup_event)(struct device *dev);
 };
 
 /**



^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2009-08-24 18:48 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-19  7:24 [PATCH 1/5] introduce .wakeup_event ops Shaohua Li
2009-08-19 11:52 ` Matthew Garrett
2009-08-20  3:24   ` Shaohua Li
2009-08-20  7:40     ` Matthew Garrett
2009-08-21  6:33       ` Shaohua Li
2009-08-21  9:23         ` Matthew Garrett
2009-08-24  1:50           ` Shaohua Li
2009-08-24  2:48             ` Matthew Garrett
     [not found]   ` <20090824082722.GA32264@srcf.ucam.org>
     [not found]     ` <1251103572.24336.8.camel@sli10-desk.sh.intel.com>
2009-08-24 18:49       ` Rafael J. Wysocki
2009-08-19 14:49 ` Alan Stern
2009-08-20  3:04   ` Shaohua Li
2009-08-20 14:11     ` Alan Stern
2009-08-20 14:14       ` Matthew Garrett
2009-08-20 14:38         ` Alan Stern
2009-08-20 14:42           ` Matthew Garrett
2009-08-20 15:22             ` Alan Stern
2009-08-20 19:37               ` Rafael J. Wysocki
2009-08-20 21:10                 ` Alan Stern
2009-08-20 21:27                   ` Rafael J. Wysocki
2009-08-21  6:46                     ` Shaohua Li
2009-08-21 14:33                       ` Alan Stern

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox