David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 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> |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 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 | |
| 17 | struct device_node; |
| 18 | |
| 19 | #ifdef CONFIG_MFD_SYSCON |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame] | 20 | extern struct regmap *device_node_to_regmap(struct device_node *np); |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 21 | extern struct regmap *syscon_node_to_regmap(struct device_node *np); |
| 22 | extern struct regmap *syscon_regmap_lookup_by_compatible(const char *s); |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 23 | extern struct regmap *syscon_regmap_lookup_by_phandle( |
| 24 | struct device_node *np, |
| 25 | const char *property); |
Olivier Deprez | 157378f | 2022-04-04 15:47:50 +0200 | [diff] [blame^] | 26 | extern struct regmap *syscon_regmap_lookup_by_phandle_args( |
| 27 | struct device_node *np, |
| 28 | const char *property, |
| 29 | int arg_count, |
| 30 | unsigned int *out_args); |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 31 | #else |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame] | 32 | static inline struct regmap *device_node_to_regmap(struct device_node *np) |
| 33 | { |
| 34 | return ERR_PTR(-ENOTSUPP); |
| 35 | } |
| 36 | |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 37 | static inline struct regmap *syscon_node_to_regmap(struct device_node *np) |
| 38 | { |
| 39 | return ERR_PTR(-ENOTSUPP); |
| 40 | } |
| 41 | |
| 42 | static inline struct regmap *syscon_regmap_lookup_by_compatible(const char *s) |
| 43 | { |
| 44 | return ERR_PTR(-ENOTSUPP); |
| 45 | } |
| 46 | |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 47 | static inline struct regmap *syscon_regmap_lookup_by_phandle( |
| 48 | struct device_node *np, |
| 49 | const char *property) |
| 50 | { |
| 51 | return ERR_PTR(-ENOTSUPP); |
| 52 | } |
Olivier Deprez | 157378f | 2022-04-04 15:47:50 +0200 | [diff] [blame^] | 53 | |
| 54 | static inline struct regmap *syscon_regmap_lookup_by_phandle_args( |
| 55 | struct device_node *np, |
| 56 | const char *property, |
| 57 | int arg_count, |
| 58 | unsigned int *out_args) |
| 59 | { |
| 60 | return ERR_PTR(-ENOTSUPP); |
| 61 | } |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 62 | #endif |
| 63 | |
| 64 | #endif /* __LINUX_MFD_SYSCON_H__ */ |