Skip to content

Commit 0cf6f3c

Browse files
Carlo Caionelinusw
authored andcommitted
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: Carlo Caione <carlo@endlessm.com> Acked-by: Beniamino Galvani <b.galvani@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 parent 25a853d commit 0cf6f3c

File tree

2 files changed

+461
-597
lines changed

2 files changed

+461
-597
lines changed

drivers/pinctrl/meson/pinctrl-meson.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ struct meson_pinctrl {
155155
struct meson_domain *domains;
156156
};
157157

158+
#define PIN(x, b) (b + x)
159+
158160
#define GROUP(grp, r, b) \
159161
{ \
160162
.name = #grp, \
@@ -165,10 +167,10 @@ struct meson_pinctrl {
165167
.domain = 0, \
166168
}
167169

168-
#define GPIO_GROUP(gpio) \
170+
#define GPIO_GROUP(gpio, b) \
169171
{ \
170172
.name = #gpio, \
171-
.pins = (const unsigned int[]){ PIN_ ## gpio}, \
173+
.pins = (const unsigned int[]){ PIN(gpio, b) }, \
172174
.num_pins = 1, \
173175
.is_gpio = true, \
174176
}
@@ -204,6 +206,6 @@ struct meson_pinctrl {
204206
}, \
205207
}
206208

207-
#define MESON_PIN(x) PINCTRL_PIN(PIN_ ## x, #x)
209+
#define MESON_PIN(x, b) PINCTRL_PIN(PIN(x, b), #x)
208210

209211
extern struct meson_pinctrl_data meson8_pinctrl_data;

0 commit comments

Comments
 (0)