From: Romain Perier <romain.perier-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org,
grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
mark.rutland-5wv7dgnIgG8@public.gmane.org
Subject: [RFC v3 PATCH 1/5] of: Add standard property for poweroff capability
Date: Tue, 14 Oct 2014 06:31:09 +0000 [thread overview]
Message-ID: <1413268273-15151-1-git-send-email-romain.perier@gmail.com> (raw)
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-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
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 devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next reply other threads:[~2014-10-14 6:31 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-14 6:31 Romain Perier [this message]
2014-10-14 6:31 ` [RFC PATCH v3 2/5] regulator: act8865: Add support to turn off all outputs Romain Perier
2014-10-14 6:31 ` [RFC PATCH v3 3/5] ARM: dts: rockchip: Enable power off in pmic for Radxa Rock Romain Perier
2014-10-14 6:31 ` [RFC PATCH v3 4/5] dt-bindings: Document the standard property "poweroff-source" Romain Perier
2014-10-14 6:31 ` [RFC PATCH v3 5/5] dt-bindings: Document the property poweroff-source for act8865 regulator Romain Perier
2014-10-15 12:41 ` [RFC v3 PATCH 1/5] of: Add standard property for poweroff capability Grant Likely
2014-10-15 13:42 ` Mark Brown
2014-10-15 13:56 ` Heiko Stübner
2014-10-15 14:03 ` Mark Brown
2014-10-17 6:01 ` PERIER Romain
2014-10-17 6:06 ` Heiko Stübner
2014-10-17 7:23 ` PERIER Romain
2014-10-21 13:29 ` PERIER Romain
2014-10-22 15:59 ` Mark Brown
2014-10-23 9:53 ` Johan Hovold
2014-10-25 7:28 ` Romain Perier
2014-10-25 8:37 ` Johan Hovold
2014-10-26 11:53 ` Heiko Stübner
2014-10-26 14:58 ` Romain Perier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1413268273-15151-1-git-send-email-romain.perier@gmail.com \
--to=romain.perier-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org \
--cc=lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
--cc=robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).