2019-05-27 14:55:01 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
2012-09-05 10:57:13 +08:00
|
|
|
/*
|
|
|
|
* System Control Driver
|
|
|
|
*
|
|
|
|
* Copyright (C) 2012 Freescale Semiconductor, Inc.
|
|
|
|
* Copyright (C) 2012 Linaro Ltd.
|
|
|
|
*
|
|
|
|
* Author: Dong Aisheng <dong.aisheng@linaro.org>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __LINUX_MFD_SYSCON_H__
|
|
|
|
#define __LINUX_MFD_SYSCON_H__
|
|
|
|
|
2014-05-09 19:07:40 +08:00
|
|
|
#include <linux/err.h>
|
2016-03-23 18:36:53 +08:00
|
|
|
#include <linux/errno.h>
|
2014-05-09 19:07:40 +08:00
|
|
|
|
2013-03-26 00:56:23 +08:00
|
|
|
struct device_node;
|
|
|
|
|
2013-10-22 16:46:25 +08:00
|
|
|
#ifdef CONFIG_MFD_SYSCON
|
2019-07-25 01:16:06 +08:00
|
|
|
extern struct regmap *device_node_to_regmap(struct device_node *np);
|
2012-09-05 10:57:13 +08:00
|
|
|
extern struct regmap *syscon_node_to_regmap(struct device_node *np);
|
|
|
|
extern struct regmap *syscon_regmap_lookup_by_compatible(const char *s);
|
|
|
|
extern struct regmap *syscon_regmap_lookup_by_phandle(
|
|
|
|
struct device_node *np,
|
|
|
|
const char *property);
|
2020-01-21 15:09:38 +08:00
|
|
|
extern struct regmap *syscon_regmap_lookup_by_phandle_args(
|
|
|
|
struct device_node *np,
|
|
|
|
const char *property,
|
|
|
|
int arg_count,
|
|
|
|
unsigned int *out_args);
|
2020-11-11 00:13:37 +08:00
|
|
|
extern struct regmap *syscon_regmap_lookup_by_phandle_optional(
|
|
|
|
struct device_node *np,
|
|
|
|
const char *property);
|
2013-10-22 16:46:25 +08:00
|
|
|
#else
|
2019-07-25 01:16:06 +08:00
|
|
|
static inline struct regmap *device_node_to_regmap(struct device_node *np)
|
|
|
|
{
|
|
|
|
return ERR_PTR(-ENOTSUPP);
|
|
|
|
}
|
|
|
|
|
2013-10-22 16:46:25 +08:00
|
|
|
static inline struct regmap *syscon_node_to_regmap(struct device_node *np)
|
|
|
|
{
|
2016-01-29 16:42:19 +08:00
|
|
|
return ERR_PTR(-ENOTSUPP);
|
2013-10-22 16:46:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static inline struct regmap *syscon_regmap_lookup_by_compatible(const char *s)
|
|
|
|
{
|
2016-01-29 16:42:19 +08:00
|
|
|
return ERR_PTR(-ENOTSUPP);
|
2013-10-22 16:46:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static inline struct regmap *syscon_regmap_lookup_by_phandle(
|
|
|
|
struct device_node *np,
|
|
|
|
const char *property)
|
|
|
|
{
|
2016-01-29 16:42:19 +08:00
|
|
|
return ERR_PTR(-ENOTSUPP);
|
2013-10-22 16:46:25 +08:00
|
|
|
}
|
2020-01-21 15:09:38 +08:00
|
|
|
|
2020-01-30 20:55:29 +08:00
|
|
|
static inline struct regmap *syscon_regmap_lookup_by_phandle_args(
|
2020-01-21 15:09:38 +08:00
|
|
|
struct device_node *np,
|
|
|
|
const char *property,
|
|
|
|
int arg_count,
|
|
|
|
unsigned int *out_args)
|
|
|
|
{
|
|
|
|
return ERR_PTR(-ENOTSUPP);
|
|
|
|
}
|
2020-11-11 00:13:37 +08:00
|
|
|
|
|
|
|
static inline struct regmap *syscon_regmap_lookup_by_phandle_optional(
|
|
|
|
struct device_node *np,
|
|
|
|
const char *property)
|
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2013-10-22 16:46:25 +08:00
|
|
|
#endif
|
|
|
|
|
2012-09-05 10:57:13 +08:00
|
|
|
#endif /* __LINUX_MFD_SYSCON_H__ */
|