提交 a4b4e046 编写于 作者: R Romain Perier 提交者: Mark Brown

of: Add standard property for poweroff capability

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: NRomain Perier <romain.perier@gmail.com>
Acked-by: NGrant Likely <grant.likely@linaro.org>
Signed-off-by: NMark Brown <broonie@kernel.org>
上级 f114040e
......@@ -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 */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册