From: Aaron Lu <aaron.lu@intel.com>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Len Brown <lenb@kernel.org>,
linux-acpi@vger.kernel.org, Aaron Lu <aaron.lwe@gmail.com>
Subject: [PATCH 2/2] acpi: add function to check if poweroff is possible
Date: Fri, 9 Nov 2012 09:54:56 +0800 [thread overview]
Message-ID: <1352426096-15116-3-git-send-email-aaron.lu@intel.com> (raw)
In-Reply-To: <1352426096-15116-1-git-send-email-aaron.lu@intel.com>
>From ACPI's perspective, a device is powered off if we put it into D3
cold power state. This wrapper inline function can be used to check if
firmware has provided us a way to power off the device during runtime.
Signed-off-by: Aaron Lu <aaron.lu@intel.com>
---
include/acpi/acpi_bus.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index 7d20617..932977a 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -496,6 +496,11 @@ static inline bool acpi_device_can_wakeup(struct acpi_device *adev)
return adev->wakeup.flags.valid;
}
+static inline bool acpi_device_can_poweroff(struct acpi_device *adev)
+{
+ return adev->power.states[ACPI_STATE_D3_COLD].flags.swset;
+}
+
#else /* CONFIG_ACPI */
static inline int register_acpi_bus_type(void *bus) { return 0; }
--
1.7.12.4
prev parent reply other threads:[~2012-11-09 1:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-09 1:54 [PATCH 0/2] Check ACPI device poweroff capability Aaron Lu
2012-11-09 1:54 ` [PATCH 1/2] acpi: introduce swset flag for power_state Aaron Lu
2012-11-21 0:11 ` Rafael J. Wysocki
2012-11-21 12:24 ` [PATCH v2] acpi: introduce os_accessible " Aaron Lu
2012-11-22 0:16 ` Rafael J. Wysocki
2012-11-09 1:54 ` Aaron Lu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1352426096-15116-3-git-send-email-aaron.lu@intel.com \
--to=aaron.lu@intel.com \
--cc=aaron.lwe@gmail.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=rjw@sisk.pl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.