From patchwork Wed Aug 19 07:24:11 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shaohua Li X-Patchwork-Id: 42528 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n7J7OEdR019220 for ; Wed, 19 Aug 2009 07:24:15 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751152AbZHSHYL (ORCPT ); Wed, 19 Aug 2009 03:24:11 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751199AbZHSHYL (ORCPT ); Wed, 19 Aug 2009 03:24:11 -0400 Received: from mga11.intel.com ([192.55.52.93]:18231 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751152AbZHSHYK (ORCPT ); Wed, 19 Aug 2009 03:24:10 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 19 Aug 2009 00:13:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.43,407,1246863600"; d="scan'208";a="718424344" Received: from sli10-conroe.sh.intel.com (HELO [10.239.13.175]) ([10.239.13.175]) by fmsmga001.fm.intel.com with ESMTP; 19 Aug 2009 00:27:19 -0700 Subject: [PATCH 1/5] introduce .wakeup_event ops From: Shaohua Li To: linux acpi , pm list Cc: "Rafael J. Wysocki" , Alan Stern , mjg59 Date: Wed, 19 Aug 2009 15:24:11 +0800 Message-Id: <1250666651.23178.116.camel@sli10-desk.sh.intel.com> Mime-Version: 1.0 X-Mailer: Evolution 2.26.1 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org 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(+) -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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); }; /**