blob: 40a76b97b7ab9d8eabf07b1fa7272f477e92b074 [file] [log] [blame]
Dong Aisheng87d68732012-09-05 10:57:13 +08001/*
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 Behera3d237992014-05-09 16:37:40 +053018#include <linux/err.h>
Arnd Bergmannadae28c2016-03-23 11:36:53 +010019#include <linux/errno.h>
Tushar Behera3d237992014-05-09 16:37:40 +053020
Sylwester Nawrocki5fb1c2d2013-03-25 17:56:23 +010021struct device_node;
22
Peter Chendf73de92013-10-22 16:46:25 +080023#ifdef CONFIG_MFD_SYSCON
Dong Aisheng87d68732012-09-05 10:57:13 +080024extern struct regmap *syscon_node_to_regmap(struct device_node *np);
25extern struct regmap *syscon_regmap_lookup_by_compatible(const char *s);
Alexander Shiyan5ab3a892013-03-13 21:34:20 +040026extern struct regmap *syscon_regmap_lookup_by_pdevname(const char *s);
Dong Aisheng87d68732012-09-05 10:57:13 +080027extern struct regmap *syscon_regmap_lookup_by_phandle(
28 struct device_node *np,
29 const char *property);
Peter Chendf73de92013-10-22 16:46:25 +080030#else
31static inline struct regmap *syscon_node_to_regmap(struct device_node *np)
32{
Philipp Zabel8c037e02016-01-29 09:42:19 +010033 return ERR_PTR(-ENOTSUPP);
Peter Chendf73de92013-10-22 16:46:25 +080034}
35
36static inline struct regmap *syscon_regmap_lookup_by_compatible(const char *s)
37{
Philipp Zabel8c037e02016-01-29 09:42:19 +010038 return ERR_PTR(-ENOTSUPP);
Peter Chendf73de92013-10-22 16:46:25 +080039}
40
41static inline struct regmap *syscon_regmap_lookup_by_pdevname(const char *s)
42{
Philipp Zabel8c037e02016-01-29 09:42:19 +010043 return ERR_PTR(-ENOTSUPP);
Peter Chendf73de92013-10-22 16:46:25 +080044}
45
46static inline struct regmap *syscon_regmap_lookup_by_phandle(
47 struct device_node *np,
48 const char *property)
49{
Philipp Zabel8c037e02016-01-29 09:42:19 +010050 return ERR_PTR(-ENOTSUPP);
Peter Chendf73de92013-10-22 16:46:25 +080051}
52#endif
53
Dong Aisheng87d68732012-09-05 10:57:13 +080054#endif /* __LINUX_MFD_SYSCON_H__ */