Add support of IRQs to QUICC ENGINE GPIOs
Subsystems (5)
PATCH v2 3/5 soc: fsl: qe: Drop legacy-of-mm-gpiochip.h header from GPIO driver
In reply to Christophe LeroyRemove legacy-of-mm-gpiochip.h header file. The above mentioned file provides an OF API that's deprecated. There is no agnostic alternatives to it and we have to open code the logic which was hidden behind of_mm_gpiochip_add_data(). Note, most of the GPIO drivers are using their own labeling schemas and resource retrieval that only a few may gain of the code deduplication, so whenever alternative is appear we can move drivers again to use that one.
As a side effect this change fixes a potential memory leak on an error path, if of_mm_gpiochip_add_data() fails.
[Text copied from commit 34064c8267a6 ("powerpc/8xx: Drop legacy-of-mm-gpiochip.h header")]
---
v2: New
--- arch/powerpc/platforms/Kconfig | 1 - drivers/soc/fsl/qe/gpio.c | 51 ++++++++++++++++++---------------- 2 files changed, 27 insertions(+), 25 deletions(-)
arch/powerpc/platforms/Kconfig +0 -1
@@ -232,7 +232,6 @@ config QE_GPIO bool "QE GPIO support" depends on QUICC_ENGINE select GPIOLIB - select OF_GPIO_MM_GPIOCHIP help Say Y here if you're going to use hardware that connects to the QE GPIOs.
drivers/soc/fsl/qe/gpio.c +27 -24
151 lines not on this page · raw message
Signature · 1 line
2.49.0
PATCH v2 1/5 soc: fsl: qe: Add an interrupt controller for QUICC Engine Ports
In reply to Christophe LeroyThe QUICC Engine provides interrupts for a few I/O ports. This is handled via a separate interrupt ID and managed via a triplet of dedicated registers hosted by the SoC.
Implement an interrupt driver for it for that those IRQs can then be linked to the related GPIOs.
The number of ports for which interrupts are supported depends on the microcontroller:
- mpc8323 has 10 interrupts
- mpc8360 has 28 interrupts
- mpc8568 has 18 interrupts
So add this information as data of the compatible.
---
v2: Properly cast (void *) to long instead of int to enable warning-free build on PPC64
--- drivers/soc/fsl/qe/Makefile | 2 +- drivers/soc/fsl/qe/qe_ports_ic.c | 156 +++++++++++++++++++++++++++++++ 2 files changed, 157 insertions(+), 1 deletion(-) create mode 100644 drivers/soc/fsl/qe/qe_ports_ic.c
drivers/soc/fsl/qe/Makefile +1 -1
@@ -11,4 +11,4 @@ obj-$(CONFIG_UCC_SLOW) += ucc_slow.o obj-$(CONFIG_UCC_FAST) += ucc_fast.o obj-$(CONFIG_QE_TDM) += qe_tdm.o obj-$(CONFIG_QE_USB) += usb.o -obj-$(CONFIG_QE_GPIO) += gpio.o +obj-$(CONFIG_QE_GPIO) += gpio.o qe_ports_ic.o
drivers/soc/fsl/qe/qe_ports_ic.c new file +156 -0
156 lines not on this page · raw message
Signature · 1 line
2.49.0
PATCH v2 5/5 dt-bindings: soc: fsl: qe: Add an interrupt controller for QUICC Engine Ports
In reply to Christophe LeroyThe QUICC Engine provides interrupts for a few I/O ports. This is handled via a separate interrupt ID and managed via a triplet of dedicated registers hosted by the SoC.
Implement an interrupt driver for it for that those IRQs can then be linked to the related GPIOs.
---
v2: Fixed problems reported by 'make dt_binding_check'
--- .../soc/fsl/cpm_qe/fsl,qe-ports-ic.yaml | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 Documentation/devicetree/bindings/soc/fsl/cpm_qe/fsl,qe-ports-ic.yaml
Documentation/devicetree/bindings/soc/fsl/cpm_qe/fsl,qe-ports-ic.yaml new file +58 -0
@@ -0,0 +1,58 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/fsl/cpm_qe/fsl,qe-ports-ic.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Freescale QUICC Engine I/O Ports Interrupt Controller + +maintainers: + - Christophe Leroy <[email protected]> + +description: + Interrupt controller for the QUICC Engine I/O ports found on some Freescale/NXP PowerQUICC and QorIQ SoCs. + +properties: + compatible: + enum: + - fsl,mpc8323-qe-ports-ic + - fsl,mpc8360-qe-ports-ic + - fsl,mpc8568-qe-ports-ic + + reg: + maxItems: 1 + description: Base address and size of the QE I/O Ports Interrupt Controller registers. + + interrupt-controller: true + + '#address-cells': + const: 0 + + '#interrupt-cells': + const: 1 + + interrupts: + maxItems: 1 + description: Interrupt line to which the QE I/O Ports controller is connected. + +required: + - compatible + - reg + - interrupt-controller + - '#address-cells' + - '#interrupt-cells' + - interrupts + +additionalProperties: false + +examples: + - | + interrupt-controller@c00 { + interrupt-controller; + compatible = "fsl,mpc8323-qe-ports-ic"; + #address-cells = <0>; + #interrupt-cells = <1>; + reg = <0xc00 0x18>; + interrupts = <74 0x8>; + interrupt-parent = <&ipic>; + };
Signature · 1 line
2.49.0
v2 cover Add support of IRQs to QUICC ENGINE GPIOs
The QUICC Engine provides interrupts for a few I/O ports. This is handled via a separate interrupt ID and managed via a triplet of dedicated registers hosted by the SoC.
Implement an interrupt driver for those IRQs then add IRQs capability to the QUICC ENGINE GPIOs.
The number of GPIOs for which interrupts are supported depends on the microcontroller:
- mpc8323 has 10 GPIOS supporting interrupts
- mpc8360 has 28 GPIOS supporting interrupts
- mpc8568 has 18 GPIOS supporting interrupts
Changes in v2:
- Fixed warning on PPC64 build (Patch 1)
- Using devm_kzalloc() instead of kzalloc (Patch 2)
- Stop using of-mm-gpiochip (New patch 3)
- Added fsl,qe-gpio-irq-mask propertie in DT binding doc (Patch 4)
- Fixed problems reported by 'make dt_binding_check' (Patch 5)
Christophe Leroy (5):
soc: fsl: qe: Add an interrupt controller for QUICC Engine Ports
soc: fsl: qe: Change GPIO driver to a proper platform driver
soc: fsl: qe: Drop legacy-of-mm-gpiochip.h header from GPIO driver
soc: fsl: qe: Add support of IRQ in QE GPIO
dt-bindings: soc: fsl: qe: Add an interrupt controller for QUICC
Engine Ports
.../soc/fsl/cpm_qe/fsl,qe-ports-ic.yaml | 58 +++++++ .../bindings/soc/fsl/cpm_qe/qe/par_io.txt | 19 +++ arch/powerpc/platforms/Kconfig | 1 - drivers/soc/fsl/qe/Makefile | 2 +- drivers/soc/fsl/qe/gpio.c | 145 +++++++++------- drivers/soc/fsl/qe/qe_ports_ic.c | 156 ++++++++++++++++++ 6 files changed, 322 insertions(+), 59 deletions(-) create mode 100644 Documentation/devicetree/bindings/soc/fsl/cpm_qe/fsl,qe-ports-ic.yaml create mode 100644 drivers/soc/fsl/qe/qe_ports_ic.c
Signature · 1 line
2.49.0
PATCH v2 4/5 soc: fsl: qe: Add support of IRQ in QE GPIO
In the QE, a few GPIOs are IRQ capable. Similarly to commit 726bd223105c ("powerpc/8xx: Adding support of IRQ in MPC8xx GPIO"), add IRQ support to QE GPIO.
Add property 'fsl,qe-gpio-irq-mask' similar to 'fsl,cpm1-gpio-irq-mask' that define which of the GPIOs have IRQs.
Here is an exemple for port B of mpc8323 which has IRQs for GPIOs PB7, PB9, PB25 and PB27.
qe_pio_b: gpio-controller@1418 {
#gpio-cells = <2>;
compatible = "fsl,mpc8323-qe-pario-bank";
reg = <0x1418 0x18>;
interrupts = <4 5 6 7>;
fsl,qe-gpio-irq-mask = <0x01400050>;
interrupt-parent = <&qepic>;
gpio-controller;
};---
v2: Document fsl,qe-gpio-irq-mask
--- .../bindings/soc/fsl/cpm_qe/qe/par_io.txt | 19 ++++++++++++++++++ drivers/soc/fsl/qe/gpio.c | 20 +++++++++++++++++++ 2 files changed, 39 insertions(+)
Documentation/devicetree/bindings/soc/fsl/cpm_qe/qe/par_io.txt +19 -0
@@ -32,6 +32,15 @@ Required properties: "fsl,mpc8323-qe-pario-bank". - reg : offset to the register set and its length. - gpio-controller : node to identify gpio controllers. +Optional properties: +- fsl,qe-gpio-irq-mask : For banks having interrupt capability this item tells + which ports have an associated interrupt (ports are listed in the same order + QE ports registers) +- interrupts : This property provides the list of interrupt for each GPIO having + one as described by the fsl,cpm1-gpio-irq-mask property. There should be as + many interrupts as number of ones in the mask property. The first interrupt in + the list corresponds to the most significant bit of the mask. +- interrupt-parent : Parent for the above interrupt property. Example: qe_pio_a: gpio-controller@1400 {
@@ -42,6 +51,16 @@ Example: gpio-controller; }; + qe_pio_b: gpio-controller@1418 { + #gpio-cells = <2>; + compatible = "fsl,mpc8323-qe-pario-bank"; + reg = <0x1418 0x18>; + interrupts = <4 5 6 7>; + fsl,qe-gpio-irq-mask = <0x01400050>; + interrupt-parent = <&qepic>; + gpio-controller; + }; + qe_pio_e: gpio-controller@1460 { #gpio-cells = <2>; compatible = "fsl,mpc8360-qe-pario-bank",
drivers/soc/fsl/qe/gpio.c +20 -0
@@ -13,6 +13,7 @@#include <linux/err.h> #include <linux/io.h> #include <linux/of.h> +#include <linux/of_irq.h> #include <linux/gpio/consumer.h> #include <linux/gpio/driver.h> #include <linux/slab.h>
@@ -32,6 +33,8 @@ struct qe_gpio_chip {/* saved_regs used to restore dedicated functions */ struct qe_pio_regs saved_regs; + +int irq[32 ]; };static void qe_gpio_save_regs (struct qe_gpio_chip *qe_gc)
@@ -135,6 +138,13 @@ static int qe_gpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val)return 0 ; } +static int qe_gpio_to_irq (struct gpio_chip *gc,unsigned int gpio) +{ +struct qe_gpio_chip *qe_gc =gpiochip_get_data (gc); + +return qe_gc->irq[gpio] ? : -ENXIO ; +} +struct qe_pin {/* * The qe_gpio_chip name is unfortunate, we should change that to
@@ -295,6 +305,7 @@ static int qe_gpio_probe(struct platform_device *ofdev)struct device_node *np = dev->of_node;struct qe_gpio_chip *qe_gc;struct gpio_chip *gc; +u32 mask; qe_gc =devm_kzalloc (dev,sizeof (*qe_gc),GFP_KERNEL );if (!qe_gc)
@@ -302,6 +313,14 @@ static int qe_gpio_probe(struct platform_device *ofdev)spin_lock_init (&qe_gc->lock); +if (!of_property_read_u32 (np,"fsl,qe-gpio-irq-mask" , &mask)) { +int i, j; + +for (i =0 , j =0 ; i <ARRAY_SIZE (qe_gc->irq); i++) +if (mask & (1 << (31 - i))) + qe_gc->irq[i] =irq_of_parse_and_map (np, j++); + } + gc = &qe_gc->gc; gc->base =-1 ;
@@ -311,6 +330,7 @@ static int qe_gpio_probe(struct platform_device *ofdev) gc->get = qe_gpio_get; gc->set = qe_gpio_set; gc->set_multiple = qe_gpio_set_multiple; + gc->to_irq = qe_gpio_to_irq; gc->parent = dev; gc->owner =THIS_MODULE ;
Signature · 1 line
2.49.0
PATCH v2 2/5 soc: fsl: qe: Change GPIO driver to a proper platform driver
In reply to Christophe LeroyIn order to be able to add interrupts to the GPIOs, first change the QE GPIO driver to the proper platform driver in order to allow initialisation to be done in the right order, otherwise the GPIOs get added before the interrupts are registered.
---
v2: Use devm_kzalloc() instead of kzalloc()
--- drivers/soc/fsl/qe/gpio.c | 86 +++++++++++++++++++++------------------ 1 file changed, 47 insertions(+), 39 deletions(-)
drivers/soc/fsl/qe/gpio.c +47 -39
@@ -19,6 +19,7 @@#include <linux/slab.h> #include <linux/export.h> #include <linux/property.h> +#include <linux/platform_device.h> #include <soc/fsl/qe/qe.h>
@@ -295,45 +296,52 @@ void qe_pin_set_gpio(struct qe_pin *qe_pin) }EXPORT_SYMBOL (qe_pin_set_gpio); -static int __init qe_add_gpiochips (void ) +static int qe_gpio_probe (struct platform_device *ofdev) { -struct device_node *np; - -for_each_compatible_node (np,NULL ,"fsl,mpc8323-qe-pario-bank" ) { -int ret; -struct qe_gpio_chip *qe_gc; -struct of_mm_gpio_chip *mm_gc; -struct gpio_chip *gc; - - qe_gc =kzalloc (sizeof (*qe_gc),GFP_KERNEL ); -if (!qe_gc) { - ret = -ENOMEM ; - goto err; - } +struct device *dev = &ofdev->dev; +struct device_node *np = dev->of_node; +struct qe_gpio_chip *qe_gc; +struct of_mm_gpio_chip *mm_gc; +struct gpio_chip *gc; -spin_lock_init (&qe_gc->lock); - - mm_gc = &qe_gc->mm_gc; - gc = &mm_gc->gc; - - mm_gc->save_regs = qe_gpio_save_regs; - gc->ngpio =QE_PIO_PINS ; - gc->direction_input = qe_gpio_dir_in; - gc->direction_output = qe_gpio_dir_out; - gc->get = qe_gpio_get; - gc->set = qe_gpio_set; - gc->set_multiple = qe_gpio_set_multiple; - - ret =of_mm_gpiochip_add_data (np, mm_gc, qe_gc); -if (ret) - goto err; -continue ; -err: -pr_err ("%pOF: registration failed with status %d\n" , - np, ret); -kfree (qe_gc); -/* try others anyway */ - } -return 0 ; + qe_gc =devm_kzalloc (dev,sizeof (*qe_gc),GFP_KERNEL ); +if (!qe_gc) +return -ENOMEM ; + +spin_lock_init (&qe_gc->lock); + + mm_gc = &qe_gc->mm_gc; + gc = &mm_gc->gc; + + mm_gc->save_regs = qe_gpio_save_regs; + gc->ngpio =QE_PIO_PINS ; + gc->direction_input = qe_gpio_dir_in; + gc->direction_output = qe_gpio_dir_out; + gc->get = qe_gpio_get; + gc->set = qe_gpio_set; + gc->set_multiple = qe_gpio_set_multiple; + +return of_mm_gpiochip_add_data (np, mm_gc, qe_gc); +} + +static const struct of_device_id qe_gpio_match[] = { + { + .compatible ="fsl,mpc8323-qe-pario-bank" , + }, + {}, +}; +MODULE_DEVICE_TABLE (of, qe_gpio_match); + +static struct platform_driver qe_gpio_driver = { + .probe = qe_gpio_probe, + .driver = { + .name ="qe-gpio" , + .of_match_table = qe_gpio_match, + }, +}; + +static int __init qe_gpio_init (void ) +{ +return platform_driver_register (&qe_gpio_driver); } -arch_initcall (qe_add_gpiochips); +arch_initcall (qe_gpio_init);
Signature · 1 line
2.49.0
Re: [PATCH v2 4/5] soc: fsl: qe: Add support of IRQ in QE GPIO
In reply to Christophe LeroyQuoted 55 lines · Christophe Leroy
In the QE, a few GPIOs are IRQ capable. Similarly to commit
726bd223105c("powerpc/8xx: Adding support of IRQ in MPC8xx GPIO"), add IRQ support to QE GPIO.Add property 'fsl,qe-gpio-irq-mask' similar to 'fsl,cpm1-gpio-irq-mask' that define which of the GPIOs have IRQs.
Here is an exemple for port B of mpc8323 which has IRQs for GPIOs PB7, PB9, PB25 and PB27.
qe_pio_b: gpio-controller@1418 { #gpio-cells = <2>; compatible = "fsl,mpc8323-qe-pario-bank"; reg = <0x1418 0x18>; interrupts = <4 5 6 7>; fsl,qe-gpio-irq-mask = <0x01400050>; interrupt-parent = <&qepic>; gpio-controller; };Signed-off-by Christophe Leroy <[email protected]>---
v2: Document fsl,qe-gpio-irq-mask--- .../bindings/soc/fsl/cpm_qe/qe/par_io.txt | 19 ++++++++++++++++++ drivers/soc/fsl/qe/gpio.c | 20 +++++++++++++++++++ 2 files changed, 39 insertions(+)Documentation/devicetree/bindings/soc/fsl/cpm_qe/qe/par_io.txt +12
-0@@ -32,6 +32,15 @@ Required properties: "fsl,mpc8323-qe-pario-bank". - reg : offset to the register set and its length. - gpio-controller : node to identify gpio controllers. +Optional properties: +- fsl,qe-gpio-irq-mask : For banks having interrupt capability this item tells + which ports have an associated interrupt (ports are listed in the same order + QE ports registers) +- interrupts : This property provides the list of interrupt for each GPIO having + one as described by the fsl,cpm1-gpio-irq-mask property. There should be as + many interrupts as number of ones in the mask property. The first interrupt in + the list corresponds to the most significant bit of the mask. +- interrupt-parent : Parent for the above interrupt property. Example: qe_pio_a: gpio-controller@1400 {@@ -42,6 +51,16 @@ Example: gpio-controller; }; + qe_pio_b: gpio-controller@1418 { + #gpio-cells = <2>; + compatible = "fsl,mpc8323-qe-pario-bank";
Documentation/devicetree/bindings/soc/fsl/cpm_qe/qe/par_io.txt Example: · line 66
Quoted 10 lines
Documentation/devicetree/bindings/soc/fsl/cpm_qe/qe/par_io.txt +7
-0+ reg = <0x1418 0x18>; + interrupts = <4 5 6 7>; + fsl,qe-gpio-irq-mask = <0x01400050>; + interrupt-parent = <&qepic>; + gpio-controller; + }; + qe_pio_e: gpio-controller@1460 { #gpio-cells = <2>; compatible = "fsl,mpc8360-qe-pario-bank",
Why is there a binding change hiding in here alongside a driver one?
Re: [PATCH v2 5/5] dt-bindings: soc: fsl: qe: Add an interrupt controller for QUICC Engine Ports
In reply to Christophe LeroyQuoted 66 lines · Christophe Leroy
The QUICC Engine provides interrupts for a few I/O ports. This is handled via a separate interrupt ID and managed via a triplet of dedicated registers hosted by the SoC.
Implement an interrupt driver for it for that those IRQs can then be linked to the related GPIOs.
Signed-off-by Christophe Leroy <[email protected]>---
v2: Fixed problems reported by 'makedt_binding_check'--- .../soc/fsl/cpm_qe/fsl,qe-ports-ic.yaml | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 Documentation/devicetree/bindings/soc/fsl/cpm_qe/fsl,qe-ports-ic.yamlDocumentation/devicetree/bindings/soc/fsl/cpm_qe/fsl,qe-ports-ic.yaml new file +45
-0@@ -0,0 +1,58 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/fsl/cpm_qe/fsl,qe-ports-ic.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Freescale QUICC Engine I/O Ports Interrupt Controller + +maintainers: + - Christophe Leroy <[email protected]> + +description: + Interrupt controller for the QUICC Engine I/O ports found on some Freescale/NXP PowerQUICC and QorIQ SoCs. + +properties: + compatible: + enum: + - fsl,mpc8323-qe-ports-ic + - fsl,mpc8360-qe-ports-ic + - fsl,mpc8568-qe-ports-ic + + reg: + maxItems: 1 + description: Base address and size of the QE I/O Ports Interrupt Controller registers. + + interrupt-controller: true + + '#address-cells': + const: 0 + + '#interrupt-cells': + const: 1 + + interrupts: + maxItems: 1 + description: Interrupt line to which the QE I/O Ports controller is connected. + +required: + - compatible + - reg + - interrupt-controller + - '#address-cells' + - '#interrupt-cells' + - interrupts +
Documentation/devicetree/bindings/soc/fsl/cpm_qe/fsl,qe-ports-ic.yaml line 55
Quoted 10 lines
Documentation/devicetree/bindings/soc/fsl/cpm_qe/fsl,qe-ports-ic.yaml new file +10
-0+additionalProperties: false + +examples: + - | + interrupt-controller@c00 { + interrupt-controller; + compatible = "fsl,mpc8323-qe-ports-ic"; + #address-cells = <0>; + #interrupt-cells = <1>; + reg = <0xc00 0x18>;
Your property order here is kinda wacky, please stick to the documented order in dts-coding-style.rst.
Otherwise, this seems okay although I think the descriptions for single-item properties could be removed. With the ordering fixed:
Quoted 6 lines
Documentation/devicetree/bindings/soc/fsl/cpm_qe/fsl,qe-ports-ic.yaml new file +3
-0+ interrupts = <74 0x8>; + interrupt-parent = <&ipic>; + };Signature · 1 line
2.49.0
Re: [PATCH v2 4/5] soc: fsl: qe: Add support of IRQ in QE GPIO
In reply to Conor DooleyLe 18/08/2025 à 19:03, Conor Dooley a écrit :
Quoted 53 lines · Christophe Leroy
Quoted 52 lines
In the QE, a few GPIOs are IRQ capable. Similarly to commit
726bd223105c("powerpc/8xx: Adding support of IRQ in MPC8xx GPIO"), add IRQ support to QE GPIO.Add property 'fsl,qe-gpio-irq-mask' similar to 'fsl,cpm1-gpio-irq-mask' that define which of the GPIOs have IRQs.
Here is an exemple for port B of mpc8323 which has IRQs for GPIOs PB7, PB9, PB25 and PB27.
qe_pio_b: gpio-controller@1418 { #gpio-cells = <2>; compatible = "fsl,mpc8323-qe-pario-bank"; reg = <0x1418 0x18>; interrupts = <4 5 6 7>; fsl,qe-gpio-irq-mask = <0x01400050>; interrupt-parent = <&qepic>; gpio-controller; };Signed-off-by Christophe Leroy <[email protected]>---
v2: Document fsl,qe-gpio-irq-mask--- .../bindings/soc/fsl/cpm_qe/qe/par_io.txt | 19 ++++++++++++++++++ drivers/soc/fsl/qe/gpio.c | 20 +++++++++++++++++++ 2 files changed, 39 insertions(+)Documentation/devicetree/bindings/soc/fsl/cpm_qe/qe/par_io.txt +9
-0@@ -32,6 +32,15 @@ Required properties: "fsl,mpc8323-qe-pario-bank". - reg : offset to the register set and its length. - gpio-controller : node to identify gpio controllers. +Optional properties: +- fsl,qe-gpio-irq-mask : For banks having interrupt capability this item tells + which ports have an associated interrupt (ports are listed in the same order + QE ports registers) +- interrupts : This property provides the list of interrupt for each GPIO having + one as described by the fsl,cpm1-gpio-irq-mask property. There should be as + many interrupts as number of ones in the mask property. The first interrupt in + the list corresponds to the most significant bit of the mask. +- interrupt-parent : Parent for the above interrupt property. Example: qe_pio_a: gpio-controller@1400 {@@ -42,6 +51,16 @@ Example: gpio-controller; };
Quoted 15 lines
Documentation/devicetree/bindings/soc/fsl/cpm_qe/qe/par_io.txt Example: · line 66
Quoted 13 lines
Documentation/devicetree/bindings/soc/fsl/cpm_qe/qe/par_io.txt +10
-0+ qe_pio_b: gpio-controller@1418 { + #gpio-cells = <2>; + compatible = "fsl,mpc8323-qe-pario-bank"; + reg = <0x1418 0x18>; + interrupts = <4 5 6 7>; + fsl,qe-gpio-irq-mask = <0x01400050>; + interrupt-parent = <&qepic>; + gpio-controller; + }; + qe_pio_e: gpio-controller@1460 { #gpio-cells = <2>; compatible = "fsl,mpc8360-qe-pario-bank",Why is there a binding change hiding in here alongside a driver one?
I did the same way as commit 726bd223105c ("powerpc/8xx: Adding support of IRQ in MPC8xx GPIO")
Should it be done differently ?
Thanks
Christophe
Re: [PATCH v2 4/5] soc: fsl: qe: Add support of IRQ in QE GPIO
Quoted 70 lines · Christophe Leroy
Le 18/08/2025 à 19:03, Conor Dooley a écrit :
Quoted 58 lines · Christophe Leroy
Quoted 57 lines
In the QE, a few GPIOs are IRQ capable. Similarly to commit
726bd223105c("powerpc/8xx: Adding support of IRQ in MPC8xx GPIO"), add IRQ support to QE GPIO.Add property 'fsl,qe-gpio-irq-mask' similar to 'fsl,cpm1-gpio-irq-mask' that define which of the GPIOs have IRQs.
Here is an exemple for port B of mpc8323 which has IRQs for GPIOs PB7, PB9, PB25 and PB27.
qe_pio_b: gpio-controller@1418 { #gpio-cells = <2>; compatible = "fsl,mpc8323-qe-pario-bank"; reg = <0x1418 0x18>; interrupts = <4 5 6 7>; fsl,qe-gpio-irq-mask = <0x01400050>; interrupt-parent = <&qepic>; gpio-controller; };Signed-off-by Christophe Leroy <[email protected]>---
v2: Document fsl,qe-gpio-irq-mask--- .../bindings/soc/fsl/cpm_qe/qe/par_io.txt | 19 ++++++++++++++++++ drivers/soc/fsl/qe/gpio.c | 20 +++++++++++++++++++ 2 files changed, 39 insertions(+)Documentation/devicetree/bindings/soc/fsl/cpm_qe/qe/par_io.txt +16
-0@@ -32,6 +32,15 @@ Required properties: "fsl,mpc8323-qe-pario-bank". - reg : offset to the register set and its length. - gpio-controller : node to identify gpio controllers. +Optional properties: +- fsl,qe-gpio-irq-mask : For banks having interrupt capability this item tells + which ports have an associated interrupt (ports are listed in the same order + QE ports registers) +- interrupts : This property provides the list of interrupt for each GPIO having + one as described by the fsl,cpm1-gpio-irq-mask property. There should be as + many interrupts as number of ones in the mask property. The first interrupt in + the list corresponds to the most significant bit of the mask. +- interrupt-parent : Parent for the above interrupt property. Example: qe_pio_a: gpio-controller@1400 {@@ -42,6 +51,16 @@ Example: gpio-controller; }; + qe_pio_b: gpio-controller@1418 { + #gpio-cells = <2>; + compatible = "fsl,mpc8323-qe-pario-bank"; + reg = <0x1418 0x18>; + interrupts = <4 5 6 7>; + fsl,qe-gpio-irq-mask = <0x01400050>; + interrupt-parent = <&qepic>;Quoted 8 lines
Documentation/devicetree/bindings/soc/fsl/cpm_qe/qe/par_io.txt Example: · line 66
Quoted 6 lines
Documentation/devicetree/bindings/soc/fsl/cpm_qe/qe/par_io.txt +3
-0+ gpio-controller; + }; + qe_pio_e: gpio-controller@1460 { #gpio-cells = <2>; compatible = "fsl,mpc8360-qe-pario-bank",Why is there a binding change hiding in here alongside a driver one?
Quoted 4 lines
I did the same way as commit
726bd223105c("powerpc/8xx: Adding support of IRQ in MPC8xx GPIO")Should it be done differently ?
Yes, binding changes should not be in with driver changes. Surprised that checkpatch didn't complain. That commit you mention seems to have been like 10 years ago and without dt-binding maintainer review so not the best thing to use as a basis.
Additionally, Rob may require you to covert to yaml to add new properties, I forget if that is a requirement or not.