blob: f0273c9e972be6fdbcc32a93dad92091fcaebd9f [file] [log] [blame]
Thomas Gleixner2874c5f2019-05-27 08:55:01 +02001/* SPDX-License-Identifier: GPL-2.0-or-later */
Dong Aisheng87d68732012-09-05 10:57:13 +08002/*
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>
Dong Aisheng87d68732012-09-05 10:57:13 +08009 */
10
11#ifndef __LINUX_MFD_SYSCON_H__
12#define __LINUX_MFD_SYSCON_H__
13
Tushar Behera3d2379902014-05-09 16:37:40 +053014#include <linux/err.h>
Arnd Bergmannadae28c2016-03-23 11:36:53 +010015#include <linux/errno.h>
Tushar Behera3d2379902014-05-09 16:37:40 +053016
Sylwester Nawrocki5fb1c2d2013-03-25 17:56:23 +010017struct device_node;
18
Peter Chendf73de92013-10-22 16:46:25 +080019#ifdef CONFIG_MFD_SYSCON
Dong Aisheng87d68732012-09-05 10:57:13 +080020extern struct regmap *syscon_node_to_regmap(struct device_node *np);
21extern struct regmap *syscon_regmap_lookup_by_compatible(const char *s);
Alexander Shiyan5ab3a892013-03-13 21:34:20 +040022extern struct regmap *syscon_regmap_lookup_by_pdevname(const char *s);
Dong Aisheng87d68732012-09-05 10:57:13 +080023extern struct regmap *syscon_regmap_lookup_by_phandle(
24 struct device_node *np,
25 const char *property);
Peter Chendf73de92013-10-22 16:46:25 +080026#else
27static inline struct regmap *syscon_node_to_regmap(struct device_node *np)
28{
Philipp Zabel8c037e02016-01-29 09:42:19 +010029 return ERR_PTR(-ENOTSUPP);
Peter Chendf73de92013-10-22 16:46:25 +080030}
31
32static inline struct regmap *syscon_regmap_lookup_by_compatible(const char *s)
33{
Philipp Zabel8c037e02016-01-29 09:42:19 +010034 return ERR_PTR(-ENOTSUPP);
Peter Chendf73de92013-10-22 16:46:25 +080035}
36
37static inline struct regmap *syscon_regmap_lookup_by_pdevname(const char *s)
38{
Philipp Zabel8c037e02016-01-29 09:42:19 +010039 return ERR_PTR(-ENOTSUPP);
Peter Chendf73de92013-10-22 16:46:25 +080040}
41
42static inline struct regmap *syscon_regmap_lookup_by_phandle(
43 struct device_node *np,
44 const char *property)
45{
Philipp Zabel8c037e02016-01-29 09:42:19 +010046 return ERR_PTR(-ENOTSUPP);
Peter Chendf73de92013-10-22 16:46:25 +080047}
48#endif
49
Dong Aisheng87d68732012-09-05 10:57:13 +080050#endif /* __LINUX_MFD_SYSCON_H__ */