2019-05-27 06:55:01 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
2012-09-05 02:57:13 +00: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 11:07:40 +00:00
|
|
|
#include <linux/err.h>
|
2016-03-23 10:36:53 +00:00
|
|
|
#include <linux/errno.h>
|
2014-05-09 11:07:40 +00:00
|
|
|
|
2013-03-25 16:56:23 +00:00
|
|
|
struct device_node;
|
|
|
|
|
2013-10-22 08:46:25 +00:00
|
|
|
#ifdef CONFIG_MFD_SYSCON
|
2024-02-20 11:50:11 +00:00
|
|
|
struct regmap *device_node_to_regmap(struct device_node *np);
|
|
|
|
struct regmap *syscon_node_to_regmap(struct device_node *np);
|
|
|
|
struct regmap *syscon_regmap_lookup_by_compatible(const char *s);
|
|
|
|
struct regmap *syscon_regmap_lookup_by_phandle(struct device_node *np,
|
|
|
|
const char *property);
|
|
|
|
struct regmap *syscon_regmap_lookup_by_phandle_args(struct device_node *np,
|
|
|
|
const char *property,
|
|
|
|
int arg_count,
|
|
|
|
unsigned int *out_args);
|
|
|
|
struct regmap *syscon_regmap_lookup_by_phandle_optional(struct device_node *np,
|
|
|
|
const char *property);
|
2024-06-21 11:55:43 +00:00
|
|
|
int of_syscon_register_regmap(struct device_node *np,
|
|
|
|
struct regmap *regmap);
|
2013-10-22 08:46:25 +00:00
|
|
|
#else
|
2019-07-24 17:16:06 +00:00
|
|
|
static inline struct regmap *device_node_to_regmap(struct device_node *np)
|
|
|
|
{
|
|
|
|
return ERR_PTR(-ENOTSUPP);
|
|
|
|
}
|
|
|
|
|
2013-10-22 08:46:25 +00:00
|
|
|
static inline struct regmap *syscon_node_to_regmap(struct device_node *np)
|
|
|
|
{
|
2016-01-29 08:42:19 +00:00
|
|
|
return ERR_PTR(-ENOTSUPP);
|
2013-10-22 08:46:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static inline struct regmap *syscon_regmap_lookup_by_compatible(const char *s)
|
|
|
|
{
|
2016-01-29 08:42:19 +00:00
|
|
|
return ERR_PTR(-ENOTSUPP);
|
2013-10-22 08:46:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static inline struct regmap *syscon_regmap_lookup_by_phandle(
|
|
|
|
struct device_node *np,
|
|
|
|
const char *property)
|
|
|
|
{
|
2016-01-29 08:42:19 +00:00
|
|
|
return ERR_PTR(-ENOTSUPP);
|
2013-10-22 08:46:25 +00:00
|
|
|
}
|
2020-01-21 07:09:38 +00:00
|
|
|
|
2020-01-30 12:55:29 +00:00
|
|
|
static inline struct regmap *syscon_regmap_lookup_by_phandle_args(
|
2020-01-21 07:09:38 +00:00
|
|
|
struct device_node *np,
|
|
|
|
const char *property,
|
|
|
|
int arg_count,
|
|
|
|
unsigned int *out_args)
|
|
|
|
{
|
|
|
|
return ERR_PTR(-ENOTSUPP);
|
|
|
|
}
|
2020-11-10 16:13:37 +00:00
|
|
|
|
|
|
|
static inline struct regmap *syscon_regmap_lookup_by_phandle_optional(
|
|
|
|
struct device_node *np,
|
|
|
|
const char *property)
|
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2024-06-21 11:55:43 +00:00
|
|
|
static inline int of_syscon_register_regmap(struct device_node *np,
|
|
|
|
struct regmap *regmap)
|
|
|
|
{
|
|
|
|
return -EOPNOTSUPP;
|
|
|
|
}
|
|
|
|
|
2013-10-22 08:46:25 +00:00
|
|
|
#endif
|
|
|
|
|
2012-09-05 02:57:13 +00:00
|
|
|
#endif /* __LINUX_MFD_SYSCON_H__ */
|