All of lore.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
                   ` (3 more replies)
  0 siblings, 4 replies; 42+ 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] 42+ messages in thread
* [PATCH 1/5] introduce .wakeup_event ops
@ 2009-08-19  7:24 Shaohua Li
  0 siblings, 0 replies; 42+ messages in thread
From: Shaohua Li @ 2009-08-19  7:24 UTC (permalink / raw)
  To: linux acpi, pm list


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] 42+ messages in thread

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

Thread overview: 42+ 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-21  9:23         ` Matthew Garrett
2009-08-24  1:50           ` Shaohua Li
2009-08-24  2:48             ` Matthew Garrett
2009-08-24  2:48             ` Matthew Garrett
2009-08-24  1:50           ` Shaohua Li
2009-08-21  6:33       ` Shaohua Li
2009-08-20  7:40     ` Matthew Garrett
2009-08-20  3:24   ` Shaohua Li
     [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-24 18:49       ` Rafael J. Wysocki
2009-08-19 11:52 ` Matthew Garrett
2009-08-19 14:49 ` Alan Stern
2009-08-19 14:49 ` Alan Stern
2009-08-20  3:04   ` Shaohua Li
2009-08-20  3:04   ` Shaohua Li
2009-08-20 14:11     ` Alan Stern
2009-08-20 14:11     ` Alan Stern
2009-08-20 14:14       ` Matthew Garrett
2009-08-20 14:14       ` Matthew Garrett
2009-08-20 14:38         ` Alan Stern
2009-08-20 14:42           ` Matthew Garrett
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-20 21:27                   ` Rafael J. Wysocki
2009-08-21  6:46                     ` Shaohua Li
2009-08-21  6:46                     ` Shaohua Li
2009-08-21 14:33                       ` Alan Stern
2009-08-21 14:33                       ` Alan Stern
2009-08-20 21:10                 ` Alan Stern
2009-08-20 19:37               ` Rafael J. Wysocki
2009-08-20 15:22             ` Alan Stern
2009-08-20 14:38         ` Alan Stern
  -- strict thread matches above, loose matches on Subject: below --
2009-08-19  7:24 Shaohua Li

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.