lkml.org 
[lkml]   [2014]   [Oct]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [RFC v3 PATCH 1/5] of: Add standard property for poweroff capability
[ +CC: Guenter, Lee, linux-pm ]

On Tue, Oct 14, 2014 at 06:31:09AM +0000, Romain Perier wrote:
> 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"

Shouldn't this property really be called "power-off-source" or even
"power-off-controller"?

The power-off handler call-chain infrastructure is about to be merged
and will be using power[-_ ]off (i.e. not "poweroff") consistently (at
least in its interface).

Furthermore, isn't "controller" as in "power-off-controller" more
appropriate than "source" in this case? We have wake-up sources, which
might appear analogous, but that really isn't the same thing.

I now this has already been merged to the regulator tree, but there's
still still time to fix this.

> which marks the device as able to shutdown the system.
>
> Signed-off-by: Romain Perier <romain.perier@gmail.com>
> ---
> include/linux/of.h | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/include/linux/of.h b/include/linux/of.h
> index 6545e7a..27b3ba1 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)

Why "system_has"? Shouldn't this be of_is_power_off_source (controller)?

> +{
> + return of_property_read_bool(np, "poweroff-source");
> +}
> +
> #endif /* _LINUX_OF_H */

Thanks,
Johan

\
 
 \ /
  Last update: 2014-10-23 12:21    [W:0.079 / U:0.392 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site