<?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>topic How to configure QE port B pins as gpios in p1021 in P-Series</title>
    <link>https://community.nxp.com/t5/P-Series/How-to-configure-QE-port-B-pins-as-gpios-in-p1021/m-p/394473#M2181</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working on p1021rdb. I need to configure PB10 as gpio pin, I wrote gpios property as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gpios = &amp;lt;&amp;amp;qe_pio_b 42 0&amp;gt;; inside a device node.&lt;/P&gt;&lt;P&gt;then used following functions&lt;/P&gt;&lt;P&gt;of_gpio_count(),&lt;/P&gt;&lt;P&gt;of_get_gpio_flags(),&lt;/P&gt;&lt;P&gt;gpio_request(),&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here I am getting error in the of_get_gpio_flags() function call..&lt;/P&gt;&lt;P&gt;When I started debugging the this I came to know that QE gpio controller chip is added to the list of gpio chip controllers with only 32 gpios .&lt;/P&gt;&lt;P&gt;Ddue to this of_gpio_simple_xlate() is throwing error while comparing the below condition&lt;/P&gt;&lt;P&gt;if(gpiospec-&amp;gt;args[0] &amp;gt;= gc-&amp;gt;ngpio)&lt;/P&gt;&lt;P&gt;return -EINVAL;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3334ca;"&gt;&lt;STRONG&gt;what is the number that should be passed in the device tree to configure PB10 as gpio&lt;/STRONG&gt;&lt;/SPAN&gt;, is there any document that explains pin numbers and their corresponding gpio numbers in the QE gpio chip controller?&lt;/P&gt;&lt;P&gt;As the driver code supports only 32 gpios at max, how to port map pins? it is not like PA0 pin maps to 0, PB0 maps to 32 ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your help is appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 19 Sep 2015 11:06:10 GMT</pubDate>
    <dc:creator>amanagantivinod</dc:creator>
    <dc:date>2015-09-19T11:06:10Z</dc:date>
    <item>
      <title>How to configure QE port B pins as gpios in p1021</title>
      <link>https://community.nxp.com/t5/P-Series/How-to-configure-QE-port-B-pins-as-gpios-in-p1021/m-p/394473#M2181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working on p1021rdb. I need to configure PB10 as gpio pin, I wrote gpios property as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gpios = &amp;lt;&amp;amp;qe_pio_b 42 0&amp;gt;; inside a device node.&lt;/P&gt;&lt;P&gt;then used following functions&lt;/P&gt;&lt;P&gt;of_gpio_count(),&lt;/P&gt;&lt;P&gt;of_get_gpio_flags(),&lt;/P&gt;&lt;P&gt;gpio_request(),&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here I am getting error in the of_get_gpio_flags() function call..&lt;/P&gt;&lt;P&gt;When I started debugging the this I came to know that QE gpio controller chip is added to the list of gpio chip controllers with only 32 gpios .&lt;/P&gt;&lt;P&gt;Ddue to this of_gpio_simple_xlate() is throwing error while comparing the below condition&lt;/P&gt;&lt;P&gt;if(gpiospec-&amp;gt;args[0] &amp;gt;= gc-&amp;gt;ngpio)&lt;/P&gt;&lt;P&gt;return -EINVAL;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3334ca;"&gt;&lt;STRONG&gt;what is the number that should be passed in the device tree to configure PB10 as gpio&lt;/STRONG&gt;&lt;/SPAN&gt;, is there any document that explains pin numbers and their corresponding gpio numbers in the QE gpio chip controller?&lt;/P&gt;&lt;P&gt;As the driver code supports only 32 gpios at max, how to port map pins? it is not like PA0 pin maps to 0, PB0 maps to 32 ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your help is appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 Sep 2015 11:06:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/P-Series/How-to-configure-QE-port-B-pins-as-gpios-in-p1021/m-p/394473#M2181</guid>
      <dc:creator>amanagantivinod</dc:creator>
      <dc:date>2015-09-19T11:06:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure QE port B pins as gpios in p1021</title>
      <link>https://community.nxp.com/t5/P-Series/How-to-configure-QE-port-B-pins-as-gpios-in-p1021/m-p/394474#M2182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have a great day,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;binding/powerpc/fsl/&lt;A href="http://lxr.free-electrons.com/source/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/" style="border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: #999999; color: #0a0a0a;"&gt;cpm_qe&lt;/A&gt;/&lt;A href="http://lxr.free-electrons.com/source/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/gpio.txt" style="border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: #999999; color: #0a0a0a;"&gt;gpio.txt says&lt;/A&gt;&lt;/P&gt;&lt;P&gt;#gpio-cells : Should be two. The first cell is the pin number and the second cell is used to specify optional parameters (currently unused).&lt;/P&gt;&lt;P&gt;as example see &lt;/P&gt;&lt;P&gt; lxr.free-electrons.com/source/arch/powerpc/boot/dts/mpc8569mds.dts&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt; lxr.free-electrons.com/source/arch/powerpc/boot/dts/mpc8360rdk.dts&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; i.e. for PB10 it should be &amp;lt;&amp;amp;qe_pio_b 10 0&amp;gt;&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>Mon, 21 Sep 2015 17:51:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/P-Series/How-to-configure-QE-port-B-pins-as-gpios-in-p1021/m-p/394474#M2182</guid>
      <dc:creator>r8070z</dc:creator>
      <dc:date>2015-09-21T17:51:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure QE port B pins as gpios in p1021</title>
      <link>https://community.nxp.com/t5/P-Series/How-to-configure-QE-port-B-pins-as-gpios-in-p1021/m-p/394475#M2183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Podiatchev,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;I understand that we need to create a node for each parallel I/O ports, and gpios property should use the proper proper port node's phandle, pin number as below..&lt;/P&gt;&lt;P&gt;gpios=&amp;lt;&amp;amp;qe_pio_X, pin_num, 0&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in my device tree there was only port-B node, I added&amp;nbsp; port-A and tried its pins as gpios its working... :smileygrin:&lt;/P&gt;&lt;P&gt;Thanks once again!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Sep 2015 04:15:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/P-Series/How-to-configure-QE-port-B-pins-as-gpios-in-p1021/m-p/394475#M2183</guid>
      <dc:creator>amanagantivinod</dc:creator>
      <dc:date>2015-09-22T04:15:51Z</dc:date>
    </item>
  </channel>
</rss>

