Commit 0cf6f3c2 authored by Carlo Caione's avatar Carlo Caione Committed by Linus Walleij

pinctrl: Cleanup Meson8 driver

This patch introduces a new PIN macro and few small modifications to
simplify and shorten the Meson pinctrl drivers and cleanup the support
file for the AmLogic Meson8 SoC.
Signed-off-by: default avatarCarlo Caione <carlo@endlessm.com>
Acked-by: default avatarBeniamino Galvani <b.galvani@gmail.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 25a853d0
...@@ -155,6 +155,8 @@ struct meson_pinctrl { ...@@ -155,6 +155,8 @@ struct meson_pinctrl {
struct meson_domain *domains; struct meson_domain *domains;
}; };
#define PIN(x, b) (b + x)
#define GROUP(grp, r, b) \ #define GROUP(grp, r, b) \
{ \ { \
.name = #grp, \ .name = #grp, \
...@@ -165,10 +167,10 @@ struct meson_pinctrl { ...@@ -165,10 +167,10 @@ struct meson_pinctrl {
.domain = 0, \ .domain = 0, \
} }
#define GPIO_GROUP(gpio) \ #define GPIO_GROUP(gpio, b) \
{ \ { \
.name = #gpio, \ .name = #gpio, \
.pins = (const unsigned int[]){ PIN_ ## gpio}, \ .pins = (const unsigned int[]){ PIN(gpio, b) }, \
.num_pins = 1, \ .num_pins = 1, \
.is_gpio = true, \ .is_gpio = true, \
} }
...@@ -204,6 +206,6 @@ struct meson_pinctrl { ...@@ -204,6 +206,6 @@ struct meson_pinctrl {
}, \ }, \
} }
#define MESON_PIN(x) PINCTRL_PIN(PIN_ ## x, #x) #define MESON_PIN(x, b) PINCTRL_PIN(PIN(x, b), #x)
extern struct meson_pinctrl_data meson8_pinctrl_data; extern struct meson_pinctrl_data meson8_pinctrl_data;
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment