xref: /OK3568_Linux_fs/kernel/include/linux/mfd/syscon.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0-or-later */
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun  * System Control Driver
4*4882a593Smuzhiyun  *
5*4882a593Smuzhiyun  * Copyright (C) 2012 Freescale Semiconductor, Inc.
6*4882a593Smuzhiyun  * Copyright (C) 2012 Linaro Ltd.
7*4882a593Smuzhiyun  *
8*4882a593Smuzhiyun  * Author: Dong Aisheng <dong.aisheng@linaro.org>
9*4882a593Smuzhiyun  */
10*4882a593Smuzhiyun 
11*4882a593Smuzhiyun #ifndef __LINUX_MFD_SYSCON_H__
12*4882a593Smuzhiyun #define __LINUX_MFD_SYSCON_H__
13*4882a593Smuzhiyun 
14*4882a593Smuzhiyun #include <linux/err.h>
15*4882a593Smuzhiyun #include <linux/errno.h>
16*4882a593Smuzhiyun 
17*4882a593Smuzhiyun struct device_node;
18*4882a593Smuzhiyun 
19*4882a593Smuzhiyun #ifdef CONFIG_MFD_SYSCON
20*4882a593Smuzhiyun extern struct regmap *device_node_to_regmap(struct device_node *np);
21*4882a593Smuzhiyun extern struct regmap *syscon_node_to_regmap(struct device_node *np);
22*4882a593Smuzhiyun extern struct regmap *syscon_regmap_lookup_by_compatible(const char *s);
23*4882a593Smuzhiyun extern struct regmap *syscon_regmap_lookup_by_phandle(
24*4882a593Smuzhiyun 					struct device_node *np,
25*4882a593Smuzhiyun 					const char *property);
26*4882a593Smuzhiyun extern struct regmap *syscon_regmap_lookup_by_phandle_args(
27*4882a593Smuzhiyun 					struct device_node *np,
28*4882a593Smuzhiyun 					const char *property,
29*4882a593Smuzhiyun 					int arg_count,
30*4882a593Smuzhiyun 					unsigned int *out_args);
31*4882a593Smuzhiyun #else
device_node_to_regmap(struct device_node * np)32*4882a593Smuzhiyun static inline struct regmap *device_node_to_regmap(struct device_node *np)
33*4882a593Smuzhiyun {
34*4882a593Smuzhiyun 	return ERR_PTR(-ENOTSUPP);
35*4882a593Smuzhiyun }
36*4882a593Smuzhiyun 
syscon_node_to_regmap(struct device_node * np)37*4882a593Smuzhiyun static inline struct regmap *syscon_node_to_regmap(struct device_node *np)
38*4882a593Smuzhiyun {
39*4882a593Smuzhiyun 	return ERR_PTR(-ENOTSUPP);
40*4882a593Smuzhiyun }
41*4882a593Smuzhiyun 
syscon_regmap_lookup_by_compatible(const char * s)42*4882a593Smuzhiyun static inline struct regmap *syscon_regmap_lookup_by_compatible(const char *s)
43*4882a593Smuzhiyun {
44*4882a593Smuzhiyun 	return ERR_PTR(-ENOTSUPP);
45*4882a593Smuzhiyun }
46*4882a593Smuzhiyun 
syscon_regmap_lookup_by_phandle(struct device_node * np,const char * property)47*4882a593Smuzhiyun static inline struct regmap *syscon_regmap_lookup_by_phandle(
48*4882a593Smuzhiyun 					struct device_node *np,
49*4882a593Smuzhiyun 					const char *property)
50*4882a593Smuzhiyun {
51*4882a593Smuzhiyun 	return ERR_PTR(-ENOTSUPP);
52*4882a593Smuzhiyun }
53*4882a593Smuzhiyun 
syscon_regmap_lookup_by_phandle_args(struct device_node * np,const char * property,int arg_count,unsigned int * out_args)54*4882a593Smuzhiyun static inline struct regmap *syscon_regmap_lookup_by_phandle_args(
55*4882a593Smuzhiyun 					struct device_node *np,
56*4882a593Smuzhiyun 					const char *property,
57*4882a593Smuzhiyun 					int arg_count,
58*4882a593Smuzhiyun 					unsigned int *out_args)
59*4882a593Smuzhiyun {
60*4882a593Smuzhiyun 	return ERR_PTR(-ENOTSUPP);
61*4882a593Smuzhiyun }
62*4882a593Smuzhiyun #endif
63*4882a593Smuzhiyun 
64*4882a593Smuzhiyun #endif /* __LINUX_MFD_SYSCON_H__ */
65