summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSanchayan Maity <maitysanchayan@gmail.com>2016-03-04 17:01:19 +0530
committerStefan Agner <stefan.agner@toradex.com>2016-03-09 13:34:01 -0800
commit0c2d2e753259d8b84fa0cd3dfc5889e388051025 (patch)
tree9bdd05ddbd292b5bb183c09c625cbbe937316e7e /include
parentcac87642fd3e8239af3a20541232892366728195 (diff)
mfd: syscon: Introduce syscon_regmap_read_from_offset
Currently syscon does not provide an abstraction to access a register from syscon reference like below ocotp-cfg1 = <&ocotp 0x20> syscon_regmap_read_from_offset provides a generic abstraction to access a register from syscon reference as above. It allows to specify the node and node name of phandle reference, reading the offset from the node entry and providing the value from the offset in the register map. Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mfd/syscon.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/mfd/syscon.h b/include/linux/mfd/syscon.h
index 75e543b78f53..3c02ed9a6c98 100644
--- a/include/linux/mfd/syscon.h
+++ b/include/linux/mfd/syscon.h
@@ -26,6 +26,9 @@ extern struct regmap *syscon_regmap_lookup_by_pdevname(const char *s);
extern struct regmap *syscon_regmap_lookup_by_phandle(
struct device_node *np,
const char *property);
+extern int syscon_regmap_read_from_offset(struct device_node *np,
+ const char *s,
+ unsigned int *val);
#else
static inline struct regmap *syscon_node_to_regmap(struct device_node *np)
{
@@ -48,6 +51,13 @@ static inline struct regmap *syscon_regmap_lookup_by_phandle(
{
return ERR_PTR(-ENOSYS);
}
+
+static inline int syscon_regmap_read_from_offset(struct device_node *np,
+ const char *s,
+ unsigned int *val)
+{
+ return ERR_PTR(-ENOSYS);
+}
#endif
#endif /* __LINUX_MFD_SYSCON_H__ */