devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2 0/3] Add binding header file for GPIO interrupt of Amlogic Meson-G12A
@ 2023-07-24  6:01 Huqiang Qin
  2023-07-24  6:01 ` [PATCH V2 1/3] dt-bindings: interrupt-controller: Add header file for Amlogic Meson-G12A SoCs Huqiang Qin
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Huqiang Qin @ 2023-07-24  6:01 UTC (permalink / raw)
  To: robh+dt, krzysztof.kozlowski+dt, conor+dt, neil.armstrong,
	khilman, jbrunet, martin.blumenstingl, linus.walleij
  Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
	linux-gpio, Huqiang Qin

After adding this binding header file, you can intuitively find
the interrupt number corresponding to each GPIO, and apply it
in the format of IRQID_XXX where it needs to be used.

Associated platforms:
- Amlogic Meson-G12A
- Amlogic Meson-G12B
- Amlogic Meson-SM1

[PATCH 1/3]: 
  V1 -> V2: Rename irq-meson-g12a-gpio.h to amlogic,meson-g12a-gpio-intc.h

[PATCH 2/3]:
  V1 -> V2: Include header file changed to amlogic,meson-g12a-gpio-intc.h

[PATCH 3/3]:
  V1 -> V2: Include header file changed to amlogic,meson-g12a-gpio-intc.h

Huqiang Qin (3):
  dt-bindings: interrupt-controller: Add header file for Amlogic
    Meson-G12A SoCs
  pinctrl: Replace the IRQ number in the driver with the IRQID macro
    definition
  arm64: dts: Replace the IRQ number with the IRQID macro definition

 .../boot/dts/amlogic/meson-g12-common.dtsi    |   1 +
 .../boot/dts/amlogic/meson-g12a-x96-max.dts   |   2 +-
 .../dts/amlogic/meson-g12b-bananapi-cm4.dtsi  |   2 +-
 .../boot/dts/amlogic/meson-g12b-bananapi.dtsi |   2 +-
 .../amlogic/meson-g12b-odroid-go-ultra.dts    |   4 +-
 .../dts/amlogic/meson-g12b-odroid-n2.dtsi     |   2 +-
 .../boot/dts/amlogic/meson-g12b-w400.dtsi     |   2 +-
 .../dts/amlogic/meson-sm1-a95xf3-air-gbit.dts |   2 +-
 .../boot/dts/amlogic/meson-sm1-bananapi.dtsi  |   4 +-
 .../boot/dts/amlogic/meson-sm1-h96-max.dts    |   2 +-
 .../boot/dts/amlogic/meson-sm1-odroid.dtsi    |   2 +-
 .../boot/dts/amlogic/meson-sm1-sei610.dts     |  12 +-
 .../dts/amlogic/meson-sm1-x96-air-gbit.dts    |   2 +-
 drivers/pinctrl/meson/pinctrl-meson-g12a.c    |  35 ++---
 .../amlogic,meson-g12a-gpio-intc.h            | 126 ++++++++++++++++++
 15 files changed, 164 insertions(+), 36 deletions(-)
 create mode 100644 include/dt-bindings/interrupt-controller/amlogic,meson-g12a-gpio-intc.h


base-commit: c58c49dd89324b18a812762a2bfa5a0458e4f252
-- 
2.37.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH V2 1/3] dt-bindings: interrupt-controller: Add header file for Amlogic Meson-G12A SoCs
  2023-07-24  6:01 [PATCH V2 0/3] Add binding header file for GPIO interrupt of Amlogic Meson-G12A Huqiang Qin
@ 2023-07-24  6:01 ` Huqiang Qin
  2023-07-24  7:25   ` Krzysztof Kozlowski
  2023-07-24  6:01 ` [PATCH V2 2/3] pinctrl: Replace the IRQ number in the driver with the IRQID macro definition Huqiang Qin
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 9+ messages in thread
From: Huqiang Qin @ 2023-07-24  6:01 UTC (permalink / raw)
  To: robh+dt, krzysztof.kozlowski+dt, conor+dt, neil.armstrong,
	khilman, jbrunet, martin.blumenstingl, linus.walleij
  Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
	linux-gpio, Huqiang Qin

Add a new dt-binding header that details the interrupt number of the GPIO.

Signed-off-by: Huqiang Qin <huqiang.qin@amlogic.com>
---

V1 -> V2: Rename irq-meson-g12a-gpio.h to amlogic,meson-g12a-gpio-intc.h

 .../amlogic,meson-g12a-gpio-intc.h            | 126 ++++++++++++++++++
 1 file changed, 126 insertions(+)
 create mode 100644 include/dt-bindings/interrupt-controller/amlogic,meson-g12a-gpio-intc.h

