Skip to content

Commit

Permalink
of: Add standard property for poweroff capability
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Romain Perier authored and Mark Brown committed Oct 22, 2014
1 parent f114040 commit a4b4e04
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions include/linux/of.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

0 comments on commit a4b4e04

Please sign in to comment.