Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752252AbaJOMlr (ORCPT ); Wed, 15 Oct 2014 08:41:47 -0400 Received: from mail-wg0-f42.google.com ([74.125.82.42]:54668 "EHLO mail-wg0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751962AbaJOMlq (ORCPT ); Wed, 15 Oct 2014 08:41:46 -0400 From: Grant Likely Subject: Re: [RFC v3 PATCH 1/5] of: Add standard property for poweroff capability To: Romain Perier , devicetree@vger.kernel.org Cc: broonie@kernel.org, lgirdwood@gmail.com, linux-kernel@vger.kernel.org, heiko@sntech.de, robh@kernel.org, mark.rutland@arm.com In-Reply-To: <1413268273-15151-1-git-send-email-romain.perier@gmail.com> References: <1413268273-15151-1-git-send-email-romain.perier@gmail.com> Date: Wed, 15 Oct 2014 14:41:42 +0200 Message-Id: <20141015124142.92D0EC40B00@trevor.secretlab.ca> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 14 Oct 2014 06:31:09 +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" > which marks the device as able to shutdown the system. > > Signed-off-by: Romain Perier Acked-by: Grant Likely And same for the documentation patches. g. > --- > 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) > +{ > + return of_property_read_bool(np, "poweroff-source"); > +} > + > #endif /* _LINUX_OF_H */ > -- > 1.9.1 > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/