at for-next 2.0 kB view raw
1/* SPDX-License-Identifier: GPL-2.0-or-later */ 2/* 3 * System Control Driver 4 * 5 * Copyright (C) 2012 Freescale Semiconductor, Inc. 6 * Copyright (C) 2012 Linaro Ltd. 7 * 8 * Author: Dong Aisheng <dong.aisheng@linaro.org> 9 */ 10 11#ifndef __LINUX_MFD_SYSCON_H__ 12#define __LINUX_MFD_SYSCON_H__ 13 14#include <linux/err.h> 15#include <linux/errno.h> 16 17struct device_node; 18 19#ifdef CONFIG_MFD_SYSCON 20struct regmap *device_node_to_regmap(struct device_node *np); 21struct regmap *syscon_node_to_regmap(struct device_node *np); 22struct regmap *syscon_regmap_lookup_by_compatible(const char *s); 23struct regmap *syscon_regmap_lookup_by_phandle(struct device_node *np, 24 const char *property); 25struct regmap *syscon_regmap_lookup_by_phandle_args(struct device_node *np, 26 const char *property, 27 int arg_count, 28 unsigned int *out_args); 29struct regmap *syscon_regmap_lookup_by_phandle_optional(struct device_node *np, 30 const char *property); 31int of_syscon_register_regmap(struct device_node *np, 32 struct regmap *regmap); 33#else 34static inline struct regmap *device_node_to_regmap(struct device_node *np) 35{ 36 return ERR_PTR(-ENOTSUPP); 37} 38 39static inline struct regmap *syscon_node_to_regmap(struct device_node *np) 40{ 41 return ERR_PTR(-ENOTSUPP); 42} 43 44static inline struct regmap *syscon_regmap_lookup_by_compatible(const char *s) 45{ 46 return ERR_PTR(-ENOTSUPP); 47} 48 49static inline struct regmap *syscon_regmap_lookup_by_phandle( 50 struct device_node *np, 51 const char *property) 52{ 53 return ERR_PTR(-ENOTSUPP); 54} 55 56static inline struct regmap *syscon_regmap_lookup_by_phandle_args( 57 struct device_node *np, 58 const char *property, 59 int arg_count, 60 unsigned int *out_args) 61{ 62 return ERR_PTR(-ENOTSUPP); 63} 64 65static inline struct regmap *syscon_regmap_lookup_by_phandle_optional( 66 struct device_node *np, 67 const char *property) 68{ 69 return NULL; 70} 71 72static inline int of_syscon_register_regmap(struct device_node *np, 73 struct regmap *regmap) 74{ 75 return -EOPNOTSUPP; 76} 77 78#endif 79 80#endif /* __LINUX_MFD_SYSCON_H__ */