diff options
author | Romain Perier <romain.perier@gmail.com> | 2014-10-14 06:31:09 +0000 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2014-10-22 16:59:36 +0100 |
commit | a4b4e0461ec5532ad498f0dd0e68993ad79bec2b (patch) | |
tree | a81a89d427de61cf147b5d7d879bcfbaccbe7e91 | |
parent | f114040e3ea6e07372334ade75d1ee0775c355e1 (diff) |
of: Add standard property for poweroff capabilitypower-off-dt
Several drivers create their own devicetree property when they register
poweroff capabilities. This is for example the case for mfd, regulator
or power drivers which define "vendor,system-power-controller" property.
This patch adds support for a standard property "poweroff-source"
which marks the device as able to shutdown the system.
Signed-off-by: Romain Perier <romain.perier@gmail.com>
Acked-by: Grant Likely <grant.likely@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | include/linux/of.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/of.h b/include/linux/of.h index 6545e7aec7bb..27b3ba1e9e59 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -866,4 +866,15 @@ static inline int of_changeset_update_property(struct of_changeset *ocs, /* CONFIG_OF_RESOLVE api */ extern int of_resolve_phandles(struct device_node *tree); +/** + * of_system_has_poweroff_source - Tells if poweroff-source is found for device_node + * @np: Pointer to the given device_node + * + * return true if present false otherwise + */ +static inline bool of_system_has_poweroff_source(const struct device_node *np) +{ + return of_property_read_bool(np, "poweroff-source"); +} + #endif /* _LINUX_OF_H */ |