aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mfd
diff options
context:
space:
mode:
authorPaul Cercueil <paul@crapouillou.net>2019-07-24 13:16:06 -0400
committerPaul Burton <paul.burton@mips.com>2019-08-08 18:30:07 -0400
commit39233b7c611248c0d05209b4854bc63e26485655 (patch)
treedeb77504407a952589c45839385b9b5eaf627d20 /include/linux/mfd
parent2e8722a5255e6596246c0feee221902f11178ee5 (diff)
mfd/syscon: Add device_node_to_regmap()
device_node_to_regmap() is exactly like syscon_node_to_regmap(), but it does not check that the node is compatible with "syscon", and won't attach the first clock it finds to the regmap. The rationale behind this, is that one device node with a standard compatible string "foo,bar" can be covered by multiple drivers sharing a regmap, or by a single driver doing all the job without a regmap, but these are implementation details which shouldn't reflect on the devicetree. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Paul Burton <paul.burton@mips.com> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: James Hogan <jhogan@kernel.org> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Lee Jones <lee.jones@linaro.org> Cc: Daniel Lezcano <daniel.lezcano@linaro.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Michael Turquette <mturquette@baylibre.com> Cc: Stephen Boyd <sboyd@kernel.org> Cc: Jason Cooper <jason@lakedaemon.net> Cc: Marc Zyngier <marc.zyngier@arm.com> Cc: Rob Herring <robh+dt@kernel.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: linux-doc@vger.kernel.org Cc: linux-mips@vger.kernel.org Cc: linux-clk@vger.kernel.org Cc: od@zcrc.me Cc: Mathieu Malaterre <malat@debian.org>
Diffstat (limited to 'include/linux/mfd')
-rw-r--r--include/linux/mfd/syscon.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/mfd/syscon.h b/include/linux/mfd/syscon.h
index 8cfda0554381..112dc66262cc 100644
--- a/include/linux/mfd/syscon.h
+++ b/include/linux/mfd/syscon.h
@@ -17,12 +17,18 @@
17struct device_node; 17struct device_node;
18 18
19#ifdef CONFIG_MFD_SYSCON 19#ifdef CONFIG_MFD_SYSCON
20extern struct regmap *device_node_to_regmap(struct device_node *np);
20extern struct regmap *syscon_node_to_regmap(struct device_node *np); 21extern struct regmap *syscon_node_to_regmap(struct device_node *np);
21extern struct regmap *syscon_regmap_lookup_by_compatible(const char *s); 22extern struct regmap *syscon_regmap_lookup_by_compatible(const char *s);
22extern struct regmap *syscon_regmap_lookup_by_phandle( 23extern struct regmap *syscon_regmap_lookup_by_phandle(
23 struct device_node *np, 24 struct device_node *np,
24 const char *property); 25 const char *property);
25#else 26#else
27static inline struct regmap *device_node_to_regmap(struct device_node *np)
28{
29 return ERR_PTR(-ENOTSUPP);
30}
31
26static inline struct regmap *syscon_node_to_regmap(struct device_node *np) 32static inline struct regmap *syscon_node_to_regmap(struct device_node *np)
27{ 33{
28 return ERR_PTR(-ENOTSUPP); 34 return ERR_PTR(-ENOTSUPP);