Skip to content

Commit eb3d334

Browse files
Huqiang Qinlinusw
authored andcommitted
pinctrl: Replace the IRQ number in the driver with the IRQID macro definition
Replacing IRQ numbers with IRQID macro definitions makes driver code easier to understand. Associated platforms: - Amlogic Meson-G12A - Amlogic Meson-G12B - Amlogic Meson-SM1 Signed-off-by: Huqiang Qin <[email protected]> Acked-by: Linus Walleij <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent 0e8ec02 commit eb3d334

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

drivers/pinctrl/meson/pinctrl-meson-g12a.c

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
*/
99

1010
#include <dt-bindings/gpio/meson-g12a-gpio.h>
11+
#include <dt-bindings/interrupt-controller/amlogic,meson-g12a-gpio-intc.h>
1112
#include "pinctrl-meson.h"
1213
#include "pinctrl-meson-axg-pmx.h"
1314

@@ -1318,31 +1319,31 @@ static struct meson_pmx_func meson_g12a_aobus_functions[] = {
13181319

13191320
static struct meson_bank meson_g12a_periphs_banks[] = {
13201321
/* name first last irq pullen pull dir out in ds */
1321-
BANK_DS("Z", GPIOZ_0, GPIOZ_15, 12, 27,
1322-
4, 0, 4, 0, 12, 0, 13, 0, 14, 0, 5, 0),
1323-
BANK_DS("H", GPIOH_0, GPIOH_8, 28, 36,
1324-
3, 0, 3, 0, 9, 0, 10, 0, 11, 0, 4, 0),
1325-
BANK_DS("BOOT", BOOT_0, BOOT_15, 37, 52,
1326-
0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0),
1327-
BANK_DS("C", GPIOC_0, GPIOC_7, 53, 60,
1328-
1, 0, 1, 0, 3, 0, 4, 0, 5, 0, 1, 0),
1329-
BANK_DS("A", GPIOA_0, GPIOA_15, 61, 76,
1330-
5, 0, 5, 0, 16, 0, 17, 0, 18, 0, 6, 0),
1331-
BANK_DS("X", GPIOX_0, GPIOX_19, 77, 96,
1332-
2, 0, 2, 0, 6, 0, 7, 0, 8, 0, 2, 0),
1322+
BANK_DS("Z", GPIOZ_0, GPIOZ_15, IRQID_GPIOZ_0, IRQID_GPIOZ_15,
1323+
4, 0, 4, 0, 12, 0, 13, 0, 14, 0, 5, 0),
1324+
BANK_DS("H", GPIOH_0, GPIOH_8, IRQID_GPIOH_0, IRQID_GPIOH_8,
1325+
3, 0, 3, 0, 9, 0, 10, 0, 11, 0, 4, 0),
1326+
BANK_DS("BOOT", BOOT_0, BOOT_15, IRQID_BOOT_0, IRQID_BOOT_15,
1327+
0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0),
1328+
BANK_DS("C", GPIOC_0, GPIOC_7, IRQID_GPIOC_0, IRQID_GPIOC_7,
1329+
1, 0, 1, 0, 3, 0, 4, 0, 5, 0, 1, 0),
1330+
BANK_DS("A", GPIOA_0, GPIOA_15, IRQID_GPIOA_0, IRQID_GPIOA_15,
1331+
5, 0, 5, 0, 16, 0, 17, 0, 18, 0, 6, 0),
1332+
BANK_DS("X", GPIOX_0, GPIOX_19, IRQID_GPIOX_0, IRQID_GPIOX_19,
1333+
2, 0, 2, 0, 6, 0, 7, 0, 8, 0, 2, 0),
13331334
};
13341335

13351336
static struct meson_bank meson_g12a_aobus_banks[] = {
13361337
/* name first last irq pullen pull dir out in ds */
1337-
BANK_DS("AO", GPIOAO_0, GPIOAO_11, 0, 11, 3, 0, 2, 0, 0, 0, 4, 0, 1, 0,
1338-
0, 0),
1338+
BANK_DS("AO", GPIOAO_0, GPIOAO_11, IRQID_GPIOAO_0, IRQID_GPIOAO_11,
1339+
3, 0, 2, 0, 0, 0, 4, 0, 1, 0, 0, 0),
13391340
/* GPIOE actually located in the AO bank */
1340-
BANK_DS("E", GPIOE_0, GPIOE_2, 97, 99, 3, 16, 2, 16, 0, 16, 4, 16, 1,
1341-
16, 1, 0),
1341+
BANK_DS("E", GPIOE_0, GPIOE_2, IRQID_GPIOE_0, IRQID_GPIOE_2,
1342+
3, 16, 2, 16, 0, 16, 4, 16, 1, 16, 1, 0),
13421343
};
13431344

13441345
static struct meson_pmx_bank meson_g12a_periphs_pmx_banks[] = {
1345-
/* name first lask reg offset */
1346+
/* name first last reg offset */
13461347
BANK_PMX("Z", GPIOZ_0, GPIOZ_15, 0x6, 0),
13471348
BANK_PMX("H", GPIOH_0, GPIOH_8, 0xb, 0),
13481349
BANK_PMX("BOOT", BOOT_0, BOOT_15, 0x0, 0),

0 commit comments

Comments
 (0)