summaryrefslogtreecommitdiff
path: root/include/featctrl.h
blob: 6f99c96b8aecbaee3221c64971a8869a4f7a4b21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef __FEATCTRL_H_
#define __FEATCTRL_H_

#include <linux/list.h>

struct feature_controller;
struct device_node;

struct feature_controller {
	struct device *dev;
	int (*check)(struct feature_controller *, int idx);
	struct list_head list;
};

enum { FEATCTRL_GATED = 0, FEATCTRL_OKAY = 1 };

int feature_controller_register(struct feature_controller *);

#ifdef CONFIG_FEATURE_CONTROLLER
int of_feature_controller_check(struct device_node *np);
#else
static inline int of_feature_controller_check(struct device_node *np)
{
	return FEATCTRL_OKAY;
}
#endif

#endif /* PINCTRL_H */