Linux 4.16.11
[linux/fpc-iii.git] / drivers / pinctrl / berlin / berlin.h
blobe9b30f95b03e3c72c68d0dd1ffa1957d930416c9
1 /*
2 * Marvell Berlin SoC pinctrl driver.
4 * Copyright (C) 2014 Marvell Technology Group Ltd.
6 * Antoine Ténart <antoine.tenart@free-electrons.com>
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
13 #ifndef __PINCTRL_BERLIN_H
14 #define __PINCTRL_BERLIN_H
16 struct berlin_desc_function {
17 const char *name;
18 u8 muxval;
21 struct berlin_desc_group {
22 const char *name;
23 u8 offset;
24 u8 bit_width;
25 u8 lsb;
26 struct berlin_desc_function *functions;
29 struct berlin_pinctrl_desc {
30 const struct berlin_desc_group *groups;
31 unsigned ngroups;
34 struct berlin_pinctrl_function {
35 const char *name;
36 const char **groups;
37 unsigned ngroups;
40 #define BERLIN_PINCTRL_GROUP(_name, _offset, _width, _lsb, ...) \
41 { \
42 .name = _name, \
43 .offset = _offset, \
44 .bit_width = _width, \
45 .lsb = _lsb, \
46 .functions = (struct berlin_desc_function[]){ \
47 __VA_ARGS__, { } }, \
50 #define BERLIN_PINCTRL_FUNCTION(_muxval, _name) \
51 { \
52 .name = _name, \
53 .muxval = _muxval, \
56 #define BERLIN_PINCTRL_FUNCTION_UNKNOWN {}
58 int berlin_pinctrl_probe(struct platform_device *pdev,
59 const struct berlin_pinctrl_desc *desc);
61 int berlin_pinctrl_probe_regmap(struct platform_device *pdev,
62 const struct berlin_pinctrl_desc *desc,
63 struct regmap *regmap);
65 #endif /* __PINCTRL_BERLIN_H */