blob: 112dc66262ccf8b6f0f05622dde3a6932e00117c [file] [log] [blame]
David Brazdil0f672f62019-12-10 10:32:29 +00001/* SPDX-License-Identifier: GPL-2.0-or-later */
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00002/*
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 Scullb4b6d4a2019-01-02 15:54:55 +00009 */
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
David Brazdil0f672f62019-12-10 10:32:29 +000020extern struct regmap *device_node_to_regmap(struct device_node *np);
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000021extern struct regmap *syscon_node_to_regmap(struct device_node *np);
22extern struct regmap *syscon_regmap_lookup_by_compatible(const char *s);
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000023extern struct regmap *syscon_regmap_lookup_by_phandle(
24 struct device_node *np,
25 const char *property);
26#else
David Brazdil0f672f62019-12-10 10:32:29 +000027static inline struct regmap *device_node_to_regmap(struct device_node *np)
28{
29 return ERR_PTR(-ENOTSUPP);
30}
31
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000032static inline struct regmap *syscon_node_to_regmap(struct device_node *np)
33{
34 return ERR_PTR(-ENOTSUPP);
35}
36
37static inline struct regmap *syscon_regmap_lookup_by_compatible(const char *s)
38{
39 return ERR_PTR(-ENOTSUPP);
40}
41
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000042static inline struct regmap *syscon_regmap_lookup_by_phandle(
43 struct device_node *np,
44 const char *property)
45{
46 return ERR_PTR(-ENOTSUPP);
47}
48#endif
49
50#endif /* __LINUX_MFD_SYSCON_H__ */