Dong Aisheng | 87d6873 | 2012-09-05 10:57:13 +0800 | [diff] [blame] | 1 | /* |
| 2 | * System Control Driver |
| 3 | * |
| 4 | * Copyright (C) 2012 Freescale Semiconductor, Inc. |
| 5 | * Copyright (C) 2012 Linaro Ltd. |
| 6 | * |
| 7 | * Author: Dong Aisheng <dong.aisheng@linaro.org> |
| 8 | * |
| 9 | * This program is free software; you can redistribute it and/or modify |
| 10 | * it under the terms of the GNU General Public License as published by |
| 11 | * the Free Software Foundation; either version 2 of the License, or |
| 12 | * (at your option) any later version. |
| 13 | */ |
| 14 | |
| 15 | #ifndef __LINUX_MFD_SYSCON_H__ |
| 16 | #define __LINUX_MFD_SYSCON_H__ |
| 17 | |
Tushar Behera | 3d23799 | 2014-05-09 16:37:40 +0530 | [diff] [blame] | 18 | #include <linux/err.h> |
Arnd Bergmann | adae28c | 2016-03-23 11:36:53 +0100 | [diff] [blame] | 19 | #include <linux/errno.h> |
Tushar Behera | 3d23799 | 2014-05-09 16:37:40 +0530 | [diff] [blame] | 20 | |
Sylwester Nawrocki | 5fb1c2d | 2013-03-25 17:56:23 +0100 | [diff] [blame] | 21 | struct device_node; |
| 22 | |
Peter Chen | df73de9 | 2013-10-22 16:46:25 +0800 | [diff] [blame] | 23 | #ifdef CONFIG_MFD_SYSCON |
Dong Aisheng | 87d6873 | 2012-09-05 10:57:13 +0800 | [diff] [blame] | 24 | extern struct regmap *syscon_node_to_regmap(struct device_node *np); |
| 25 | extern struct regmap *syscon_regmap_lookup_by_compatible(const char *s); |
Alexander Shiyan | 5ab3a89 | 2013-03-13 21:34:20 +0400 | [diff] [blame] | 26 | extern struct regmap *syscon_regmap_lookup_by_pdevname(const char *s); |
Dong Aisheng | 87d6873 | 2012-09-05 10:57:13 +0800 | [diff] [blame] | 27 | extern struct regmap *syscon_regmap_lookup_by_phandle( |
| 28 | struct device_node *np, |
| 29 | const char *property); |
Peter Chen | df73de9 | 2013-10-22 16:46:25 +0800 | [diff] [blame] | 30 | #else |
| 31 | static inline struct regmap *syscon_node_to_regmap(struct device_node *np) |
| 32 | { |
Philipp Zabel | 8c037e0 | 2016-01-29 09:42:19 +0100 | [diff] [blame] | 33 | return ERR_PTR(-ENOTSUPP); |
Peter Chen | df73de9 | 2013-10-22 16:46:25 +0800 | [diff] [blame] | 34 | } |
| 35 | |
| 36 | static inline struct regmap *syscon_regmap_lookup_by_compatible(const char *s) |
| 37 | { |
Philipp Zabel | 8c037e0 | 2016-01-29 09:42:19 +0100 | [diff] [blame] | 38 | return ERR_PTR(-ENOTSUPP); |
Peter Chen | df73de9 | 2013-10-22 16:46:25 +0800 | [diff] [blame] | 39 | } |
| 40 | |
| 41 | static inline struct regmap *syscon_regmap_lookup_by_pdevname(const char *s) |
| 42 | { |
Philipp Zabel | 8c037e0 | 2016-01-29 09:42:19 +0100 | [diff] [blame] | 43 | return ERR_PTR(-ENOTSUPP); |
Peter Chen | df73de9 | 2013-10-22 16:46:25 +0800 | [diff] [blame] | 44 | } |
| 45 | |
| 46 | static inline struct regmap *syscon_regmap_lookup_by_phandle( |
| 47 | struct device_node *np, |
| 48 | const char *property) |
| 49 | { |
Philipp Zabel | 8c037e0 | 2016-01-29 09:42:19 +0100 | [diff] [blame] | 50 | return ERR_PTR(-ENOTSUPP); |
Peter Chen | df73de9 | 2013-10-22 16:46:25 +0800 | [diff] [blame] | 51 | } |
| 52 | #endif |
| 53 | |
Dong Aisheng | 87d6873 | 2012-09-05 10:57:13 +0800 | [diff] [blame] | 54 | #endif /* __LINUX_MFD_SYSCON_H__ */ |