From: Oleksij Rempel <linux@rempel-privat.de>
To: barebox@lists.infradead.org
Cc: Oleksij Rempel <linux@rempel-privat.de>
Subject: [PATCH v2 1/4] add syscon_regmap_lookup_by_phandle() support
Date: Fri, 7 Jun 2019 09:32:07 +0200 [thread overview]
Message-ID: <20190607073210.13915-1-linux@rempel-privat.de> (raw)
needed for remoteproc port
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
---
drivers/mfd/syscon.c | 19 +++++++++++++++++++
include/mfd/syscon.h | 7 +++++++
2 files changed, 26 insertions(+)
diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c
index b1ff1b1ea..809941937 100644
--- a/drivers/mfd/syscon.c
+++ b/drivers/mfd/syscon.c
@@ -174,6 +174,25 @@ struct regmap *syscon_regmap_lookup_by_compatible(const char *s)
return regmap;
}
+struct regmap *syscon_regmap_lookup_by_phandle(struct device_node *np,
+ const char *property)
+{
+ struct device_node *syscon_np;
+ struct regmap *regmap;
+
+ if (property)
+ syscon_np = of_parse_phandle(np, property, 0);
+ else
+ syscon_np = np;
+
+ if (!syscon_np)
+ return ERR_PTR(-ENODEV);
+
+ regmap = syscon_node_to_regmap(syscon_np);
+
+ return regmap;
+}
+
static int syscon_probe(struct device_d *dev)
{
struct syscon *syscon;
diff --git a/include/mfd/syscon.h b/include/mfd/syscon.h
index 902f9fa2f..3e39c333f 100644
--- a/include/mfd/syscon.h
+++ b/include/mfd/syscon.h
@@ -22,6 +22,8 @@ void __iomem *syscon_base_lookup_by_phandle
(struct device_node *np, const char *property);
struct regmap *syscon_node_to_regmap(struct device_node *np);
struct regmap *syscon_regmap_lookup_by_compatible(const char *s);
+struct regmap *syscon_regmap_lookup_by_phandle(struct device_node *np,
+ const char *property);
#else
static inline void __iomem *syscon_base_lookup_by_pdevname(const char *s)
{
@@ -42,6 +44,11 @@ static inline struct regmap *syscon_regmap_lookup_by_compatible(const char *s)
{
return ERR_PTR(-ENOSYS);
}
+struct regmap *syscon_regmap_lookup_by_phandle(struct device_node *np,
+ const char *property)
+{
+ return ERR_PTR(-ENOSYS);
+}
#endif
#endif
--
2.20.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next reply other threads:[~2019-06-07 7:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-07 7:32 Oleksij Rempel [this message]
2019-06-07 7:32 ` [PATCH v2 2/4] elf: add missing elf32_shdr Oleksij Rempel
2019-06-07 7:32 ` [PATCH v2 3/4] of: base: don't try to read cells_name property if no cells_name set Oleksij Rempel
2019-06-07 7:32 ` [PATCH v2 4/4] port reduced version of remoteproc framework from linux Oleksij Rempel
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=20190607073210.13915-1-linux@rempel-privat.de \
--to=linux@rempel-privat.de \
--cc=barebox@lists.infradead.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