Passing GPIO irq edge/level flags from devicetree to driver, how?
Subsystems (3)
Sascha Hauer
maintainerHi All,
Several gpio binding documents like the one for mxs have the following in them:
- #interrupt-cells : Should be 2. The first cell is the GPIO number. The second cell bits[3:0] is used to specify trigger type and level flags:
1 = low-to-high edge triggered.
2 = high-to-low edge triggered.
4 = active high level-sensitive.
8 = active low level-sensitive.
Does anybody know where this information is evaluated and how this is passed to the driver?
I am working on i.MX (who would have guessed that) and I am trying to connect a I2C device with an interrupt source connected to the gpio interrupt controller. It works fine, only the irq level/edge flags get lost somewhere.
What I have is:
maxtouch at 4b {
compatible = "mXT224";
reg = <0x4b>;
interrupt-parent = <&gpio7>;
interrupts = <13 2>;
};Any idea how the maxtouch driver can use the 'high-to-low edge triggered' information?
BTW. the i.MX GPIO binding document does not claim to support the flags, but I assume it's just missing in the document, but there maybe also something missing in the driver to support this.
Sascha
Signature · 4 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Hi Sascha,
Try to change the value of #interrupt-cells under gpio node from 1 to 2.
I forgot updating imx on this.
Regards,
Shawn
Quoted 43 lines · Sascha Hauer
Hi All,
Several gpio binding documents like the one for mxs have the following in them:
- #interrupt-cells : Should be 2. The first cell is the GPIO number. The second cell bits[3:0] is used to specify trigger type and level flags:
1 = low-to-high edge triggered.
2 = high-to-low edge triggered.
4 = active high level-sensitive.
8 = active low level-sensitive.Does anybody know where this information is evaluated and how this is passed to the driver?
I am working on i.MX (who would have guessed that) and I am trying to connect a I2C device with an interrupt source connected to the gpio interrupt controller. It works fine, only the irq level/edge flags get lost somewhere.
What I have is:
maxtouch at 4b { compatible = "mXT224"; reg = <0x4b>; interrupt-parent = <&gpio7>; interrupts = <13 2>; };Any idea how the maxtouch driver can use the 'high-to-low edge triggered' information?
BTW. the i.MX GPIO binding document does not claim to support the flags, but I assume it's just missing in the document, but there maybe also something missing in the driver to support this.
Sascha
Signature · 4 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Sascha Hauer
maintainerQuoted 5 lines · Shawn Guo
Hi Sascha,
Try to change the value of #interrupt-cells under gpio node from 1 to 2.
I forgot updating imx on this.
Ok, that does the trick. Should I create a patch or are you already in the middle of doing so?
Sascha
Signature · 4 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Quoted 3 lines · Sascha Hauer
Ok, that does the trick. Should I create a patch or are you already in the middle of doing so?
Yes, I'm cooking a patch for that.
Regards,
Shawn
PATCH 1/1 ARM: dts: imx: update #interrupt-cells for gpio nodes
In reply to Sascha HauerChange the value of #interrupt-cells of gpio nodes from 1 to 2, so that the gpio irq type can be specified in device tree. Also update binding document to make it clear.
--- .../devicetree/bindings/gpio/fsl-imx-gpio.txt | 9 +++++++++ arch/arm/boot/dts/imx27.dtsi | 12 ++++++------ arch/arm/boot/dts/imx51.dtsi | 8 ++++---- arch/arm/boot/dts/imx53.dtsi | 14 +++++++------- arch/arm/boot/dts/imx6q.dtsi | 14 +++++++------- 5 files changed, 33 insertions(+), 24 deletions(-)
Documentation/devicetree/bindings/gpio/fsl-imx-gpio.txt +9 -0
@@ -11,6 +11,13 @@ Required properties: the second cell is used to specify the gpio polarity: 0 = active high 1 = active low +- interrupt-controller: Marks the device node as an interrupt controller. +- #interrupt-cells : Should be 2. The first cell is the GPIO number. + The second cell bits[3:0] is used to specify trigger type and level flags: + 1 = low-to-high edge triggered. + 2 = high-to-low edge triggered. + 4 = active high level-sensitive. + 8 = active low level-sensitive. Example:
@@ -20,4 +27,6 @@ gpio0: gpio at 73f84000 { interrupts = <50 51>; gpio-controller; #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; };
arch/arm/boot/dts/imx27.dtsi +6 -6
@@ -121,7 +121,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-controller; - #interrupt-cells = <1>; + #interrupt-cells = <2>; }; gpio2: gpio at 10015100 {
@@ -131,7 +131,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-controller; - #interrupt-cells = <1>; + #interrupt-cells = <2>; }; gpio3: gpio at 10015200 {
@@ -141,7 +141,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-controller; - #interrupt-cells = <1>; + #interrupt-cells = <2>; }; gpio4: gpio at 10015300 {
@@ -151,7 +151,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-controller; - #interrupt-cells = <1>; + #interrupt-cells = <2>; }; gpio5: gpio at 10015400 {
@@ -161,7 +161,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-controller; - #interrupt-cells = <1>; + #interrupt-cells = <2>; }; gpio6: gpio at 10015500 {
@@ -171,7 +171,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-controller; - #interrupt-cells = <1>; + #interrupt-cells = <2>; }; cspi3: cspi at 10017000 {
arch/arm/boot/dts/imx51.dtsi +4 -4
@@ -133,7 +133,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-controller; - #interrupt-cells = <1>; + #interrupt-cells = <2>; }; gpio2: gpio at 73f88000 {
@@ -143,7 +143,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-controller; - #interrupt-cells = <1>; + #interrupt-cells = <2>; }; gpio3: gpio at 73f8c000 {
@@ -153,7 +153,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-controller; - #interrupt-cells = <1>; + #interrupt-cells = <2>; }; gpio4: gpio at 73f90000 {
@@ -163,7 +163,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-controller; - #interrupt-cells = <1>; + #interrupt-cells = <2>; }; wdog at 73f98000 { /* WDOG1 */
arch/arm/boot/dts/imx53.dtsi +7 -7
@@ -135,7 +135,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-controller; - #interrupt-cells = <1>; + #interrupt-cells = <2>; }; gpio2: gpio at 53f88000 {
@@ -145,7 +145,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-controller; - #interrupt-cells = <1>; + #interrupt-cells = <2>; }; gpio3: gpio at 53f8c000 {
@@ -155,7 +155,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-controller; - #interrupt-cells = <1>; + #interrupt-cells = <2>; }; gpio4: gpio at 53f90000 {
@@ -165,7 +165,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-controller; - #interrupt-cells = <1>; + #interrupt-cells = <2>; }; wdog at 53f98000 { /* WDOG1 */
@@ -203,7 +203,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-controller; - #interrupt-cells = <1>; + #interrupt-cells = <2>; }; gpio6: gpio at 53fe0000 {
@@ -213,7 +213,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-controller; - #interrupt-cells = <1>; + #interrupt-cells = <2>; }; gpio7: gpio at 53fe4000 {
@@ -223,7 +223,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-controller; - #interrupt-cells = <1>; + #interrupt-cells = <2>; }; i2c at 53fec000 { /* I2C3 */
arch/arm/boot/dts/imx6q.dtsi +7 -7
@@ -283,7 +283,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-controller; - #interrupt-cells = <1>; + #interrupt-cells = <2>; }; gpio2: gpio at 020a0000 {
@@ -293,7 +293,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-controller; - #interrupt-cells = <1>; + #interrupt-cells = <2>; }; gpio3: gpio at 020a4000 {
@@ -303,7 +303,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-controller; - #interrupt-cells = <1>; + #interrupt-cells = <2>; }; gpio4: gpio at 020a8000 {
@@ -313,7 +313,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-controller; - #interrupt-cells = <1>; + #interrupt-cells = <2>; }; gpio5: gpio at 020ac000 {
@@ -323,7 +323,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-controller; - #interrupt-cells = <1>; + #interrupt-cells = <2>; }; gpio6: gpio at 020b0000 {
@@ -333,7 +333,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-controller; - #interrupt-cells = <1>; + #interrupt-cells = <2>; }; gpio7: gpio at 020b4000 {
@@ -343,7 +343,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-controller; - #interrupt-cells = <1>; + #interrupt-cells = <2>; }; kpp at 020b8000 {
Signature · 1 line
1.7.5.4
Sascha Hauer
maintainerPATCH 1/1 ARM: dts: imx: update #interrupt-cells for gpio nodes
Quoted 6 lines · Shawn Guo
Change the value of #interrupt-cells of gpio nodes from 1 to 2, so that the gpio irq type can be specified in device tree. Also update binding document to make it clear.
Reported-by Sascha Hauer <[email protected]>Signed-off-by Shawn Guo <[email protected]>
Thanks Shawn
Sascha
Quoted 270 lines
--- .../devicetree/bindings/gpio/fsl-imx-gpio.txt | 9 +++++++++ arch/arm/boot/dts/imx27.dtsi | 12 ++++++------ arch/arm/boot/dts/imx51.dtsi | 8 ++++---- arch/arm/boot/dts/imx53.dtsi | 14 +++++++------- arch/arm/boot/dts/imx6q.dtsi | 14 +++++++------- 5 files changed, 33 insertions(+), 24 deletions(-)Documentation/devicetree/bindings/gpio/fsl-imx-gpio.txt +9
-0@@ -11,6 +11,13 @@ Required properties: the second cell is used to specify the gpio polarity: 0 = active high 1 = active low +- interrupt-controller: Marks the device node as an interrupt controller. +- #interrupt-cells : Should be 2. The first cell is the GPIO number. + The second cell bits[3:0] is used to specify trigger type and level flags: + 1 = low-to-high edge triggered. + 2 = high-to-low edge triggered. + 4 = active high level-sensitive. + 8 = active low level-sensitive. Example:@@ -20,4 +27,6 @@ gpio0: gpio at 73f84000 { interrupts = <50 51>; gpio-controller; #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; };arch/arm/boot/dts/imx27.dtsi +6
-6@@ -121,7 +121,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-controller; - #interrupt-cells = <1>; + #interrupt-cells = <2>; }; gpio2: gpio at 10015100 {@@ -131,7 +131,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-controller; - #interrupt-cells = <1>; + #interrupt-cells = <2>; }; gpio3: gpio at 10015200 {@@ -141,7 +141,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-controller; - #interrupt-cells = <1>; + #interrupt-cells = <2>; }; gpio4: gpio at 10015300 {@@ -151,7 +151,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-controller; - #interrupt-cells = <1>; + #interrupt-cells = <2>; }; gpio5: gpio at 10015400 {@@ -161,7 +161,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-controller; - #interrupt-cells = <1>; + #interrupt-cells = <2>; }; gpio6: gpio at 10015500 {@@ -171,7 +171,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-controller; - #interrupt-cells = <1>; + #interrupt-cells = <2>; }; cspi3: cspi at 10017000 {arch/arm/boot/dts/imx51.dtsi +4
-4@@ -133,7 +133,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-controller; - #interrupt-cells = <1>; + #interrupt-cells = <2>; }; gpio2: gpio at 73f88000 {@@ -143,7 +143,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-controller; - #interrupt-cells = <1>; + #interrupt-cells = <2>; }; gpio3: gpio at 73f8c000 {@@ -153,7 +153,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-controller; - #interrupt-cells = <1>; + #interrupt-cells = <2>; }; gpio4: gpio at 73f90000 {@@ -163,7 +163,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-controller; - #interrupt-cells = <1>; + #interrupt-cells = <2>; }; wdog at 73f98000 { /* WDOG1 */arch/arm/boot/dts/imx53.dtsi +7
-7@@ -135,7 +135,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-controller; - #interrupt-cells = <1>; + #interrupt-cells = <2>; }; gpio2: gpio at 53f88000 {@@ -145,7 +145,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-controller; - #interrupt-cells = <1>; + #interrupt-cells = <2>; }; gpio3: gpio at 53f8c000 {@@ -155,7 +155,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-controller; - #interrupt-cells = <1>; + #interrupt-cells = <2>; }; gpio4: gpio at 53f90000 {@@ -165,7 +165,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-controller; - #interrupt-cells = <1>; + #interrupt-cells = <2>; }; wdog at 53f98000 { /* WDOG1 */@@ -203,7 +203,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-controller; - #interrupt-cells = <1>; + #interrupt-cells = <2>; }; gpio6: gpio at 53fe0000 {@@ -213,7 +213,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-controller; - #interrupt-cells = <1>; + #interrupt-cells = <2>; }; gpio7: gpio at 53fe4000 {@@ -223,7 +223,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-controller; - #interrupt-cells = <1>; + #interrupt-cells = <2>; }; i2c at 53fec000 { /* I2C3 */arch/arm/boot/dts/imx6q.dtsi +7
-7@@ -283,7 +283,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-controller; - #interrupt-cells = <1>; + #interrupt-cells = <2>; }; gpio2: gpio at 020a0000 {@@ -293,7 +293,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-controller; - #interrupt-cells = <1>; + #interrupt-cells = <2>; }; gpio3: gpio at 020a4000 {@@ -303,7 +303,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-controller; - #interrupt-cells = <1>; + #interrupt-cells = <2>; }; gpio4: gpio at 020a8000 {@@ -313,7 +313,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-controller; - #interrupt-cells = <1>; + #interrupt-cells = <2>; }; gpio5: gpio at 020ac000 {@@ -323,7 +323,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-controller; - #interrupt-cells = <1>; + #interrupt-cells = <2>; }; gpio6: gpio at 020b0000 {@@ -333,7 +333,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-controller; - #interrupt-cells = <1>; + #interrupt-cells = <2>; }; gpio7: gpio at 020b4000 {@@ -343,7 +343,7 @@ gpio-controller; #gpio-cells = <2>; interrupt-controller; - #interrupt-cells = <1>; + #interrupt-cells = <2>; }; kpp at 020b8000 {Signature · 1 line
1.7.5.4
Signature · 4 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |