From: Dilip Kota <eswara.kota@linux.intel.com>
To: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org
Cc: kishon@ti.com, robh@kernel.org, andriy.shevchenko@intel.com,
cheol.yong.kim@intel.com, chuanhua.lei@linux.intel.com,
qi-ming.wu@intel.com, yixin.zhu@intel.com,
Dilip Kota <eswara.kota@linux.intel.com>
Subject: [PATCH v3 1/3] mfd: syscon: Add fwnode_to_regmap
Date: Wed, 26 Feb 2020 18:09:51 +0800 [thread overview]
Message-ID: <9953bb25281397553cb87b09d641c968d8432dd9.1582709320.git.eswara.kota@linux.intel.com> (raw)
In-Reply-To: <cover.1582709320.git.eswara.kota@linux.intel.com>
In-Reply-To: <cover.1582709320.git.eswara.kota@linux.intel.com>
Traverse regmap handle entry from firmware node handle.
Signed-off-by: Dilip Kota <eswara.kota@linux.intel.com>
---
drivers/mfd/syscon.c | 8 ++++++++
include/linux/mfd/syscon.h | 6 ++++++
2 files changed, 14 insertions(+)
diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c
index e22197c832e8..08064ffc5394 100644
--- a/drivers/mfd/syscon.c
+++ b/drivers/mfd/syscon.c
@@ -178,6 +178,14 @@ struct regmap *device_node_to_regmap(struct device_node *np)
}
EXPORT_SYMBOL_GPL(device_node_to_regmap);
+struct regmap *fwnode_to_regmap(struct fwnode_handle *fwnode)
+{
+ struct device_node *np = to_of_node(fwnode);
+
+ return device_node_get_regmap(np, false);
+}
+EXPORT_SYMBOL_GPL(fwnode_to_regmap);
+
struct regmap *syscon_node_to_regmap(struct device_node *np)
{
if (!of_device_is_compatible(np, "syscon"))
diff --git a/include/linux/mfd/syscon.h b/include/linux/mfd/syscon.h
index 112dc66262cc..a024dd88bdd4 100644
--- a/include/linux/mfd/syscon.h
+++ b/include/linux/mfd/syscon.h
@@ -18,6 +18,7 @@ struct device_node;
#ifdef CONFIG_MFD_SYSCON
extern struct regmap *device_node_to_regmap(struct device_node *np);
+extern struct regmap *fwnode_to_regmap(struct fwnode_handle *fwnode);
extern struct regmap *syscon_node_to_regmap(struct device_node *np);
extern struct regmap *syscon_regmap_lookup_by_compatible(const char *s);
extern struct regmap *syscon_regmap_lookup_by_phandle(
@@ -29,6 +30,11 @@ static inline struct regmap *device_node_to_regmap(struct device_node *np)
return ERR_PTR(-ENOTSUPP);
}
+static inline struct regmap *fwnode_to_regmap(struct fwnode_handle *fwnode)
+{
+ return ERR_PTR(-ENOTSUPP);
+}
+
static inline struct regmap *syscon_node_to_regmap(struct device_node *np)
{
return ERR_PTR(-ENOTSUPP);
--
2.11.0
next prev parent reply other threads:[~2020-02-26 10:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-26 10:09 [PATCH v3 0/3] Add Intel ComboPhy driver Dilip Kota
2020-02-26 10:09 ` Dilip Kota [this message]
2020-02-26 10:09 ` [PATCH v3 2/3] dt-bindings: phy: Add YAML schemas for Intel Combophy Dilip Kota
2020-02-26 10:09 ` [PATCH v3 3/3] phy: intel: Add driver support for Combophy Dilip Kota
2020-02-26 14:41 ` Andy Shevchenko
2020-02-26 14:45 ` Andy Shevchenko
2020-02-27 7:52 ` Dilip Kota
2020-02-27 9:43 ` Andy Shevchenko
2020-02-28 9:20 ` Dilip Kota
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=9953bb25281397553cb87b09d641c968d8432dd9.1582709320.git.eswara.kota@linux.intel.com \
--to=eswara.kota@linux.intel.com \
--cc=andriy.shevchenko@intel.com \
--cc=cheol.yong.kim@intel.com \
--cc=chuanhua.lei@linux.intel.com \
--cc=devicetree@vger.kernel.org \
--cc=kishon@ti.com \
--cc=linux-kernel@vger.kernel.org \
--cc=qi-ming.wu@intel.com \
--cc=robh@kernel.org \
--cc=yixin.zhu@intel.com \
/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).