Merge tag 'block-5.11-2021-01-10' of git://git.kernel.dk/linux-block
[linux/fpc-iii.git] / drivers / pinctrl / meson / pinctrl-meson-axg-pmx.h
blobaa79d7ecee00dd063a5f405e1a11a36ae81a5652
1 /* SPDX-License-Identifier: (GPL-2.0+ or MIT) */
2 /*
3 * Copyright (c) 2017 Baylibre SAS.
4 * Author: Jerome Brunet <jbrunet@baylibre.com>
6 * Copyright (c) 2017 Amlogic, Inc. All rights reserved.
7 * Author: Xingyu Chen <xingyu.chen@amlogic.com>
9 */
11 struct meson_pmx_bank {
12 const char *name;
13 unsigned int first;
14 unsigned int last;
15 unsigned int reg;
16 unsigned int offset;
19 struct meson_axg_pmx_data {
20 struct meson_pmx_bank *pmx_banks;
21 unsigned int num_pmx_banks;
24 #define BANK_PMX(n, f, l, r, o) \
25 { \
26 .name = n, \
27 .first = f, \
28 .last = l, \
29 .reg = r, \
30 .offset = o, \
33 struct meson_pmx_axg_data {
34 unsigned int func;
37 #define PMX_DATA(f) \
38 { \
39 .func = f, \
42 #define GROUP(grp, f) \
43 { \
44 .name = #grp, \
45 .pins = grp ## _pins, \
46 .num_pins = ARRAY_SIZE(grp ## _pins), \
47 .data = (const struct meson_pmx_axg_data[]){ \
48 PMX_DATA(f), \
49 }, \
52 #define GPIO_GROUP(gpio) \
53 { \
54 .name = #gpio, \
55 .pins = (const unsigned int[]){ gpio }, \
56 .num_pins = 1, \
57 .data = (const struct meson_pmx_axg_data[]){ \
58 PMX_DATA(0), \
59 }, \
62 extern const struct pinmux_ops meson_axg_pmx_ops;