<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>LayerscapeのトピックRe: How to register GPIO interrupt on LX2160A using LLDP Linux</title>
    <link>https://community.nxp.com/t5/Layerscape/How-to-register-GPIO-interrupt-on-LX2160A-using-LLDP-Linux/m-p/1959680#M14910</link>
    <description>&lt;P&gt;1. No need to add content in the dts file.&lt;/P&gt;
&lt;P&gt;2. No need to modify&amp;nbsp;&lt;SPAN&gt;gpio-mpc8xxx.c.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 23 Sep 2024 08:38:19 GMT</pubDate>
    <dc:creator>yipingwang</dc:creator>
    <dc:date>2024-09-23T08:38:19Z</dc:date>
    <item>
      <title>How to register GPIO interrupt on LX2160A using LLDP Linux</title>
      <link>https://community.nxp.com/t5/Layerscape/How-to-register-GPIO-interrupt-on-LX2160A-using-LLDP-Linux/m-p/1953077#M14873</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I’m working with the LX2160ARDB-rev2 and using LLDP Linux Distribution RevL6.1.22_2.0.0, but 5.15-rt Linux kernel. I need to register my GPIO interrupt handler in the LLDP Linux Distribution. I’m looking for guidance on how to properly register and manage a GPIO interrupt handler.&lt;/P&gt;&lt;P&gt;I’ve found that I can use `request_irq()` to register my own interrupt handler.&amp;nbsp;However, I've also known that the IRQ number passed to `request_irq()` is a logical number managed by the kernel, and it is different from the GIC’s Interrupt ID (hwirq). I don't know how to get IRQ number from one specific GPIO pin.&lt;/P&gt;&lt;P&gt;According to the LX2160A Reference Manual, the Interrupt ID(hwirq) of GPIO module on the GIC is 68 for GPIO1 &amp;amp; GPIO2 ORed, and 69 for GPIO3 &amp;amp; GPIO4 ORed. It looks like the gpio-mpc8xxx.c file calls `devm_request_irq()` to register the mpc8xxx_gpio_irq_cascade handler, which in turn calls `generic_handle_domain_irq()` to handle individual GPIO pin interrupts. So, I would like to know how to register an interrupt handler for a single GPIO pin.&lt;/P&gt;&lt;P&gt;I want to use one GPIO pin in input mode to receive periodic interrupts from an external device and register a handler to process these interrupts. Based on the GPIO section in the LLDPUG_RevL6.1.22_2.0.0 documentation (section 7.5.23), it seems like I can use J29 on the LX2160ARDB board.&lt;/P&gt;&lt;P&gt;In conclusion,&amp;nbsp; I have a few questions:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;Device Tree Configuration&lt;/STRONG&gt;: Do I need to add content to the device tree? If so, what should I add?&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Driver Development&lt;/STRONG&gt;: Should I write a new device driver for the external device connected to J29 and register the handler with Linux, or should I modify gpio-mpc8xxx.c?&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Getting IRQ Number&lt;/STRONG&gt;: If I need to write a new device driver, how do I obtain the IRQ number for `request_irq()`? For example, should I use gpio_to_irq()? How do I determine the PIN number to pass to `gpio_to_irq()`?&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;</description>
      <pubDate>Thu, 12 Sep 2024 06:01:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Layerscape/How-to-register-GPIO-interrupt-on-LX2160A-using-LLDP-Linux/m-p/1953077#M14873</guid>
      <dc:creator>Taeyoon</dc:creator>
      <dc:date>2024-09-12T06:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to register GPIO interrupt on LX2160A using LLDP Linux</title>
      <link>https://community.nxp.com/t5/Layerscape/How-to-register-GPIO-interrupt-on-LX2160A-using-LLDP-Linux/m-p/1959680#M14910</link>
      <description>&lt;P&gt;1. No need to add content in the dts file.&lt;/P&gt;
&lt;P&gt;2. No need to modify&amp;nbsp;&lt;SPAN&gt;gpio-mpc8xxx.c.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2024 08:38:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Layerscape/How-to-register-GPIO-interrupt-on-LX2160A-using-LLDP-Linux/m-p/1959680#M14910</guid>
      <dc:creator>yipingwang</dc:creator>
      <dc:date>2024-09-23T08:38:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to register GPIO interrupt on LX2160A using LLDP Linux</title>
      <link>https://community.nxp.com/t5/Layerscape/How-to-register-GPIO-interrupt-on-LX2160A-using-LLDP-Linux/m-p/1973958#M14986</link>
      <description>&lt;P&gt;Then, what Pin number I should use for linux GPIO APIs(e.g. gpio_request(), gpio_to_irq() etc..)?&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2024 07:14:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Layerscape/How-to-register-GPIO-interrupt-on-LX2160A-using-LLDP-Linux/m-p/1973958#M14986</guid>
      <dc:creator>Taeyoon</dc:creator>
      <dc:date>2024-10-15T07:14:54Z</dc:date>
    </item>
  </channel>
</rss>