diff --git a/include/dt-bindings/interrupt-controller/amlogic,meson-g12a-gpio-intc.h b/include/dt-bindings/interrupt-controller/amlogic,meson-g12a-gpio-intc.h
new file mode 100644
index 000000000000..bd415cb7b669
--- /dev/null
+++ b/include/dt-bindings/interrupt-controller/amlogic,meson-g12a-gpio-intc.h
@@ -0,0 +1,126 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */
+/*
+ * Copyright (c) 2023 Amlogic, Inc. All rights reserved.
+ * Author: Huqiang Qin <huqiang.qin@amlogic.com>
+ */
+
+#ifndef _DT_BINDINGS_IRQ_MESON_G12A_GPIO_H
+#define _DT_BINDINGS_IRQ_MESON_G12A_GPIO_H
+
+/* IRQID[11:0] - GPIOAO[11:0] */
+#define IRQID_GPIOAO_0		0
+#define IRQID_GPIOAO_1		1
+#define IRQID_GPIOAO_2		2
+#define IRQID_GPIOAO_3		3
+#define IRQID_GPIOAO_4		4
+#define IRQID_GPIOAO_5		5
+#define IRQID_GPIOAO_6		6
+#define IRQID_GPIOAO_7		7
+#define IRQID_GPIOAO_8		8
+#define IRQID_GPIOAO_9		9
+#define IRQID_GPIOAO_10		10
+#define IRQID_GPIOAO_11		11
+
+/* IRQID[27:12] - GPIOZ[15:0] */
+#define IRQID_GPIOZ_0		12
+#define IRQID_GPIOZ_1		13
+#define IRQID_GPIOZ_2		14
+#define IRQID_GPIOZ_3		15
+#define IRQID_GPIOZ_4		16
+#define IRQID_GPIOZ_5		17
+#define IRQID_GPIOZ_6		18
+#define IRQID_GPIOZ_7		19
+#define IRQID_GPIOZ_8		20
+#define IRQID_GPIOZ_9		21
+#define IRQID_GPIOZ_10		22
+#define IRQID_GPIOZ_11		23
+#define IRQID_GPIOZ_12		24
+#define IRQID_GPIOZ_13		25
+#define IRQID_GPIOZ_14		26
+#define IRQID_GPIOZ_15		27
+
+/* IRQID[36:28] - GPIOH[8:0] */
+#define IRQID_GPIOH_0		28
+#define IRQID_GPIOH_1		29
+#define IRQID_GPIOH_2		30
+#define IRQID_GPIOH_3		31
+#define IRQID_GPIOH_4		32
+#define IRQID_GPIOH_5		33
+#define IRQID_GPIOH_6		34
+#define IRQID_GPIOH_7		35
+#define IRQID_GPIOH_8		36
+
+/* IRQID[52:37] - BOOT[15:0] */
+#define IRQID_BOOT_0		37
+#define IRQID_BOOT_1		38
+#define IRQID_BOOT_2		39
+#define IRQID_BOOT_3		40
+#define IRQID_BOOT_4		41
+#define IRQID_BOOT_5		42
+#define IRQID_BOOT_6		43
+#define IRQID_BOOT_7		44
+#define IRQID_BOOT_8		45
+#define IRQID_BOOT_9		46
+#define IRQID_BOOT_10		47
+#define IRQID_BOOT_11		48
+#define IRQID_BOOT_12		49
+#define IRQID_BOOT_13		50
+#define IRQID_BOOT_14		51
+#define IRQID_BOOT_15		52
+
+/* IRQID[60:53] - GPIOC[7:0] */
+#define IRQID_GPIOC_0		53
+#define IRQID_GPIOC_1		54
+#define IRQID_GPIOC_2		55
+#define IRQID_GPIOC_3		56
+#define IRQID_GPIOC_4		57
+#define IRQID_GPIOC_5		58
+#define IRQID_GPIOC_6		59
+#define IRQID_GPIOC_7		60
+
+/* IRQID[76:61] - GPIOA[15:0] */
+#define IRQID_GPIOA_0		61
+#define IRQID_GPIOA_1		62
+#define IRQID_GPIOA_2		63
+#define IRQID_GPIOA_3		64
+#define IRQID_GPIOA_4		65
+#define IRQID_GPIOA_5		66
+#define IRQID_GPIOA_6		67
+#define IRQID_GPIOA_7		68
+#define IRQID_GPIOA_8		69
+#define IRQID_GPIOA_9		70
+#define IRQID_GPIOA_10		71
+#define IRQID_GPIOA_11		72
+#define IRQID_GPIOA_12		73
+#define IRQID_GPIOA_13		74
+#define IRQID_GPIOA_14		75
+#define IRQID_GPIOA_15		76
+
+/* IRQID[96:77] - GPIOX[19:0] */
+#define IRQID_GPIOX_0		77
+#define IRQID_GPIOX_1		78
+#define IRQID_GPIOX_2		79
+#define IRQID_GPIOX_3		80
+#define IRQID_GPIOX_4		81
+#define IRQID_GPIOX_5		82
+#define IRQID_GPIOX_6		83
+#define IRQID_GPIOX_7		84
+#define IRQID_GPIOX_8		85
+#define IRQID_GPIOX_9		86
+#define IRQID_GPIOX_10		87
+#define IRQID_GPIOX_11		88
+#define IRQID_GPIOX_12		89
+#define IRQID_GPIOX_13		90
+#define IRQID_GPIOX_14		91
+#define IRQID_GPIOX_15		92
+#define IRQID_GPIOX_16		93
+#define IRQID_GPIOX_17		94
+#define IRQID_GPIOX_18		95
+#define IRQID_GPIOX_19		96
+
+/* IRQID[99:97] - GPIOE[2:0] */
+#define IRQID_GPIOE_0		97
+#define IRQID_GPIOE_1		98
+#define IRQID_GPIOE_2		99
+
+#endif /* _DT_BINDINGS_IRQ_MESON_G12A_GPIO_H */
-- 
2.37.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH V2 2/3] pinctrl: Replace the IRQ number in the driver with the IRQID macro definition
  2023-07-24  6:01 [PATCH V2 0/3] Add binding header file for GPIO interrupt of Amlogic Meson-G12A Huqiang Qin
  2023-07-24  6:01 ` [PATCH V2 1/3] dt-bindings: interrupt-controller: Add header file for Amlogic Meson-G12A SoCs Huqiang Qin
@ 2023-07-24  6:01 ` Huqiang Qin
  2023-07-24  6:01 ` [PATCH V2 3/3] arm64: dts: Replace the IRQ number " Huqiang Qin
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Huqiang Qin @ 2023-07-24  6:01 UTC (permalink / raw)
  To: robh+dt, krzysztof.kozlowski+dt, conor+dt, neil.armstrong,
	khilman, jbrunet, martin.blumenstingl, linus.walleij
  Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
	linux-gpio, Huqiang Qin

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 <huqiang.qin@amlogic.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
---

V1 -> V2: Include header file changed to amlogic,meson-g12a-gpio-intc.h

 drivers/pinctrl/meson/pinctrl-meson-g12a.c | 35 +++++++++++-----------
 1 file changed, 18 insertions(+), 17 deletions(-)

diff --git a/drivers/pinctrl/meson/pinctrl-meson-g12a.c b/drivers/pinctrl/meson/pinctrl-meson-g12a.c
index d182a575981e..3cd86d6a0a60 100644
--- a/drivers/pinctrl/meson/pinctrl-meson-g12a.c
+++ b/drivers/pinctrl/meson/pinctrl-meson-g12a.c
@@ -8,6 +8,7 @@
  */
 
 #include <dt-bindings/gpio/meson-g12a-gpio.h>
+#include <dt-bindings/interrupt-controller/amlogic,meson-g12a-gpio-intc.h>
 #include "pinctrl-meson.h"
 #include "pinctrl-meson-axg-pmx.h"
 
@@ -1318,31 +1319,31 @@ static struct meson_pmx_func meson_g12a_aobus_functions[] = {
 
 static struct meson_bank meson_g12a_periphs_banks[] = {
 	/* name  first  last  irq  pullen  pull  dir  out  in  ds */
-	BANK_DS("Z",    GPIOZ_0,    GPIOZ_15, 12, 27,
-		4,  0,  4,  0,  12,  0,  13, 0,  14, 0, 5, 0),
-	BANK_DS("H",    GPIOH_0,    GPIOH_8, 28, 36,
-		3,  0,  3,  0,  9,  0,  10,  0,  11,  0, 4, 0),
-	BANK_DS("BOOT", BOOT_0,     BOOT_15,  37, 52,
-		0,  0,  0,  0,  0, 0,  1, 0,  2, 0, 0, 0),
-	BANK_DS("C",    GPIOC_0,    GPIOC_7,  53, 60,
-		1,  0,  1,  0,  3, 0,  4, 0,  5, 0, 1, 0),
-	BANK_DS("A",    GPIOA_0,    GPIOA_15,  61, 76,
-		5,  0,  5,  0,  16,  0,  17,  0,  18,  0, 6, 0),
-	BANK_DS("X",    GPIOX_0,    GPIOX_19,   77, 96,
-		2,  0,  2,  0,  6,  0,  7,  0,  8,  0, 2, 0),
+	BANK_DS("Z",    GPIOZ_0,  GPIOZ_15,  IRQID_GPIOZ_0,  IRQID_GPIOZ_15,
+		4,  0,  4,  0,  12,  0, 13,  0,  14,  0,  5, 0),
+	BANK_DS("H",    GPIOH_0,  GPIOH_8,   IRQID_GPIOH_0,  IRQID_GPIOH_8,
+		3,  0,  3,  0,   9,  0, 10,  0,  11,  0,  4, 0),
+	BANK_DS("BOOT", BOOT_0,   BOOT_15,   IRQID_BOOT_0,   IRQID_BOOT_15,
+		0,  0,  0,  0,   0,  0,  1,  0,   2,  0,  0, 0),
+	BANK_DS("C",    GPIOC_0,  GPIOC_7,   IRQID_GPIOC_0,  IRQID_GPIOC_7,
+		1,  0,  1,  0,   3,  0,  4,  0,   5,  0,  1, 0),
+	BANK_DS("A",    GPIOA_0,  GPIOA_15,  IRQID_GPIOA_0,  IRQID_GPIOA_15,
+		5,  0,  5,  0,  16,  0, 17,  0,  18,  0,  6, 0),
+	BANK_DS("X",    GPIOX_0,  GPIOX_19,  IRQID_GPIOX_0,  IRQID_GPIOX_19,
+		2,  0,  2,  0,   6,  0,  7,  0,   8,  0,  2, 0),
 };
 
 static struct meson_bank meson_g12a_aobus_banks[] = {
 	/* name  first  last  irq  pullen  pull  dir  out  in  ds */
-	BANK_DS("AO", GPIOAO_0, GPIOAO_11, 0, 11, 3, 0, 2, 0, 0, 0, 4, 0, 1, 0,
-		0, 0),
+	BANK_DS("AO",   GPIOAO_0, GPIOAO_11, IRQID_GPIOAO_0, IRQID_GPIOAO_11,
+		3,  0,  2,  0,   0,  0,  4,  0,   1,  0,  0, 0),
 	/* GPIOE actually located in the AO bank */
-	BANK_DS("E", GPIOE_0, GPIOE_2, 97, 99, 3, 16, 2, 16, 0, 16, 4, 16, 1,
-		16, 1, 0),
+	BANK_DS("E",    GPIOE_0,  GPIOE_2,   IRQID_GPIOE_0,  IRQID_GPIOE_2,
+		3, 16,  2, 16,   0, 16,  4, 16,   1, 16,  1, 0),
 };
 
 static struct meson_pmx_bank meson_g12a_periphs_pmx_banks[] = {
-	/*	 name	 first		lask	   reg	offset  */
+	/*	 name	 first	  last	    reg	 offset  */
 	BANK_PMX("Z",    GPIOZ_0, GPIOZ_15, 0x6, 0),
 	BANK_PMX("H",    GPIOH_0, GPIOH_8,  0xb, 0),
 	BANK_PMX("BOOT", BOOT_0,  BOOT_15,  0x0, 0),
-- 
2.37.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH V2 3/3] arm64: dts: Replace the IRQ number with the IRQID macro definition
  2023-07-24  6:01 [PATCH V2 0/3] Add binding header file for GPIO interrupt of Amlogic Meson-G12A Huqiang Qin
  2023-07-24  6:01 ` [PATCH V2 1/3] dt-bindings: interrupt-controller: Add header file for Amlogic Meson-G12A SoCs Huqiang Qin
  2023-07-24  6:01 ` [PATCH V2 2/3] pinctrl: Replace the IRQ number in the driver with the IRQID macro definition Huqiang Qin
@ 2023-07-24  6:01 ` Huqiang Qin
  2023-07-31  8:47   ` neil.armstrong
  2023-07-31  8:49 ` [PATCH V2 0/3] Add binding header file for GPIO interrupt of Amlogic Meson-G12A neil.armstrong
  2023-08-07 13:37 ` Linus Walleij
  4 siblings, 1 reply; 9+ messages in thread
From: Huqiang Qin @ 2023-07-24  6:01 UTC (permalink / raw)
  To: robh+dt, krzysztof.kozlowski+dt, conor+dt, neil.armstrong,
	khilman, jbrunet, martin.blumenstingl, linus.walleij
  Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
	linux-gpio, Huqiang Qin

Replacing IRQ numbers with IRQID macro definitions makes node properties
easier to understand and also makes GPIO interrupts easier to use.

Associated platforms:
- Amlogic Meson-G12A
- Amlogic Meson-G12B
- Amlogic Meson-SM1

Signed-off-by: Huqiang Qin <huqiang.qin@amlogic.com>
---

V1 -> V2: Include header file changed to amlogic,meson-g12a-gpio-intc.h

 arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi    |  1 +
 arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts   |  2 +-
 .../boot/dts/amlogic/meson-g12b-bananapi-cm4.dtsi    |  2 +-
 arch/arm64/boot/dts/amlogic/meson-g12b-bananapi.dtsi |  2 +-
 .../boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts  |  4 ++--
 .../arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi |  2 +-
 arch/arm64/boot/dts/amlogic/meson-g12b-w400.dtsi     |  2 +-
 .../boot/dts/amlogic/meson-sm1-a95xf3-air-gbit.dts   |  2 +-
 arch/arm64/boot/dts/amlogic/meson-sm1-bananapi.dtsi  |  4 ++--
 arch/arm64/boot/dts/amlogic/meson-sm1-h96-max.dts    |  2 +-
 arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi    |  2 +-
 arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts     | 12 ++++++------
 .../boot/dts/amlogic/meson-sm1-x96-air-gbit.dts      |  2 +-
 13 files changed, 20 insertions(+), 19 deletions(-)

diff --git a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
index 0c49655cc90c..d8b94a3167c3 100644
--- a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
@@ -9,6 +9,7 @@
 #include <dt-bindings/clock/g12a-aoclkc.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/interrupt-controller/amlogic,meson-g12a-gpio-intc.h>
 #include <dt-bindings/reset/amlogic,meson-g12a-reset.h>
 #include <dt-bindings/thermal/thermal.h>
 
diff --git a/arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts b/arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts
index b2bb94981838..c79f3e8d26b7 100644
--- a/arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts
@@ -344,7 +344,7 @@ external_phy: ethernet-phy@0 {
 
 		interrupt-parent = <&gpio_intc>;
 		/* MAC_INTR on GPIOZ_14 */
-		interrupts = <26 IRQ_TYPE_LEVEL_LOW>;
+		interrupts = <IRQID_GPIOZ_14 IRQ_TYPE_LEVEL_LOW>;
 	};
 };
 
diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-bananapi-cm4.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b-bananapi-cm4.dtsi
index 97e522921b06..428b35e1d79c 100644
--- a/arch/arm64/boot/dts/amlogic/meson-g12b-bananapi-cm4.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-g12b-bananapi-cm4.dtsi
@@ -201,7 +201,7 @@ external_phy: ethernet-phy@0 {
 
 		interrupt-parent = <&gpio_intc>;
 		/* MAC_INTR on GPIOZ_14 */
-		interrupts = <26 IRQ_TYPE_LEVEL_LOW>;
+		interrupts = <IRQID_GPIOZ_14 IRQ_TYPE_LEVEL_LOW>;
 	};
 };
 
diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-bananapi.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b-bananapi.dtsi
index 83709787eb91..c69b0f803916 100644
--- a/arch/arm64/boot/dts/amlogic/meson-g12b-bananapi.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-g12b-bananapi.dtsi
@@ -327,7 +327,7 @@ external_phy: ethernet-phy@0 {
 
 		interrupt-parent = <&gpio_intc>;
 		/* MAC_INTR on GPIOZ_14 */
-		interrupts = <26 IRQ_TYPE_LEVEL_LOW>;
+		interrupts = <IRQID_GPIOZ_14 IRQ_TYPE_LEVEL_LOW>;
 	};
 };
 
diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts
index 276e95b34022..eed2a23047ca 100644
--- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts
@@ -380,7 +380,7 @@ rk818: pmic@1c {
 		compatible = "rockchip,rk818";
 		reg = <0x1c>;
 		interrupt-parent = <&gpio_intc>;
-		interrupts = <7 IRQ_TYPE_LEVEL_LOW>; /* GPIOAO_7 */
+		interrupts = <IRQID_GPIOAO_7 IRQ_TYPE_LEVEL_LOW>; /* GPIOAO_7 */
 		#clock-cells = <1>;
 
 		vcc1-supply = <&vdd_sys>;
@@ -519,7 +519,7 @@ rk817: pmic@20 {
 		reg = <0x20>;
 		interrupt-parent = <&gpio_intc>;
 
-		interrupts = <5 IRQ_TYPE_LEVEL_LOW>; /* GPIOAO_5 */
+		interrupts = <IRQID_GPIOAO_5 IRQ_TYPE_LEVEL_LOW>; /* GPIOAO_5 */
 
 		vcc1-supply = <&vdd_sys>;
 		vcc2-supply = <&vdd_sys>;
diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
index 24d0442dffb2..01aa970b2f8c 100644
--- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
@@ -185,7 +185,7 @@ external_phy: ethernet-phy@0 {
 
 		interrupt-parent = <&gpio_intc>;
 		/* MAC_INTR on GPIOZ_14 */
-		interrupts = <26 IRQ_TYPE_LEVEL_LOW>;
+		interrupts = <IRQID_GPIOZ_14 IRQ_TYPE_LEVEL_LOW>;
 	};
 };
 
diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-w400.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b-w400.dtsi
index b40d2c1002c9..ac8b7178257e 100644
--- a/arch/arm64/boot/dts/amlogic/meson-g12b-w400.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-g12b-w400.dtsi
@@ -269,7 +269,7 @@ external_phy: ethernet-phy@0 {
 
 		interrupt-parent = <&gpio_intc>;
 		/* MAC_INTR on GPIOZ_14 */
-		interrupts = <26 IRQ_TYPE_LEVEL_LOW>;
+		interrupts = <IRQID_GPIOZ_14 IRQ_TYPE_LEVEL_LOW>;
 	};
 };
 
diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-a95xf3-air-gbit.dts b/arch/arm64/boot/dts/amlogic/meson-sm1-a95xf3-air-gbit.dts
index d1debccdc1c2..95e03bb02af2 100644
--- a/arch/arm64/boot/dts/amlogic/meson-sm1-a95xf3-air-gbit.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-sm1-a95xf3-air-gbit.dts
@@ -100,7 +100,7 @@ external_phy: ethernet-phy@0 {
 
 		interrupt-parent = <&gpio_intc>;
 		/* MAC_INTR on GPIOZ_14 */
-		interrupts = <26 IRQ_TYPE_LEVEL_LOW>;
+		interrupts = <IRQID_GPIOZ_14 IRQ_TYPE_LEVEL_LOW>;
 	};
 };
 
diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-bananapi.dtsi b/arch/arm64/boot/dts/amlogic/meson-sm1-bananapi.dtsi
index 17045ff81c69..62404743e62d 100644
--- a/arch/arm64/boot/dts/amlogic/meson-sm1-bananapi.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-sm1-bananapi.dtsi
@@ -45,7 +45,7 @@ key {
 			linux,code = <BTN_1>;
 			gpios = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_LOW>;
 			interrupt-parent = <&gpio_intc>;
-			interrupts = <3 IRQ_TYPE_EDGE_BOTH>;
+			interrupts = <IRQID_GPIOAO_3 IRQ_TYPE_EDGE_BOTH>;
 		};
 	};
 
@@ -217,7 +217,7 @@ external_phy: ethernet-phy@0 {
 
 		interrupt-parent = <&gpio_intc>;
 		/* MAC_INTR on GPIOZ_14 */
-		interrupts = <26 IRQ_TYPE_LEVEL_LOW>;
+		interrupts = <IRQID_GPIOZ_14 IRQ_TYPE_LEVEL_LOW>;
 	};
 };
 
diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-h96-max.dts b/arch/arm64/boot/dts/amlogic/meson-sm1-h96-max.dts
index 0f6660e68e72..ebda1dd30fa6 100644
--- a/arch/arm64/boot/dts/amlogic/meson-sm1-h96-max.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-sm1-h96-max.dts
@@ -100,7 +100,7 @@ external_phy: ethernet-phy@0 {
 
 		interrupt-parent = <&gpio_intc>;
 		/* MAC_INTR on GPIOZ_14 */
-		interrupts = <26 IRQ_TYPE_LEVEL_LOW>;
+		interrupts = <IRQID_GPIOZ_14 IRQ_TYPE_LEVEL_LOW>;
 	};
 };
 
diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi
index 2fce44939f45..86b90f44a4b3 100644
--- a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi
@@ -283,7 +283,7 @@ external_phy: ethernet-phy@0 {
 
 		interrupt-parent = <&gpio_intc>;
 		/* MAC_INTR on GPIOZ_14 */
-		interrupts = <26 IRQ_TYPE_LEVEL_LOW>;
+		interrupts = <IRQID_GPIOZ_14 IRQ_TYPE_LEVEL_LOW>;
 	};
 };
 
diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts b/arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts
index 9068a334ea57..4f07d6387bb1 100644
--- a/arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts
@@ -53,7 +53,7 @@ key-1 {
 			linux,code = <BTN_0>;
 			gpios = <&gpio GPIOH_6 GPIO_ACTIVE_LOW>;
 			interrupt-parent = <&gpio_intc>;
-			interrupts = <34 IRQ_TYPE_EDGE_BOTH>;
+			interrupts = <IRQID_GPIOH_6 IRQ_TYPE_EDGE_BOTH>;
 		};
 
 		key-2 {
@@ -61,7 +61,7 @@ key-2 {
 			linux,code = <BTN_1>;
 			gpios = <&gpio GPIOH_7 GPIO_ACTIVE_LOW>;
 			interrupt-parent = <&gpio_intc>;
-			interrupts = <35 IRQ_TYPE_EDGE_BOTH>;
+			interrupts = <IRQID_GPIOH_7 IRQ_TYPE_EDGE_BOTH>;
 		};
 
 		key-3 {
@@ -69,7 +69,7 @@ key-3 {
 			linux,code = <BTN_2>;
 			gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>;
 			interrupt-parent = <&gpio_intc>;
-			interrupts = <2 IRQ_TYPE_EDGE_BOTH>;
+			interrupts = <IRQID_GPIOAO_2 IRQ_TYPE_EDGE_BOTH>;
 		};
 
 		key-mic-mute {
@@ -78,7 +78,7 @@ key-mic-mute {
 			linux,input-type = <EV_SW>;
 			gpios = <&gpio_ao GPIOE_2 GPIO_ACTIVE_LOW>;
 			interrupt-parent = <&gpio_intc>;
-			interrupts = <99 IRQ_TYPE_EDGE_BOTH>;
+			interrupts = <IRQID_GPIOE_2 IRQ_TYPE_EDGE_BOTH>;
 		};
 
 		key-power {
@@ -86,7 +86,7 @@ key-power {
 			linux,code = <KEY_POWER>;
 			gpios = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_LOW>;
 			interrupt-parent = <&gpio_intc>;
-			interrupts = <3 IRQ_TYPE_EDGE_BOTH>;
+			interrupts = <IRQID_GPIOAO_3 IRQ_TYPE_EDGE_BOTH>;
 		};
 	};
 
@@ -583,7 +583,7 @@ &uart_A {
 	bluetooth {
 		compatible = "brcm,bcm43438-bt";
 		interrupt-parent = <&gpio_intc>;
-		interrupts = <95 IRQ_TYPE_LEVEL_HIGH>;
+		interrupts = <IRQID_GPIOX_18 IRQ_TYPE_LEVEL_HIGH>;
 		interrupt-names = "host-wakeup";
 		shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>;
 		max-speed = <2000000>;
diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-x96-air-gbit.dts b/arch/arm64/boot/dts/amlogic/meson-sm1-x96-air-gbit.dts
index 7e1a74046ba5..6ee406066ee0 100644
--- a/arch/arm64/boot/dts/amlogic/meson-sm1-x96-air-gbit.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-sm1-x96-air-gbit.dts
@@ -100,7 +100,7 @@ external_phy: ethernet-phy@0 {
 
 		interrupt-parent = <&gpio_intc>;
 		/* MAC_INTR on GPIOZ_14 */
-		interrupts = <26 IRQ_TYPE_LEVEL_LOW>;
+		interrupts = <IRQID_GPIOZ_14 IRQ_TYPE_LEVEL_LOW>;
 	};
 };
 
-- 
2.37.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH V2 1/3] dt-bindings: interrupt-controller: Add header file for Amlogic Meson-G12A SoCs
  2023-07-24  6:01 ` [PATCH V2 1/3] dt-bindings: interrupt-controller: Add header file for Amlogic Meson-G12A SoCs Huqiang Qin
