pinctrl: meson: add support for GPIO IRQs
Subsystems (5)
v5 cover pinctrl: meson: add support for GPIO IRQs
This patch series is partially based on a series Jerome Brunet submitted about half a year ago. Due to open questions this series never made it to mainline, see https://patchwork.kernel.org/patch/9384431/
This new attempt uses GPIOLIB_IRQCHIP resulting in less needed code. Included is also support for using two parent IRQs in case of IRQ_TYPE_EDGE_BOTH, like in the vendor driver.
The series was successfully tested on a Odroid-C2, e.g. with removing polling for SD card insertion/removal from the mmc driver.
Changes in v2:
- separate the GPIO IRQ controller from the pinctrl driver
- minor improvements to the GPIO IRQ controller
Changes in v3:
- replace the request_irq based allocation of parent irq's with chained irq handling, this also fixes the spurious interrupts issue and allows to remove the workaround code.
Last but not least the parent irq's are no longer visible in /proc/interrupts.
- minor improvements to the GPIO IRQ controller
Changes in v4:
- separate the gpio-independent interrupt controller part and make it a driver under drivers/irqchip
Changes in v5:
- smaller changes based on review comments
- split DT patches per ARM / ARM64
Heiner Kallweit (7):
pinctrl: meson: add interrupts to pinctrl data
irqchip: add Amlogic Meson GPIO irqchip driver
dt-bindings: add Amlogic Meson GPIO interrupt-controller DT binding documentation
ARM: dts: meson: add GPIO interrupt-controller support
ARM64: dts: meson: add GPIO interrupt-controller support
pinctrl: meson: add support for GPIO interrupts
pinctrl: meson: update DT binding documentation
ARM: dts: meson: mark gpio controllers as interrupt controllers
ARM64: dts: meson: mark gpio controllers as interrupt controllers
.../amlogic,meson-gpio-intc.txt | 26 ++
.../devicetree/bindings/pinctrl/meson,pinctrl.txt | 4 + arch/arm/boot/dts/meson8.dtsi | 12 + arch/arm/boot/dts/meson8b.dtsi | 12 + arch/arm64/boot/dts/amlogic/meson-gx.dtsi | 8 + arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 4 + arch/arm64/boot/dts/amlogic/meson-gxl.dtsi | 4 + drivers/irqchip/Kconfig | 5 + drivers/irqchip/Makefile | 1 + drivers/irqchip/irq-meson-gpio.c | 296 +++++++++++++++++++++ drivers/pinctrl/Kconfig | 1 + drivers/pinctrl/meson/pinctrl-meson-gxbb.c | 22 +- drivers/pinctrl/meson/pinctrl-meson-gxl.c | 20 +- drivers/pinctrl/meson/pinctrl-meson.c | 170 +++++++++++- drivers/pinctrl/meson/pinctrl-meson.h | 15 +- drivers/pinctrl/meson/pinctrl-meson8.c | 20 +- drivers/pinctrl/meson/pinctrl-meson8b.c | 32 ++- 17 files changed, 605 insertions(+), 47 deletions(-) create mode 100644 Documentation/devicetree/bindings/interrupt-controller/amlogic,meson-gpio-intc.txt create mode 100644 drivers/irqchip/irq-meson-gpio.c
Signature · 1 line
2.13.0
PATCH v5 1/9 pinctrl: meson: add interrupts to pinctrl data
From: Jerome Brunet <[email protected]>
Add GPIO interrupt information to pinctrl data. Added to the original version from Jerome was data for Meson GXL.
---
v2:
- no changes
v3:
- no changes
v4:
- no changes
v5:
- added Acked-by
--- drivers/pinctrl/meson/pinctrl-meson-gxbb.c | 22 ++++++++++---------- drivers/pinctrl/meson/pinctrl-meson-gxl.c | 20 +++++++++---------- drivers/pinctrl/meson/pinctrl-meson.h | 15 +++++++++----- drivers/pinctrl/meson/pinctrl-meson8.c | 20 +++++++++---------- drivers/pinctrl/meson/pinctrl-meson8b.c | 32 ++++++++++++++++++++---------- 5 files changed, 63 insertions(+), 46 deletions(-)
drivers/pinctrl/meson/pinctrl-meson-gxbb.c +11 -11
@@ -807,20 +807,20 @@ static struct meson_pmx_func meson_gxbb_aobus_functions[] = { };static struct meson_bank meson_gxbb_periphs_banks[] = { -/* name first last pullen pull dir out in */ -BANK ("X" ,PIN (GPIOX_0 ,EE_OFF ),PIN (GPIOX_22 ,EE_OFF ),4 ,0 ,4 ,0 ,12 ,0 ,13 ,0 ,14 ,0 ), -BANK ("Y" ,PIN (GPIOY_0 ,EE_OFF ),PIN (GPIOY_16 ,EE_OFF ),1 ,0 ,1 ,0 ,3 ,0 ,4 ,0 ,5 ,0 ), -BANK ("DV" ,PIN (GPIODV_0 ,EE_OFF ),PIN (GPIODV_29 ,EE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,3 ,0 ,9 ,0 ,10 ,0 ,11 ,0 ), +BANK ("CARD" ,PIN (CARD_0 ,EE_OFF ),PIN (CARD_6 ,EE_OFF ),52 ,58 ,2 ,20 ,2 ,20 ,6 ,20 ,7 ,20 ,8 ,20 ), +BANK ("BOOT" ,PIN (BOOT_0 ,EE_OFF ),PIN (BOOT_17 ,EE_OFF ),34 ,51 ,2 ,0 ,2 ,0 ,6 ,0 ,7 ,0 ,8 ,0 ), +BANK ("CLK" ,PIN (GPIOCLK_0 ,EE_OFF ),PIN (GPIOCLK_3 ,EE_OFF ),129 ,132 ,3 ,28 ,3 ,28 ,9 ,28 ,10 ,28 ,11 ,28 ), };static struct meson_bank meson_gxbb_aobus_banks[] = { -/* name first last pullen pull dir out in */ -BANK ("AO" ,PIN (GPIOAO_0 ,0 ),PIN (GPIOAO_13 ,0 ),0 ,0 ,0 ,16 ,0 ,0 ,0 ,16 ,1 ,0 ), +/* name first last irq pullen pull dir out in */ +BANK ("AO" ,PIN (GPIOAO_0 ,0 ),PIN (GPIOAO_13 ,0 ),0 ,13 ,0 ,0 ,0 ,16 ,0 ,0 ,0 ,16 ,1 ,0 ), };struct meson_pinctrl_data meson_gxbb_periphs_pinctrl_data = {
drivers/pinctrl/meson/pinctrl-meson-gxl.c +10 -10
@@ -764,19 +764,19 @@ static struct meson_pmx_func meson_gxl_aobus_functions[] = { };static struct meson_bank meson_gxl_periphs_banks[] = { -/* name first last pullen pull dir out in */ -BANK ("X" ,PIN (GPIOX_0 ,EE_OFF ),PIN (GPIOX_18 ,EE_OFF ),4 ,0 ,4 ,0 ,12 ,0 ,13 ,0 ,14 ,0 ), -BANK ("DV" ,PIN (GPIODV_0 ,EE_OFF ),PIN (GPIODV_29 ,EE_OFF ),0 ,0 ,0 ,0 ,0 ,0 ,1 ,0 ,2 ,0 ), -BANK ("H" ,PIN (GPIOH_0 ,EE_OFF ),PIN (GPIOH_9 ,EE_OFF ),1 ,20 ,1 ,20 ,3 ,20 ,4 ,20 ,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), +BANK ("CLK" ,PIN (GPIOCLK_0 ,EE_OFF ),PIN (GPIOCLK_1 ,EE_OFF ),108 ,109 ,3 ,28 ,3 ,28 ,9 ,28 ,10 ,28 ,11 ,28 ), };static struct meson_bank meson_gxl_aobus_banks[] = { -/* name first last pullen pull dir out in */ -BANK ("AO" ,PIN (GPIOAO_0 ,0 ),PIN (GPIOAO_9 ,0 ),0 ,0 ,0 ,16 ,0 ,0 ,0 ,16 ,1 ,0 ), +/* name first last irq pullen pull dir out in */ +BANK ("AO" ,PIN (GPIOAO_0 ,0 ),PIN (GPIOAO_9 ,0 ),0 ,9 ,0 ,0 ,0 ,16 ,0 ,0 ,0 ,16 ,1 ,0 ), };struct meson_pinctrl_data meson_gxl_periphs_pinctrl_data = {
drivers/pinctrl/meson/pinctrl-meson.h +10 -5
@@ -81,6 +81,7 @@ enum meson_reg_type {* @name: bank name * @first: first pin of the bank * @last: last pin of the bank +* @irq: hwirq base number of the bank * @regs: array of register descriptors * * A bank represents a set of pins controlled by a contiguous set of
@@ -92,6 +93,8 @@ struct meson_bank {const char *name;unsigned int first;unsigned int last; +int irq_first; +int irq_last;struct meson_reg_desc regs[NUM_REG ]; };
@@ -147,12 +150,14 @@ struct meson_pinctrl { .num_groups = ARRAY_SIZE(fn ## _groups), \ } -#define BANK (n, f, l, per, peb, pr, pb, dr, db, or, ob, ir, ib) \ +#define BANK (n, f, l, fi, li, per, peb, pr, pb, dr, db, or, ob, ir, ib) \ { \ - .name = n, \ - .first = f, \ - .last = l, \ - .regs = { \ + .name = n, \ + .first = f, \ + .last = l, \ + .irq_first = fi, \ + .irq_last = li, \ + .regs = { \ [REG_PULLEN] = { per, peb }, \ [REG_PULL] = { pr, pb }, \ [REG_DIR] = { dr, db }, \
drivers/pinctrl/meson/pinctrl-meson8.c +10 -10
@@ -1041,19 +1041,19 @@ static struct meson_pmx_func meson8_aobus_functions[] = { };static struct meson_bank meson8_cbus_banks[] = { -/* name first last pullen pull dir out in */ -BANK ("X" ,P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N (GPIOZ_14 ,0 ),14 ,28 ,1 ,0 ,1 ,0 ,3 ,17 ,4 ,17 ,5 ,17 ), +BANK ("CARD" ,PIN (CARD_0 ,0 ),PIN (CARD_6 ,0 ),58 ,64 ,2 ,20 ,2 ,20 ,0 ,22 ,1 ,22 ,2 ,22 ), +BANK ("BOOT" ,PIN (BOOT_0 ,0 ),PIN (BOOT_18 ,0 ),39 ,57 ,2 ,0 ,2 ,0 ,9 ,0 ,10 ,0 ,11 ,0 ), };static struct meson_bank meson8_aobus_banks[] = { -/* name first last pullen pull dir out in */ -BANK ("AO" ,PIN (GPIOAO_0 ,AO_OFF ),PIN (GPIO_TEST_N ,AO_OFF ),0 ,0 ,0 ,16 ,0 ,0 ,0 ,16 ,1 ,0 ), +/* name first last irq pullen pull dir out in */ +BANK ("AO" ,PIN (GPIOAO_0 ,AO_OFF ),PIN (GPIO_TEST_N ,AO_OFF ),0 ,13 ,0 ,0 ,0 ,16 ,0 ,0 ,0 ,16 ,1 ,0 ), };struct meson_pinctrl_data meson8_cbus_pinctrl_data = {
drivers/pinctrl/meson/pinctrl-meson8b.c +22 -10
@@ -124,6 +124,12 @@ static const struct pinctrl_pin_desc meson8b_aobus_pins[] = {MESON_PIN (GPIOAO_11 ,AO_OFF ),MESON_PIN (GPIOAO_12 ,AO_OFF ),MESON_PIN (GPIOAO_13 ,AO_OFF ), + +/* +* The following 2 pins are not mentionned in the public datasheet +* According to this datasheet, they can't be used with the gpio +* interrupt controller +*/ MESON_PIN (GPIO_BSD_EN ,AO_OFF ), MESON_PIN(GPIO_TEST_N, AO_OFF), };
@@ -881,19 +887,25 @@ static struct meson_pmx_func meson8b_aobus_functions[] = { };static struct meson_bank meson8b_cbus_banks[] = { -/* name first last pullen pull dir out in */ -BANK ("X" ,PIN (GPIOX_0 ,0 ),PIN (GPIOX_21 ,0 ),4 ,0 ,4 ,0 ,0 ,0 ,1 ,0 ,2 ,0 ), -BANK ("Y" ,PIN (GPIOY_0 ,0 ),PIN (GPI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,2 ,0 ,2 ,0 ,9 ,0 ,10 ,0 ,11 ,0 ), + +/* +* The following bank is not mentionned in the public datasheet +* There is no information whether it can be used with the gpio +* interrupt controller +*/ +BANK ("DIF" ,PIN (DIF_0_P ,0 ),PIN (DIF_4_N ,0 ),-1 ,-1 ,5 ,8 ,5 ,8 ,12 ,12 ,13 ,12 ,14 ,12 ), };static struct meson_bank meson8b_aobus_banks[] = { -/* name first last pullen pull dir out in */ -BANK ("AO" ,PIN (GPIOAO_0 ,AO_OFF ),PIN (GPIO_TEST_N ,AO_OFF ),0 ,0 ,0 ,16 ,0 ,0 ,0 ,16 ,1 ,0 ), +/* name first last irq pullen pull dir out in */ +BANK ("AO" ,PIN (GPIOAO_0 ,AO_OFF ),PIN (GPIO_TEST_N ,AO_OFF ),0 ,13 ,0 ,0 ,0 ,16 ,0 ,0 ,0 ,16 ,1 ,0 ), };struct meson_pinctrl_data meson8b_cbus_pinctrl_data = {
Signature · 1 line
2.13.0
PATCH v5 2/9 irqchip: add Amlogic Meson GPIO irqchip driver
In reply to Heiner KallweitAdd a driver supporting the GPIO interrupt controller on certain Amlogic meson SoC's.
---
v5:
- changed Kconfig entry based on Neil's suggestion
- added authors
- extended explanation why 2 * n hwirqs are used
--- drivers/irqchip/Kconfig | 5 + drivers/irqchip/Makefile | 1 + drivers/irqchip/irq-meson-gpio.c | 296 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 302 insertions(+) create mode 100644 drivers/irqchip/irq-meson-gpio.c
drivers/irqchip/Kconfig +5 -0
@@ -301,3 +301,8 @@ config QCOM_IRQ_COMBINER help Say yes here to add support for the IRQ combiner devices embedded in Qualcomm Technologies chips. + +config MESON_GPIO_INTC + bool + depends on ARCH_MESON + default y
drivers/irqchip/Makefile +1 -0
@@ -76,3 +76,4 @@ obj-$(CONFIG_EZNPS_GIC) += irq-eznps.o obj-$(CONFIG_ARCH_ASPEED) += irq-aspeed-vic.o obj-$(CONFIG_STM32_EXTI) += irq-stm32-exti.o obj-$(CONFIG_QCOM_IRQ_COMBINER) += qcom-irq-combiner.o +obj-$(CONFIG_MESON_GPIO_INTC) += irq-meson-gpio.o
drivers/irqchip/irq-meson-gpio.c new file +296 -0
296 lines not on this page · raw message
Signature · 1 line
2.13.0
PATCH v5 3/9 dt-bindings: add Amlogic Meson GPIO interrupt-controller DT binding documentation
In reply to Heiner KallweitAdd dt binding documentation for Amlogic meson GPIO interrupt controller.
---
v5:
- added Reviewed-by
--- .../amlogic,meson-gpio-intc.txt | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Documentation/devicetree/bindings/interrupt-controller/amlogic,meson-gpio-intc.txt
Documentation/devicetree/bindings/interrupt-controller/amlogic,meson-gpio-intc.txt new file +26 -0
@@ -0,0 +1,26 @@ +Amlogic meson GPIO interrupt controller + +Meson SoCs contains an interrupt controller which is able watch the SoC pads +and generate an interrupt on edges or level. The controller is essentially a +256 pads to 8 GIC interrupt multiplexer, with a filter block to select edge +or level and polarity. The actual number of interrupt exposed depends on the +SoC. + +Required properties: + +- compatible : should be "amlogic,meson-gpio-intc". +- reg : Specifies base physical address and size of the registers. +- interrupt-controller : Identifies the node as an interrupt controller. +- #interrupt-cells : should be 2. +- parent-interrupts : list of GIC interrupts which can be used with the + GPIO IRQ multiplexer + +Example: + +gpio_intc: interrupt-controller at 9880 { + compatible = "amlogic,meson-gpio-intc"; + reg = <0x0 0x09880 0x0 0x10>; + interrupt-controller; + #interrupt-cells = <2>; + parent-interrupts = <64 65 66 67 68 69 70 71>; +};
Signature · 1 line
2.13.0
PATCH v5 4/9 ARM: dts: meson: add GPIO interrupt-controller support
In reply to Heiner KallweitAdd support for the GPIO interupt controller of certain Amlogic Meson Soc's.
---
v5:
- split ARM and ARM64 into separate patches
- added Reviewed-by
--- arch/arm/boot/dts/meson8.dtsi | 8 ++++++++ arch/arm/boot/dts/meson8b.dtsi | 8 ++++++++ 2 files changed, 16 insertions(+)
arch/arm/boot/dts/meson8.dtsi +8 -0
@@ -126,6 +126,14 @@ }; &cbus { + gpio_intc: interrupt-controller at 9880 { + compatible = "amlogic,meson-gpio-intc"; + reg = <0x9880 0x10>; + interrupt-controller; + #interrupt-cells = <2>; + parent-interrupts = <64 65 66 67 68 79 70 71>; + }; + pinctrl_cbus: pinctrl at 9880 { compatible = "amlogic,meson8-cbus-pinctrl"; reg = <0x9880 0x10>;
arch/arm/boot/dts/meson8b.dtsi +8 -0
@@ -112,6 +112,14 @@ }; &cbus { + gpio_intc: interrupt-controller at 9880 { + compatible = "amlogic,meson-gpio-intc"; + reg = <0x9880 0x10>; + interrupt-controller; + #interrupt-cells = <2>; + parent-interrupts = <64 65 66 67 68 79 70 71>; + }; + clkc: clock-controller at 4000 { #clock-cells = <1>; compatible = "amlogic,meson8b-clkc";
Signature · 1 line
2.13.0
PATCH v5 5/9 ARM64: dts: meson: add GPIO interrupt-controller support
In reply to Heiner KallweitAdd support for the GPIO interupt controller of certain Amlogic Meson Soc's.
---
v5:
- split ARM and ARM64 into separate patches
- added Reviewed-by
--- arch/arm64/boot/dts/amlogic/meson-gx.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+)
arch/arm64/boot/dts/amlogic/meson-gx.dtsi +8 -0
@@ -312,6 +312,14 @@ status = "disabled"; }; + gpio_intc: interrupt-controller at 9880 { + compatible = "amlogic,meson-gpio-intc"; + reg = <0x0 0x09880 0x0 0x10>; + interrupt-controller; + #interrupt-cells = <2>; + parent-interrupts = <64 65 66 67 68 79 70 71>; + }; + watchdog at 98d0 { compatible = "amlogic,meson-gx-wdt", "amlogic,meson-gxbb-wdt"; reg = <0x0 0x098d0 0x0 0x10>;
Signature · 1 line
2.13.0
PATCH v5 6/9 pinctrl: meson: add support for GPIO interrupts
In reply to Heiner KallweitAdd support for GPIO interrupts and make use of the just introduced irqchip driver handling the GPIO interrupt-controller.
---
v5:
- changed Kconfig entry based on Neil's suggestion
- extended comments
- fixed indentation
--- drivers/pinctrl/Kconfig | 1 + drivers/pinctrl/meson/pinctrl-meson.c | 170 +++++++++++++++++++++++++++++++++- 2 files changed, 170 insertions(+), 1 deletion(-)
drivers/pinctrl/Kconfig +1 -0
@@ -166,6 +166,7 @@ config PINCTRL_MESON select PINCONF select GENERIC_PINCONF select GPIOLIB + select GPIOLIB_IRQCHIP select OF_GPIO select REGMAP_MMIO
drivers/pinctrl/meson/pinctrl-meson.c +169 -1
194 lines not on this page · raw message
Signature · 1 line
2.13.0
PATCH v5 7/9 pinctrl: meson: update DT binding documentation
In reply to Heiner KallweitThe GPIO controllers act as interrupt controllers now, therefore update the related DT binding documentation.
---
v5:
- separate documentation update from actual DT update
- add Reviewed-by
--- Documentation/devicetree/bindings/pinctrl/meson,pinctrl.txt | 4 ++++ 1 file changed, 4 insertions(+)
Documentation/devicetree/bindings/pinctrl/meson,pinctrl.txt +4 -0
@@ -24,6 +24,8 @@ Required properties for sub-nodes are: when it is missing the "pull" registers are used instead - gpio-controller: identifies the node as a gpio controller - #gpio-cells: must be 2 + - interrupt-controller: identifies the node as interrupt controller + - #interrupt-cells: must be 2 === Other sub-nodes ===
@@ -62,6 +64,8 @@ pinctrl-bindings.txt reg-names = "mux", "pull", "pull-enable", "gpio"; gpio-controller; #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; }; nand {
Signature · 1 line
2.13.0
PATCH v5 8/9 ARM: dts: meson: mark gpio controllers as interrupt controllers
In reply to Heiner KallweitMake the GPIO controllers act as interrupt controllers.
---
v5:
- separate ARM / ARM64 DT changes
- add Reviewed-by
--- arch/arm/boot/dts/meson8.dtsi | 4 ++++ arch/arm/boot/dts/meson8b.dtsi | 4 ++++ 2 files changed, 8 insertions(+)
arch/arm/boot/dts/meson8.dtsi +4 -0
@@ -106,6 +106,8 @@ reg-names = "mux", "pull", "gpio"; gpio-controller; #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; gpio-ranges = <&pinctrl_aobus 0 120 16>; };
@@ -149,6 +151,8 @@ reg-names = "mux", "pull", "pull-enable", "gpio"; gpio-controller; #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; gpio-ranges = <&pinctrl_cbus 0 0 120>; };
arch/arm/boot/dts/meson8b.dtsi +4 -0
@@ -99,6 +99,8 @@ reg-names = "mux", "pull", "gpio"; gpio-controller; #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; gpio-ranges = <&pinctrl_aobus 0 130 16>; };
@@ -174,6 +176,8 @@ reg-names = "mux", "pull", "pull-enable", "gpio"; gpio-controller; #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; gpio-ranges = <&pinctrl_cbus 0 0 130>; }; };
Signature · 1 line
2.13.0
PATCH v5 9/9 ARM64: dts: meson: mark gpio controllers as interrupt controllers
In reply to Heiner KallweitMake the GPIO controllers act as interrupt controllers.
---
v5:
- separate ARM / ARM64 DT changes
- add Reviewed-by
--- arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 4 ++++ arch/arm64/boot/dts/amlogic/meson-gxl.dtsi | 4 ++++ 2 files changed, 8 insertions(+)
arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi +4 -0
@@ -111,6 +111,8 @@ reg-names = "mux", "pull", "gpio"; gpio-controller; #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; gpio-ranges = <&pinctrl_aobus 0 0 14>; };
@@ -356,6 +358,8 @@ reg-names = "mux", "pull", "pull-enable", "gpio"; gpio-controller; #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; gpio-ranges = <&pinctrl_periphs 0 14 120>; };
arch/arm64/boot/dts/amlogic/meson-gxl.dtsi +4 -0
@@ -80,6 +80,8 @@ reg-names = "mux", "pull", "gpio"; gpio-controller; #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; gpio-ranges = <&pinctrl_aobus 0 0 14>; };
@@ -244,6 +246,8 @@ reg-names = "mux", "pull", "pull-enable", "gpio"; gpio-controller; #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; gpio-ranges = <&pinctrl_periphs 0 14 101>; };
Signature · 1 line
2.13.0
Rob Herring
maintainerPATCH v5 3/9 dt-bindings: add Amlogic Meson GPIO interrupt-controller DT binding documentation
In reply to Heiner KallweitQuoted 24 lines · Heiner Kallweit
Add dt binding documentation for Amlogic meson GPIO interrupt controller.
Signed-off-by Heiner Kallweit <[email protected]>Reviewed-by Neil Armstrong <[email protected]>---
v5:
- added Reviewed-by--- .../amlogic,meson-gpio-intc.txt | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Documentation/devicetree/bindings/interrupt-controller/amlogic,meson-gpio-intc.txtDocumentation/devicetree/bindings/interrupt-controller/amlogic,meson-gpio-intc.txt new file +6
-0@@ -0,0 +1,26 @@ +Amlogic meson GPIO interrupt controller + +Meson SoCs contains an interrupt controller which is able watch the SoC pads +and generate an interrupt on edges or level. The controller is essentially a +256 pads to 8 GIC interrupt multiplexer, with a filter block to select edge +or level and polarity. The actual number of interrupt exposed depends on the
Documentation/devicetree/bindings/interrupt-controller/amlogic,meson-gpio-intc.txt line 16
Quoted 10 lines
Documentation/devicetree/bindings/interrupt-controller/amlogic,meson-gpio-intc.txt new file +10
-0+SoC. + +Required properties: + +- compatible : should be "amlogic,meson-gpio-intc". +- reg : Specifies base physical address and size of the registers. +- interrupt-controller : Identifies the node as an interrupt controller. +- #interrupt-cells : should be 2. +- parent-interrupts : list of GIC interrupts which can be used with the + GPIO IRQ multiplexer
Just use "interrupts" here.
Quoted 14 lines
Documentation/devicetree/bindings/interrupt-controller/amlogic,meson-gpio-intc.txt new file +10
-0+ +Example: + +gpio_intc: interrupt-controller at 9880 { + compatible = "amlogic,meson-gpio-intc"; + reg = <0x0 0x09880 0x0 0x10>; + interrupt-controller; + #interrupt-cells = <2>; + parent-interrupts = <64 65 66 67 68 69 70 71>; +};Signature · 1 line
2.13.0
Rob Herring
maintainerPATCH v5 7/9 pinctrl: meson: update DT binding documentation
In reply to Heiner KallweitQuoted 5 lines · Heiner Kallweit
The GPIO controllers act as interrupt controllers now, therefore update the related DT binding documentation.
Signed-off-by Heiner Kallweit <[email protected]>Reviewed-by Neil Armstrong <[email protected]>
Quoted 7 lines
---
v5:
- separate documentation update from actual DT update
- add Reviewed-by--- Documentation/devicetree/bindings/pinctrl/meson,pinctrl.txt | 4 ++++ 1 file changed, 4 insertions(+)
PATCH v5 3/9 dt-bindings: add Amlogic Meson GPIO interrupt-controller DT binding documentation
In reply to Rob HerringQuoted 29 lines · Rob Herring
Quoted 28 lines · Heiner Kallweit
Add dt binding documentation for Amlogic meson GPIO interrupt controller.
Signed-off-by Heiner Kallweit <[email protected]>Reviewed-by Neil Armstrong <[email protected]>---
v5:
- added Reviewed-by--- .../amlogic,meson-gpio-intc.txt | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Documentation/devicetree/bindings/interrupt-controller/amlogic,meson-gpio-intc.txtDocumentation/devicetree/bindings/interrupt-controller/amlogic,meson-gpio-intc.txt new file +10
-0@@ -0,0 +1,26 @@ +Amlogic meson GPIO interrupt controller + +Meson SoCs contains an interrupt controller which is able watch the SoC pads +and generate an interrupt on edges or level. The controller is essentially a +256 pads to 8 GIC interrupt multiplexer, with a filter block to select edge +or level and polarity. The actual number of interrupt exposed depends on the +SoC. + +Required properties: +
Quoted 8 lines
Documentation/devicetree/bindings/interrupt-controller/amlogic,meson-gpio-intc.txt line 16
Quoted 6 lines
Documentation/devicetree/bindings/interrupt-controller/amlogic,meson-gpio-intc.txt new file +6
-0+- compatible : should be "amlogic,meson-gpio-intc". +- reg : Specifies base physical address and size of the registers. +- interrupt-controller : Identifies the node as an interrupt controller. +- #interrupt-cells : should be 2. +- parent-interrupts : list of GIC interrupts which can be used with the + GPIO IRQ multiplexerJust use "interrupts" here.
Hi Rob,
If the "interrupts" property is used here like this, it breaks the interrupts binding !
Neil
Quoted 15 lines
Quoted 15 lines
Documentation/devicetree/bindings/interrupt-controller/amlogic,meson-gpio-intc.txt new file +10
-0+ +Example: + +gpio_intc: interrupt-controller at 9880 { + compatible = "amlogic,meson-gpio-intc"; + reg = <0x0 0x09880 0x0 0x10>; + interrupt-controller; + #interrupt-cells = <2>; + parent-interrupts = <64 65 66 67 68 69 70 71>; +};Signature · 1 line
2.13.0
Rob Herring
maintainerPATCH v5 3/9 dt-bindings: add Amlogic Meson GPIO interrupt-controller DT binding documentation
Quoted 39 lines · Neil Armstrong
Quoted 29 lines · Rob Herring
Quoted 28 lines · Heiner Kallweit
Add dt binding documentation for Amlogic meson GPIO interrupt controller.
Signed-off-by Heiner Kallweit <[email protected]>Reviewed-by Neil Armstrong <[email protected]>---
v5:
- added Reviewed-by--- .../amlogic,meson-gpio-intc.txt | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Documentation/devicetree/bindings/interrupt-controller/amlogic,meson-gpio-intc.txtDocumentation/devicetree/bindings/interrupt-controller/amlogic,meson-gpio-intc.txt new file +10
-0@@ -0,0 +1,26 @@ +Amlogic meson GPIO interrupt controller + +Meson SoCs contains an interrupt controller which is able watch the SoC pads +and generate an interrupt on edges or level. The controller is essentially a +256 pads to 8 GIC interrupt multiplexer, with a filter block to select edge +or level and polarity. The actual number of interrupt exposed depends on the +SoC. + +Required properties: +Quoted 8 lines
Documentation/devicetree/bindings/interrupt-controller/amlogic,meson-gpio-intc.txt line 16
Quoted 6 lines
Documentation/devicetree/bindings/interrupt-controller/amlogic,meson-gpio-intc.txt new file +6
-0+- compatible : should be "amlogic,meson-gpio-intc". +- reg : Specifies base physical address and size of the registers. +- interrupt-controller : Identifies the node as an interrupt controller. +- #interrupt-cells : should be 2. +- parent-interrupts : list of GIC interrupts which can be used with the + GPIO IRQ multiplexerJust use "interrupts" here.
Quoted 3 lines
Hi Rob,
If the "interrupts" property is used here like this, it breaks the interrupts binding !
Really!? Looking closer at the series, in fact the dts files are already correct:
+ gpio_intc: interrupt-controller at 9880 {
+ compatible = "amlogic,meson-gpio-intc"; + reg = <0x9880 0x10>; + interrupt-controller; + #interrupt-cells = <2>; + interrupts = <64 65 66 67 68 79 70 71>;
+ };
+
Rob