static const struct pinctrl_pin_desc amdisp_pins[] = {
PINCTRL_PIN(0, "GPIO_0"),
PINCTRL_PIN(1, "GPIO_1"),
PINCTRL_PIN(2, "GPIO_2"),
};
#define AMDISP_GPIO_PINS(pin) \
static const unsigned int gpio##pin##_pins[] = { pin }
AMDISP_GPIO_PINS(0);
AMDISP_GPIO_PINS(1);
AMDISP_GPIO_PINS(2);
static const unsigned int amdisp_range_pins[] = {
0, 1, 2
};
static const char * const amdisp_range_pins_name[] = {
"gpio0", "gpio1", "gpio2"
};
enum amdisp_functions {
mux_gpio,
mux_NA
};
static const char * const gpio_groups[] = {
"gpio0", "gpio1", "gpio2"
};
struct amdisp_function {
const char *name;
const char * const *groups;
unsigned int ngroups;
};
#define FUNCTION(fname) \
[mux_##fname] = { \
.name = #fname, \
.groups = fname##_groups, \
.ngroups = ARRAY_SIZE(fname##_groups), \
}
static const struct amdisp_function amdisp_functions[] = {
FUNCTION(gpio),
};
struct amdisp_pingroup {
const char *name;
const unsigned int *pins;
unsigned int npins;
unsigned int *funcs;
unsigned int nfuncs;
unsigned int offset;
};
#define PINGROUP(id, f0) \
{ \
.name = "gpio" #id, \
.pins = gpio##id##_pins, \
.npins = ARRAY_SIZE(gpio##id##_pins), \
.funcs = (int[]){ \
mux_##f0, \
}, \
.nfuncs = 1, \
.offset = id, \
}
static const struct amdisp_pingroup amdisp_groups[] = {
PINGROUP(0, gpio),
PINGROUP(1, gpio),
PINGROUP(2, gpio),
};