@ 2023-07-24  7:25   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2023-07-24  7:25 UTC (permalink / raw)
  To: Huqiang Qin, robh+dt, krzysztof.kozlowski+dt, conor+dt,
	neil.armstrong, khilman, jbrunet, martin.blumenstingl,
	linus.walleij
  Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
	linux-gpio

On 24/07/2023 08:01, Huqiang Qin wrote:
> Add a new dt-binding header that details the interrupt number of the GPIO.
> 
> Signed-off-by: Huqiang Qin <huqiang.qin@amlogic.com>
> ---
> 
> V1 -> V2: Rename irq-meson-g12a-gpio.h to amlogic,meson-g12a-gpio-intc.h


Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH V2 3/3] arm64: dts: Replace the IRQ number with the IRQID macro definition
  2023-07-24  6:01 ` [PATCH V2 3/3] arm64: dts: Replace the IRQ number " Huqiang Qin
@ 2023-07-31  8:47   ` neil.armstrong
  0 siblings, 0 replies; 9+ messages in thread
From: neil.armstrong @ 2023-07-31  8:47 UTC (permalink / raw)
  To: Huqiang Qin, robh+dt, krzysztof.kozlowski+dt, conor+dt, khilman,
	jbrunet, martin.blumenstingl, linus.walleij
  Cc: devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
	linux-gpio

