diff mbox

need help to configure IRQ on gpio 139 pandaboard using device tree

Message ID 52A9C7B6.3020905@st.com (mailing list archive)
State New, archived
Headers show

Commit Message

Denis CIOCCA Dec. 12, 2013, 2:27 p.m. UTC
Maybe, this is more correctly but still doesn't work...


 From 9f6e524fa86834c3ab9a5f710021620a103019b2 Mon Sep 17 00:00:00 2001
From: Denis Ciocca <denis.ciocca@st.com>
Date: Thu, 12 Dec 2013 14:52:39 +0100
Subject: [PATCH] device tree

---
  arch/arm/boot/dts/omap4-panda-es.dts |   22 ++++++++++++++++++++++
  1 file changed, 22 insertions(+)

Comments

Nishanth Menon Dec. 12, 2013, 2:49 p.m. UTC | #1
On 12/12/2013 08:27 AM, Denis CIOCCA wrote:
> Maybe, this is more correctly but still doesn't work...
> 
> 
>  From 9f6e524fa86834c3ab9a5f710021620a103019b2 Mon Sep 17 00:00:00 2001
> From: Denis Ciocca <denis.ciocca@st.com>
> Date: Thu, 12 Dec 2013 14:52:39 +0100
> Subject: [PATCH] device tree
> 
> ---
>   arch/arm/boot/dts/omap4-panda-es.dts |   22 ++++++++++++++++++++++
>   1 file changed, 22 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/omap4-panda-es.dts 
> b/arch/arm/boot/dts/omap4-panda-es.dts
> index 816d1c9..82c3eb7 100644
> --- a/arch/arm/boot/dts/omap4-panda-es.dts
> +++ b/arch/arm/boot/dts/omap4-panda-es.dts
> @@ -41,6 +41,12 @@
>               0xb6 (PIN_OUTPUT | MUX_MODE3)    /* gpio_110 */
>           >;
>       };
> +
> +    lsm6db0_pins: lsm6db0_pins {
> +        pinctrl-single,pins = <
> +            0xf6 (PIN_INPUT | MUX_MODE3) /*  mcspi1_simo.gpio_136 */
> +        >;
> +    };
>   };
> 
>   &led_wkgpio_pins {
> @@ -49,6 +55,22 @@
>       >;
>   };
> 
> +&i2c4 {
> +    pinctrl-names = "default";
> +    pinctrl-0 = <&i2c4_pins>;
> +
> +    clock-frequency = <400000>;
> +
> +    lsm6db0@03 {
> +        pinctrl-names = "default";
> +        pinctrl-0 = <&lsm6db0_pins>;
> +        compatible = "st,lsm6db0";
> +        reg = <0x03>;
> +        interrupts = <&mcspi1 136 IRQ_TYPE_LEVEL_HIGH>;
> +        interrupt-parent = <&mcspi1>;
why is mcspi1 your interrupt parent when you did a padconf for GPIO?
you want GPIO136, so you need the right gpio block as the interrupt
parent and map interrupts in the correct map.
see [1] for an example (omap2).
> +    };
> +};
> +
>   &leds {
>       pinctrl-0 = <
>           &led_gpio_pins
> 

[1]
https://git.kernel.org/cgit/linux/kernel/git/tmlind/linux-omap.git/tree/arch/arm/boot/dts/omap2430-sdp.dts?id=omap-for-v3.14/omap3-board-removal-wl1251#n42
Denis CIOCCA Dec. 12, 2013, 3:05 p.m. UTC | #2
> why is mcspi1 your interrupt parent when you did a padconf for GPIO?
> you want GPIO136, so you need the right gpio block as the interrupt
> parent and map interrupts in the correct map.
> see [1] for an example (omap2).
Oh my god! Now I've understand how device tree works...I'm sorry 
Nishanth but the dt it's new for me...ok I'm using gpio5 and now it works!

+interrupt-parent = <&gpio5>;
+       interrupts = <8 IRQ_TYPE_LEVEL_HIGH>; /* gpio line 136 */

Thank you very much for your patience...;)

BR,
Denis--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Nishanth Menon Dec. 12, 2013, 4:15 p.m. UTC | #3
On 12/12/2013 09:05 AM, Denis CIOCCA wrote:
>> why is mcspi1 your interrupt parent when you did a padconf for GPIO?
>> you want GPIO136, so you need the right gpio block as the interrupt
>> parent and map interrupts in the correct map.
>> see [1] for an example (omap2).
> Oh my god! Now I've understand how device tree works...I'm sorry
> Nishanth but the dt it's new for me...ok I'm using gpio5 and now it works!
>
> +interrupt-parent = <&gpio5>;
> +       interrupts = <8 IRQ_TYPE_LEVEL_HIGH>; /* gpio line 136 */
>
> Thank you very much for your patience...;)

glad to hear it worked, yeah, device tree is a little different, but 
logical in it's own way.

Regards,
Nishanth Menon

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/arm/boot/dts/omap4-panda-es.dts 
b/arch/arm/boot/dts/omap4-panda-es.dts
index 816d1c9..82c3eb7 100644
--- a/arch/arm/boot/dts/omap4-panda-es.dts
+++ b/arch/arm/boot/dts/omap4-panda-es.dts
@@ -41,6 +41,12 @@ 
              0xb6 (PIN_OUTPUT | MUX_MODE3)    /* gpio_110 */
          >;
      };
+
+    lsm6db0_pins: lsm6db0_pins {
+        pinctrl-single,pins = <
+            0xf6 (PIN_INPUT | MUX_MODE3) /*  mcspi1_simo.gpio_136 */
+        >;
+    };
  };

  &led_wkgpio_pins {
@@ -49,6 +55,22 @@ 
      >;
  };

+&i2c4 {
+    pinctrl-names = "default";
+    pinctrl-0 = <&i2c4_pins>;
+
+    clock-frequency = <400000>;
+
+    lsm6db0@03 {
+        pinctrl-names = "default";
+        pinctrl-0 = <&lsm6db0_pins>;
+        compatible = "st,lsm6db0";
+        reg = <0x03>;
+        interrupts = <&mcspi1 136 IRQ_TYPE_LEVEL_HIGH>;
+        interrupt-parent = <&mcspi1>;
+    };
+};
+
  &leds {
      pinctrl-0 = <
          &led_gpio_pins