<?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>i.MX ProcessorsのトピックRe: GPIO input read, device tree imx6 kernel</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/GPIO-input-read-device-tree-imx6-kernel/m-p/338765#M46296</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your post, I have the u-boot part of my board working.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Right now I have the inputs working by exporting the pins and setting the direction to input in my rc.local file.&amp;nbsp; Then by reading the value register I can get the current state of the pin.&amp;nbsp; I am hoping to use the gpio-keys-polled but can't find out how to actually poll the value of the pin.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For outputs I use the gpio-leds and that works fine for me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 27 Feb 2015 18:57:03 GMT</pubDate>
    <dc:creator>michaeldiamond</dc:creator>
    <dc:date>2015-02-27T18:57:03Z</dc:date>
    <item>
      <title>GPIO input read, device tree imx6 kernel</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/GPIO-input-read-device-tree-imx6-kernel/m-p/338763#M46294</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to read the value of an input. I am using kernel 3.10.17_1.0.2_ga. The only way I have found is to manually export the gpio and then read the value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried using the gpio-keys.&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_text_macro _jivemacro_uid_14249087954645317 jive_macro_code" jivemacro_uid="_14249087954645317"&gt;
&lt;P&gt;keys {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; compatible = "gpio-keys-polled";&lt;/P&gt;
&lt;P&gt;&amp;nbsp; #address-cells = &amp;lt;1&amp;gt;;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; #size-cells = &amp;lt;0&amp;gt;;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; poll-interval = &amp;lt;20&amp;gt;;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; //autorepeat;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; gpio-pwr{&lt;/P&gt;
&lt;P&gt;&amp;nbsp; label = "gpio-powerbutton";&lt;/P&gt;
&lt;P&gt;&amp;nbsp; gpios = &amp;lt;&amp;amp;gpio2 1 1&amp;gt;;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; linux,code = &amp;lt;84&amp;gt;; /* KEY_RESERVED&amp;nbsp; */&lt;/P&gt;
&lt;P&gt;&amp;nbsp; };&lt;/P&gt;
&lt;P&gt;&amp;nbsp; gpio-charge{&lt;/P&gt;
&lt;P&gt;&amp;nbsp; label = "gpio-charge";&lt;/P&gt;
&lt;P&gt;&amp;nbsp; gpios = &amp;lt;&amp;amp;gpio2 2 0&amp;gt;;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; linux,code = &amp;lt;85&amp;gt;; /* KEY_RESERVED&amp;nbsp; */&lt;/P&gt;
&lt;P&gt;&amp;nbsp; };&lt;/P&gt;
&lt;P&gt;&amp;nbsp; gpio-test{&lt;/P&gt;
&lt;P&gt;&amp;nbsp; label = "gpio-test";&lt;/P&gt;
&lt;P&gt;&amp;nbsp; gpios = &amp;lt;&amp;amp;gpio3 14 0&amp;gt;;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; linux,code = &amp;lt;86&amp;gt;; /* KEY_RESERVED&amp;nbsp; */&lt;/P&gt;
&lt;P&gt;&amp;nbsp; };&lt;/P&gt;
&lt;P&gt;&amp;nbsp; };&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt; I can see the the events occur in /dev/input/event0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is I need to read the value and not trigger off of an interrupt.&amp;nbsp; I have read about gpio-keys-polled (&lt;A href="http://www.wiki.xilinx.com/Linux+GPIO+Driver" rel="nofollow noopener noreferrer" title="http://www.wiki.xilinx.com/Linux+GPIO+Driver" target="_blank"&gt;Xilinx Wiki - Linux GPIO Driver&lt;/A&gt;) but can't find anything on how to get the value in code.&amp;nbsp; We had the kernel export the gpio in the old kernel but have not found a way to do that using the device tree.&amp;nbsp; I found some things for open wrt for having the dts file export the gpio but it looks like our kernel does not have this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help here would be great&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Feb 2015 00:06:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/GPIO-input-read-device-tree-imx6-kernel/m-p/338763#M46294</guid>
      <dc:creator>michaeldiamond</dc:creator>
      <dc:date>2015-02-26T00:06:47Z</dc:date>
    </item>
    <item>
      <title>Re: GPIO input read, device tree imx6 kernel</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/GPIO-input-read-device-tree-imx6-kernel/m-p/338764#M46295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Michael,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you checked the implementations of other Community users, like the following thread?&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/thread/343064"&gt;https://community.freescale.com/thread/343064&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Hope this will be useful for you.&lt;BR /&gt;Best regards!&lt;BR /&gt;/Carlos&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Feb 2015 20:43:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/GPIO-input-read-device-tree-imx6-kernel/m-p/338764#M46295</guid>
      <dc:creator>CarlosCasillas</dc:creator>
      <dc:date>2015-02-26T20:43:00Z</dc:date>
    </item>
    <item>
      <title>Re: GPIO input read, device tree imx6 kernel</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/GPIO-input-read-device-tree-imx6-kernel/m-p/338765#M46296</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your post, I have the u-boot part of my board working.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Right now I have the inputs working by exporting the pins and setting the direction to input in my rc.local file.&amp;nbsp; Then by reading the value register I can get the current state of the pin.&amp;nbsp; I am hoping to use the gpio-keys-polled but can't find out how to actually poll the value of the pin.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For outputs I use the gpio-leds and that works fine for me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Feb 2015 18:57:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/GPIO-input-read-device-tree-imx6-kernel/m-p/338765#M46296</guid>
      <dc:creator>michaeldiamond</dc:creator>
      <dc:date>2015-02-27T18:57:03Z</dc:date>
    </item>
  </channel>
</rss>

