1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * System Control Driver
5 * Copyright (C) 2012 Freescale Semiconductor, Inc.
6 * Copyright (C) 2012 Linaro Ltd.
8 * Author: Dong Aisheng <dong.aisheng@linaro.org>
11 #ifndef __LINUX_MFD_SYSCON_H__
12 #define __LINUX_MFD_SYSCON_H__
14 #include <linux/err.h>
15 #include <linux/errno.h>
19 #ifdef CONFIG_MFD_SYSCON
20 struct regmap *device_node_to_regmap(struct device_node *np);
21 struct regmap *syscon_node_to_regmap(struct device_node *np);
22 struct regmap *syscon_regmap_lookup_by_compatible(const char *s);
23 struct regmap *syscon_regmap_lookup_by_phandle(struct device_node *np,
24 const char *property);
25 struct regmap *syscon_regmap_lookup_by_phandle_args(struct device_node *np,
28 unsigned int *out_args);
29 struct regmap *syscon_regmap_lookup_by_phandle_optional(struct device_node *np,
30 const char *property);
31 int of_syscon_register_regmap(struct device_node *np,
32 struct regmap *regmap);
34 static inline struct regmap *device_node_to_regmap(struct device_node *np)
36 return ERR_PTR(-ENOTSUPP);
39 static inline struct regmap *syscon_node_to_regmap(struct device_node *np)
41 return ERR_PTR(-ENOTSUPP);
44 static inline struct regmap *syscon_regmap_lookup_by_compatible(const char *s)
46 return ERR_PTR(-ENOTSUPP);
49 static inline struct regmap *syscon_regmap_lookup_by_phandle(
50 struct device_node *np,
53 return ERR_PTR(-ENOTSUPP);
56 static inline struct regmap *syscon_regmap_lookup_by_phandle_args(
57 struct device_node *np,
60 unsigned int *out_args)
62 return ERR_PTR(-ENOTSUPP);
65 static inline struct regmap *syscon_regmap_lookup_by_phandle_optional(
66 struct device_node *np,
72 static inline int of_syscon_register_regmap(struct device_node *np,
73 struct regmap *regmap)
80 #endif /* __LINUX_MFD_SYSCON_H__ */