<?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 iMX28 GPIO Setup In Device Tree in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/iMX28-GPIO-Setup-In-Device-Tree/m-p/388983#M56536</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have just gotten started getting my custom iMX28 board running the mainline kernel 3.14. One thing that I haven't figured out is how to setup GPIO's like I did in 2.6.35.&lt;/P&gt;&lt;P&gt;For example I have one GPIO that controls the power to the LCD backlight and it needs to be accessible from user space.&lt;/P&gt;&lt;P&gt;In 2.6.35 I simply did the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;{&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;.name = "LCD_BACKLIGHT",&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;.id = PINID_SAIF1_SDATA0,&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;.fun = PIN_GPIO,&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;.data&amp;nbsp; = 1,&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;.output = 1,&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;},&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then using sysfs I could change the value from 1 to 0 to turn the backlight on and off. &lt;/P&gt;&lt;P&gt;Now my question is how do I accomplish the same thing with the device tree?&lt;/P&gt;&lt;P&gt;I read through the documentation in the kernel source tree but couldn't figure it out. Using regulators looked like they might be the way to go but I am not sure.&lt;/P&gt;&lt;P&gt;It was so simple before that I feel like I could be missing something easy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 29 Aug 2014 02:23:33 GMT</pubDate>
    <dc:creator>tomdeacon</dc:creator>
    <dc:date>2014-08-29T02:23:33Z</dc:date>
    <item>
      <title>iMX28 GPIO Setup In Device Tree</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX28-GPIO-Setup-In-Device-Tree/m-p/388983#M56536</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have just gotten started getting my custom iMX28 board running the mainline kernel 3.14. One thing that I haven't figured out is how to setup GPIO's like I did in 2.6.35.&lt;/P&gt;&lt;P&gt;For example I have one GPIO that controls the power to the LCD backlight and it needs to be accessible from user space.&lt;/P&gt;&lt;P&gt;In 2.6.35 I simply did the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;{&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;.name = "LCD_BACKLIGHT",&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;.id = PINID_SAIF1_SDATA0,&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;.fun = PIN_GPIO,&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;.data&amp;nbsp; = 1,&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;.output = 1,&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;},&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then using sysfs I could change the value from 1 to 0 to turn the backlight on and off. &lt;/P&gt;&lt;P&gt;Now my question is how do I accomplish the same thing with the device tree?&lt;/P&gt;&lt;P&gt;I read through the documentation in the kernel source tree but couldn't figure it out. Using regulators looked like they might be the way to go but I am not sure.&lt;/P&gt;&lt;P&gt;It was so simple before that I feel like I could be missing something easy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Aug 2014 02:23:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX28-GPIO-Setup-In-Device-Tree/m-p/388983#M56536</guid>
      <dc:creator>tomdeacon</dc:creator>
      <dc:date>2014-08-29T02:23:33Z</dc:date>
    </item>
    <item>
      <title>Re: iMX28 GPIO Setup In Device Tree</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX28-GPIO-Setup-In-Device-Tree/m-p/388984#M56537</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tom&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think links below answer this question&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-thread-small" data-containerid="2004" data-containertype="14" data-objectid="317876" data-objecttype="1" href="https://community.freescale.com/thread/317876"&gt;https://community.freescale.com/thread/317876&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://stackoverflow.com/questions/20656006/default-config-of-gpios-using-device-tree-freescale-i-mx6"&gt;http://stackoverflow.com/questions/20656006/default-config-of-gpios-using-device-tree-freescale-i-mx6&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;chip&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Aug 2014 06:27:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX28-GPIO-Setup-In-Device-Tree/m-p/388984#M56537</guid>
      <dc:creator>igorpadykov</dc:creator>
      <dc:date>2014-08-29T06:27:19Z</dc:date>
    </item>
    <item>
      <title>Re: iMX28 GPIO Setup In Device Tree</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX28-GPIO-Setup-In-Device-Tree/m-p/388985#M56538</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply chipexpert but those two links didn't help. The first one never came to a satisfactory conclusion, and they talked about using u-boot, where I am using the bootlets and also I want the pin to be configured to be out by the kernel already and not have to do that using sysfs. Also both are about imx6 and didn't look like they would apply to imx28.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Aug 2014 17:54:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX28-GPIO-Setup-In-Device-Tree/m-p/388985#M56538</guid>
      <dc:creator>tomdeacon</dc:creator>
      <dc:date>2014-08-29T17:54:16Z</dc:date>
    </item>
    <item>
      <title>Re: iMX28 GPIO Setup In Device Tree</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX28-GPIO-Setup-In-Device-Tree/m-p/388986#M56539</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tom,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check arch/arm/boot/dts/imx28-evk.dts, where we have the &lt;CODE&gt;reg_lcd_3v3 regulator controlling the LCD backlight (we also have a PWM control there as well)&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/imx28-evk.dts?id=refs/tags/v3.17-rc2" title="https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/imx28-evk.dts?id=refs/tags/v3.17-rc2"&gt;https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/imx28-evk.dts?id=refs/tags/v3.17-…&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 30 Aug 2014 12:20:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX28-GPIO-Setup-In-Device-Tree/m-p/388986#M56539</guid>
      <dc:creator>fabio_estevam</dc:creator>
      <dc:date>2014-08-30T12:20:19Z</dc:date>
    </item>
    <item>
      <title>Re: iMX28 GPIO Setup In Device Tree</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX28-GPIO-Setup-In-Device-Tree/m-p/388987#M56540</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Tom,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. define your GPIO under pinctrl section&lt;/P&gt;&lt;P&gt;2. use this gpio for the gpio-led driver just as led_pin_gpio3_5 in mx28-evk.dts&lt;/P&gt;&lt;P&gt;3. add the property default-state="on" (refer to &lt;A href="http://lxr.free-electrons.com/source/Documentation/devicetree/bindings/leds/leds-gpio.txt"&gt;http://lxr.free-electrons.com/source/Documentation/devicetree/bindings/leds/leds-gpio.txt&lt;/A&gt; )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Sep 2014 19:09:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX28-GPIO-Setup-In-Device-Tree/m-p/388987#M56540</guid>
      <dc:creator>lategoodbye</dc:creator>
      <dc:date>2014-09-03T19:09:40Z</dc:date>
    </item>
    <item>
      <title>Re: iMX28 GPIO Setup In Device Tree</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX28-GPIO-Setup-In-Device-Tree/m-p/388988#M56541</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the replies everyone. I ended up modifying the pinctrl driver for mxs/imx28 to accept fsl,data and fsl,output as inputs. Then I had to create a dummy driver that does nothing but I could assign the gpio's to so that pinctrl-mxs would configure them. Now the gpio's get set to output and exported to sysfs and I can use them just as before with 2.6.35.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Sep 2014 18:43:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX28-GPIO-Setup-In-Device-Tree/m-p/388988#M56541</guid>
      <dc:creator>tomdeacon</dc:creator>
      <dc:date>2014-09-04T18:43:45Z</dc:date>
    </item>
  </channel>
</rss>

