Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003  * System Control Driver
0004  *
0005  * Copyright (C) 2012 Freescale Semiconductor, Inc.
0006  * Copyright (C) 2012 Linaro Ltd.
0007  *
0008  * Author: Dong Aisheng <dong.aisheng@linaro.org>
0009  */
0010 
0011 #ifndef __LINUX_MFD_SYSCON_H__
0012 #define __LINUX_MFD_SYSCON_H__
0013 
0014 #include <linux/err.h>
0015 #include <linux/errno.h>
0016 
0017 struct device_node;
0018 
0019 #ifdef CONFIG_MFD_SYSCON
0020 extern struct regmap *device_node_to_regmap(struct device_node *np);
0021 extern struct regmap *syscon_node_to_regmap(struct device_node *np);
0022 extern struct regmap *syscon_regmap_lookup_by_compatible(const char *s);
0023 extern struct regmap *syscon_regmap_lookup_by_phandle(
0024                     struct device_node *np,
0025                     const char *property);
0026 extern struct regmap *syscon_regmap_lookup_by_phandle_args(
0027                     struct device_node *np,
0028                     const char *property,
0029                     int arg_count,
0030                     unsigned int *out_args);
0031 extern struct regmap *syscon_regmap_lookup_by_phandle_optional(
0032                     struct device_node *np,
0033                     const char *property);
0034 #else
0035 static inline struct regmap *device_node_to_regmap(struct device_node *np)
0036 {
0037     return ERR_PTR(-ENOTSUPP);
0038 }
0039 
0040 static inline struct regmap *syscon_node_to_regmap(struct device_node *np)
0041 {
0042     return ERR_PTR(-ENOTSUPP);
0043 }
0044 
0045 static inline struct regmap *syscon_regmap_lookup_by_compatible(const char *s)
0046 {
0047     return ERR_PTR(-ENOTSUPP);
0048 }
0049 
0050 static inline struct regmap *syscon_regmap_lookup_by_phandle(
0051                     struct device_node *np,
0052                     const char *property)
0053 {
0054     return ERR_PTR(-ENOTSUPP);
0055 }
0056 
0057 static inline struct regmap *syscon_regmap_lookup_by_phandle_args(
0058                     struct device_node *np,
0059                     const char *property,
0060                     int arg_count,
0061                     unsigned int *out_args)
0062 {
0063     return ERR_PTR(-ENOTSUPP);
0064 }
0065 
0066 static inline struct regmap *syscon_regmap_lookup_by_phandle_optional(
0067                     struct device_node *np,
0068                     const char *property)
0069 {
0070     return NULL;
0071 }
0072 
0073 #endif
0074 
0075 #endif /* __LINUX_MFD_SYSCON_H__ */