On 24/07/2023 08:01, Huqiang Qin wrote:
> Replacing IRQ numbers with IRQID macro definitions makes node properties
> easier to understand and also makes GPIO interrupts easier to use.
> 
> Associated platforms:
> - Amlogic Meson-G12A
> - Amlogic Meson-G12B
> - Amlogic Meson-SM1
> 
> Signed-off-by: Huqiang Qin <huqiang.qin@amlogic.com>
> ---
> 
> V1 -> V2: Include header file changed to amlogic,meson-g12a-gpio-intc.h
> 
>   arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi    |  1 +
>   arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts   |  2 +-
>   .../boot/dts/amlogic/meson-g12b-bananapi-cm4.dtsi    |  2 +-
>   arch/arm64/boot/dts/amlogic/meson-g12b-bananapi.dtsi |  2 +-
>   .../boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts  |  4 ++--
>   .../arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi |  2 +-
>   arch/arm64/boot/dts/amlogic/meson-g12b-w400.dtsi     |  2 +-
>   .../boot/dts/amlogic/meson-sm1-a95xf3-air-gbit.dts   |  2 +-
>   arch/arm64/boot/dts/amlogic/meson-sm1-bananapi.dtsi  |  4 ++--
>   arch/arm64/boot/dts/amlogic/meson-sm1-h96-max.dts    |  2 +-
>   arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi    |  2 +-
>   arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts     | 12 ++++++------
>   .../boot/dts/amlogic/meson-sm1-x96-air-gbit.dts      |  2 +-
>   13 files changed, 20 insertions(+), 19 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
> index 0c49655cc90c..d8b94a3167c3 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
> @@ -9,6 +9,7 @@
>   #include <dt-bindings/clock/g12a-aoclkc.h>
>   #include <dt-bindings/interrupt-controller/irq.h>
>   #include <dt-bindings/interrupt-controller/arm-gic.h>
> +#include <dt-bindings/interrupt-controller/amlogic,meson-g12a-gpio-intc.h>
>   #include <dt-bindings/reset/amlogic,meson-g12a-reset.h>
>   #include <dt-bindings/thermal/thermal.h>
>   
> diff --git a/arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts b/arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts
> index b2bb94981838..c79f3e8d26b7 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts
> +++ b/arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts
> @@ -344,7 +344,7 @@ external_phy: ethernet-phy@0 {
>   
>   		interrupt-parent = <&gpio_intc>;
>   		/* MAC_INTR on GPIOZ_14 */
> -		interrupts = <26 IRQ_TYPE_LEVEL_LOW>;
> +		interrupts = <IRQID_GPIOZ_14 IRQ_TYPE_LEVEL_LOW>;
>   	};
>   };
>   
> diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-bananapi-cm4.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b-bananapi-cm4.dtsi
> index 97e522921b06..428b35e1d79c 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-g12b-bananapi-cm4.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/meson-g12b-bananapi-cm4.dtsi
> @@ -201,7 +201,7 @@ external_phy: ethernet-phy@0 {
>   
>   		interrupt-parent = <&gpio_intc>;
>   		/* MAC_INTR on GPIOZ_14 */
> -		interrupts = <26 IRQ_TYPE_LEVEL_LOW>;
> +		interrupts = <IRQID_GPIOZ_14 IRQ_TYPE_LEVEL_LOW>;
>   	};
>   };
>   
> diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-bananapi.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b-bananapi.dtsi
> index 83709787eb91..c69b0f803916 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-g12b-bananapi.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/meson-g12b-bananapi.dtsi
> @@ -327,7 +327,7 @@ external_phy: ethernet-phy@0 {
>   
>   		interrupt-parent = <&gpio_intc>;
>   		/* MAC_INTR on GPIOZ_14 */
> -		interrupts = <26 IRQ_TYPE_LEVEL_LOW>;
> +		interrupts = <IRQID_GPIOZ_14 IRQ_TYPE_LEVEL_LOW>;
>   	};
>   };
>   
> diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts
> index 276e95b34022..eed2a23047ca 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts
> +++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts
> @@ -380,7 +380,7 @@ rk818: pmic@1c {
>   		compatible = "rockchip,rk818";
>   		reg = <0x1c>;
>   		interrupt-parent = <&gpio_intc>;
> -		interrupts = <7 IRQ_TYPE_LEVEL_LOW>; /* GPIOAO_7 */
> +		interrupts = <IRQID_GPIOAO_7 IRQ_TYPE_LEVEL_LOW>; /* GPIOAO_7 */
>   		#clock-cells = <1>;
>   
>   		vcc1-supply = <&vdd_sys>;
> @@ -519,7 +519,7 @@ rk817: pmic@20 {
>   		reg = <0x20>;
>   		interrupt-parent = <&gpio_intc>;
>   
> -		interrupts = <5 IRQ_TYPE_LEVEL_LOW>; /* GPIOAO_5 */
> +		interrupts = <IRQID_GPIOAO_5 IRQ_TYPE_LEVEL_LOW>; /* GPIOAO_5 */
>   
>   		vcc1-supply = <&vdd_sys>;
>   		vcc2-supply = <&vdd_sys>;
> diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
> index 24d0442dffb2..01aa970b2f8c 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
> @@ -185,7 +185,7 @@ external_phy: ethernet-phy@0 {
>   
>   		interrupt-parent = <&gpio_intc>;
>   		/* MAC_INTR on GPIOZ_14 */
> -		interrupts = <26 IRQ_TYPE_LEVEL_LOW>;
> +		interrupts = <IRQID_GPIOZ_14 IRQ_TYPE_LEVEL_LOW>;
>   	};
>   };
>   
> diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-w400.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b-w400.dtsi
> index b40d2c1002c9..ac8b7178257e 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-g12b-w400.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/meson-g12b-w400.dtsi
> @@ -269,7 +269,7 @@ external_phy: ethernet-phy@0 {
>   
>   		interrupt-parent = <&gpio_intc>;
>   		/* MAC_INTR on GPIOZ_14 */
> -		interrupts = <26 IRQ_TYPE_LEVEL_LOW>;
> +		interrupts = <IRQID_GPIOZ_14 IRQ_TYPE_LEVEL_LOW>;
>   	};
>   };
>   
> diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-a95xf3-air-gbit.dts b/arch/arm64/boot/dts/amlogic/meson-sm1-a95xf3-air-gbit.dts
> index d1debccdc1c2..95e03bb02af2 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-sm1-a95xf3-air-gbit.dts
> +++ b/arch/arm64/boot/dts/amlogic/meson-sm1-a95xf3-air-gbit.dts
> @@ -100,7 +100,7 @@ external_phy: ethernet-phy@0 {
>   
>   		interrupt-parent = <&gpio_intc>;
>   		/* MAC_INTR on GPIOZ_14 */
> -		interrupts = <26 IRQ_TYPE_LEVEL_LOW>;
> +		interrupts = <IRQID_GPIOZ_14 IRQ_TYPE_LEVEL_LOW>;
>   	};
>   };
>   
> diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-bananapi.dtsi b/arch/arm64/boot/dts/amlogic/meson-sm1-bananapi.dtsi
> index 17045ff81c69..62404743e62d 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-sm1-bananapi.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/meson-sm1-bananapi.dtsi
> @@ -45,7 +45,7 @@ key {
>   			linux,code = <BTN_1>;
>   			gpios = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_LOW>;
>   			interrupt-parent = <&gpio_intc>;
> -			interrupts = <3 IRQ_TYPE_EDGE_BOTH>;
> +			interrupts = <IRQID_GPIOAO_3 IRQ_TYPE_EDGE_BOTH>;
>   		};
>   	};
>   
> @@ -217,7 +217,7 @@ external_phy: ethernet-phy@0 {
>   
>   		interrupt-parent = <&gpio_intc>;
>   		/* MAC_INTR on GPIOZ_14 */
> -		interrupts = <26 IRQ_TYPE_LEVEL_LOW>;
> +		interrupts = <IRQID_GPIOZ_14 IRQ_TYPE_LEVEL_LOW>;
>   	};
>   };
>   
> diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-h96-max.dts b/arch/arm64/boot/dts/amlogic/meson-sm1-h96-max.dts
> index 0f6660e68e72..ebda1dd30fa6 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-sm1-h96-max.dts
> +++ b/arch/arm64/boot/dts/amlogic/meson-sm1-h96-max.dts
> @@ -100,7 +100,7 @@ external_phy: ethernet-phy@0 {
>   
>   		interrupt-parent = <&gpio_intc>;
>   		/* MAC_INTR on GPIOZ_14 */
> -		interrupts = <26 IRQ_TYPE_LEVEL_LOW>;
> +		interrupts = <IRQID_GPIOZ_14 IRQ_TYPE_LEVEL_LOW>;
>   	};
>   };
>   
> diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi
> index 2fce44939f45..86b90f44a4b3 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi
> @@ -283,7 +283,7 @@ external_phy: ethernet-phy@0 {
>   
>   		interrupt-parent = <&gpio_intc>;
>   		/* MAC_INTR on GPIOZ_14 */
> -		interrupts = <26 IRQ_TYPE_LEVEL_LOW>;
> +		interrupts = <IRQID_GPIOZ_14 IRQ_TYPE_LEVEL_LOW>;
>   	};
>   };
>   
> diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts b/arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts
> index 9068a334ea57..4f07d6387bb1 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts
> +++ b/arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts
> @@ -53,7 +53,7 @@ key-1 {
>   			linux,code = <BTN_0>;
>   			gpios = <&gpio GPIOH_6 GPIO_ACTIVE_LOW>;
>   			interrupt-parent = <&gpio_intc>;
> -			interrupts = <34 IRQ_TYPE_EDGE_BOTH>;
> +			interrupts = <IRQID_GPIOH_6 IRQ_TYPE_EDGE_BOTH>;
>   		};
>   
>   		key-2 {
> @@ -61,7 +61,7 @@ key-2 {
>   			linux,code = <BTN_1>;
>   			gpios = <&gpio GPIOH_7 GPIO_ACTIVE_LOW>;
>   			interrupt-parent = <&gpio_intc>;
> -			interrupts = <35 IRQ_TYPE_EDGE_BOTH>;
> +			interrupts = <IRQID_GPIOH_7 IRQ_TYPE_EDGE_BOTH>;
>   		};
>   
>   		key-3 {
> @@ -69,7 +69,7 @@ key-3 {
>   			linux,code = <BTN_2>;
>   			gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>;
>   			interrupt-parent = <&gpio_intc>;
> -			interrupts = <2 IRQ_TYPE_EDGE_BOTH>;
> +			interrupts = <IRQID_GPIOAO_2 IRQ_TYPE_EDGE_BOTH>;
>   		};
>   
>   		key-mic-mute {
> @@ -78,7 +78,7 @@ key-mic-mute {
>   			linux,input-type = <EV_SW>;
>   			gpios = <&gpio_ao GPIOE_2 GPIO_ACTIVE_LOW>;
>   			interrupt-parent = <&gpio_intc>;
> -			interrupts = <99 IRQ_TYPE_EDGE_BOTH>;
> +			interrupts = <IRQID_GPIOE_2 IRQ_TYPE_EDGE_BOTH>;
>   		};
>   
>   		key-power {
> @@ -86,7 +86,7 @@ key-power {
>   			linux,code = <KEY_POWER>;
>   			gpios = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_LOW>;
>   			interrupt-parent = <&gpio_intc>;
> -			interrupts = <3 IRQ_TYPE_EDGE_BOTH>;
> +			interrupts = <IRQID_GPIOAO_3 IRQ_TYPE_EDGE_BOTH>;
>   		};
>   	};
>   
> @@ -583,7 +583,7 @@ &uart_A {
>   	bluetooth {
>   		compatible = "brcm,bcm43438-bt";
>   		interrupt-parent = <&gpio_intc>;
> -		interrupts = <95 IRQ_TYPE_LEVEL_HIGH>;
> +		interrupts = <IRQID_GPIOX_18 IRQ_TYPE_LEVEL_HIGH>;
>   		interrupt-names = "host-wakeup";
>   		shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>;
>   		max-speed = <2000000>;
> diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-x96-air-gbit.dts b/arch/arm64/boot/dts/amlogic/meson-sm1-x96-air-gbit.dts
> index 7e1a74046ba5..6ee406066ee0 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-sm1-x96-air-gbit.dts
> +++ b/arch/arm64/boot/dts/amlogic/meson-sm1-x96-air-gbit.dts
> @@ -100,7 +100,7 @@ external_phy: ethernet-phy@0 {
>   
>   		interrupt-parent = <&gpio_intc>;
>   		/* MAC_INTR on GPIOZ_14 */
> -		interrupts = <26 IRQ_TYPE_LEVEL_LOW>;
> +		interrupts = <IRQID_GPIOZ_14 IRQ_TYPE_LEVEL_LOW>;
>   	};
>   };
>   

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH V2 0/3] Add binding header file for GPIO interrupt of Amlogic Meson-G12A
  2023-07-24  6:01 [PATCH V2 0/3] Add binding header file for GPIO interrupt of Amlogic Meson-G12A Huqiang Qin
                   ` (2 preceding siblings ...)
  2023-07-24  6:01 ` [PATCH V2 3/3] arm64: dts: Replace the IRQ number " Huqiang Qin
@ 2023-07-31  8:49 ` neil.armstrong
  2023-08-07 13:37 ` Linus Walleij
  4 siblings, 0 replies; 9+ messages in thread
From: neil.armstrong @ 2023-07-31  8:49 UTC (permalink / raw)
  To: linus.walleij
  Cc: robh+dt, martin.blumenstingl, jbrunet, khilman, conor+dt,
	krzysztof.kozlowski+dt, Huqiang Qin, devicetree, linux-arm-kernel,
	linux-amlogic, linux-kernel, linux-gpio

Hi Linus,

On 24/07/2023 08:01, Huqiang Qin wrote:
> After adding this binding header file, you can intuitively find
> the interrupt number corresponding to each GPIO, and apply it
> in the format of IRQID_XXX where it needs to be used.
> 
> Associated platforms:
> - Amlogic Meson-G12A
> - Amlogic Meson-G12B
> - Amlogic Meson-SM1
> 
> [PATCH 1/3]:
>    V1 -> V2: Rename irq-meson-g12a-gpio.h to amlogic,meson-g12a-gpio-intc.h
> 
> [PATCH 2/3]:
>    V1 -> V2: Include header file changed to amlogic,meson-g12a-gpio-intc.h
> 
> [PATCH 3/3]:
>    V1 -> V2: Include header file changed to amlogic,meson-g12a-gpio-intc.h
> 
> Huqiang Qin (3):
>    dt-bindings: interrupt-controller: Add header file for Amlogic
>      Meson-G12A SoCs
>    pinctrl: Replace the IRQ number in the driver with the IRQID macro
>      definition
>    arm64: dts: Replace the IRQ number with the IRQID macro definition

What's the best way to apply this patchset ?

Thanks,
Neil

> 
>   .../boot/dts/amlogic/meson-g12-common.dtsi    |   1 +
>   .../boot/dts/amlogic/meson-g12a-x96-max.dts   |   2 +-
>   .../dts/amlogic/meson-g12b-bananapi-cm4.dtsi  |   2 +-
>   .../boot/dts/amlogic/meson-g12b-bananapi.dtsi |   2 +-
>   .../amlogic/meson-g12b-odroid-go-ultra.dts    |   4 +-
>   .../dts/amlogic/meson-g12b-odroid-n2.dtsi     |   2 +-
>   .../boot/dts/amlogic/meson-g12b-w400.dtsi     |   2 +-
>   .../dts/amlogic/meson-sm1-a95xf3-air-gbit.dts |   2 +-
>   .../boot/dts/amlogic/meson-sm1-bananapi.dtsi  |   4 +-
>   .../boot/dts/amlogic/meson-sm1-h96-max.dts    |   2 +-
>   .../boot/dts/amlogic/meson-sm1-odroid.dtsi    |   2 +-
>   .../boot/dts/amlogic/meson-sm1-sei610.dts     |  12 +-
>   .../dts/amlogic/meson-sm1-x96-air-gbit.dts    |   2 +-
>   drivers/pinctrl/meson/pinctrl-meson-g12a.c    |  35 ++---
>   .../amlogic,meson-g12a-gpio-intc.h            | 126 ++++++++++++++++++
>   15 files changed, 164 insertions(+), 36 deletions(-)
>   create mode 100644 include/dt-bindings/interrupt-controller/amlogic,meson-g12a-gpio-intc.h
> 
> 
> base-commit: c58c49dd89324b18a812762a2bfa5a0458e4f252


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH V2 0/3] Add binding header file for GPIO interrupt of Amlogic Meson-G12A
  2023-07-24  6:01 [PATCH V2 0/3] Add binding header file for GPIO interrupt of Amlogic Meson-G12A Huqiang Qin
                   ` (3 preceding siblings ...)
  2023-07-31  8:49 ` [PATCH V2 0/3] Add binding header file for GPIO interrupt of Amlogic Meson-G12A neil.armstrong
@ 2023-08-07 13:37 ` Linus Walleij
  2023-08-14  7:38   ` neil.armstrong
  4 siblings, 1 reply; 9+ messages in thread
From: Linus Walleij @ 2023-08-07 13:37 UTC (permalink / raw)
  To: Huqiang Qin
  Cc: robh+dt, krzysztof.kozlowski+dt, conor+dt, neil.armstrong,
	khilman, jbrunet, martin.blumenstingl, devicetree,
	linux-arm-kernel, linux-amlogic, linux-kernel, linux-gpio

On Mon, Jul 24, 2023 at 8:02 AM Huqiang Qin <huqiang.qin@amlogic.com> wrote:

> After adding this binding header file, you can intuitively find
> the interrupt number corresponding to each GPIO, and apply it
> in the format of IRQID_XXX where it needs to be used.
(...)

> Huqiang Qin (3):
>   dt-bindings: interrupt-controller: Add header file for Amlogic
>     Meson-G12A SoCs
>   pinctrl: Replace the IRQ number in the driver with the IRQID macro
>     definition
>   arm64: dts: Replace the IRQ number with the IRQID macro definition

Neil wrote:
> What's the best way to apply this patchset ?

I just applied all three to the pin control tree.

I could have applied just the two first and then offered an
immutable branch. But eh... too much work for too low risk.
Better to just apply it and hope all works out. If it explodes
I just back out and figure something like the above.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH V2 0/3] Add binding header file for GPIO interrupt of Amlogic Meson-G12A
  2023-08-07 13:37 ` Linus Walleij
@ 2023-08-14  7:38   ` neil.armstrong
  0 siblings, 0 replies; 9+ messages in thread
From: neil.armstrong @ 2023-08-14  7:38 UTC (permalink / raw)
  To: Linus Walleij, Huqiang Qin
  Cc: robh+dt, krzysztof.kozlowski+dt, conor+dt, khilman, jbrunet,
	martin.blumenstingl, devicetree, linux-arm-kernel, linux-amlogic,
	linux-kernel, linux-gpio

On 07/08/2023 15:37, Linus Walleij wrote:
> On Mon, Jul 24, 2023 at 8:02 AM Huqiang Qin <huqiang.qin@amlogic.com> wrote:
> 
>> After adding this binding header file, you can intuitively find
>> the interrupt number corresponding to each GPIO, and apply it
>> in the format of IRQID_XXX where it needs to be used.
> (...)
> 
>> Huqiang Qin (3):
>>    dt-bindings: interrupt-controller: Add header file for Amlogic
>>      Meson-G12A SoCs
>>    pinctrl: Replace the IRQ number in the driver with the IRQID macro
>>      definition
>>    arm64: dts: Replace the IRQ number with the IRQID macro definition
> 
> Neil wrote:
>> What's the best way to apply this patchset ?
> 
> I just applied all three to the pin control tree.
> 
> I could have applied just the two first and then offered an
> immutable branch. But eh... too much work for too low risk.
> Better to just apply it and hope all works out. If it explodes
> I just back out and figure something like the above.

Perfect, thx :-)

Neil

> 
> Yours,
> Linus Walleij


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-08-14  7:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-24  6:01 [PATCH V2 0/3] Add binding header file for GPIO interrupt of Amlogic Meson-G12A Huqiang Qin
2023-07-24  6:01 ` [PATCH V2 1/3] dt-bindings: interrupt-controller: Add header file for Amlogic Meson-G12A SoCs Huqiang Qin
2023-07-24  7:25   ` Krzysztof Kozlowski
2023-07-24  6:01 ` [PATCH V2 2/3] pinctrl: Replace the IRQ number in the driver with the IRQID macro definition Huqiang Qin
2023-07-24  6:01 ` [PATCH V2 3/3] arm64: dts: Replace the IRQ number " Huqiang Qin
2023-07-31  8:47   ` neil.armstrong
2023-07-31  8:49 ` [PATCH V2 0/3] Add binding header file for GPIO interrupt of Amlogic Meson-G12A neil.armstrong
2023-08-07 13:37 ` Linus Walleij
2023-08-14  7:38   ` neil.armstrong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).