<div dir="ltr">Hello,<br><br>With reference to the example below what is the correct way to get the gpio values from the device tree :<br><br>I modified the existing leds-ns2 device tree as below :<br><br> <br><br>          blue-sata {<br><br>                   label = &quot;ns2:blue:sata&quot;;<br><br>                   slow-gpio = &lt;&amp;gpio0 29 0&gt;;<br><br>                   cmd-gpio = &lt;&amp;gpio0 30 0&gt;;<br><br>+                 slow1-gpio=&lt;&amp;gpio 31 0&gt;;<br><br>+                 cmd1-gpio=&lt;&amp;gpio 32 0&gt;;<br><br>                   modes-map = &lt;NS_V2_LED_OFF  0 1<br><br>                                NS_V2_LED_ON   1 0<br><br>                                NS_V2_LED_ON   0 0<br><br>                                NS_V2_LED_SATA 1 1&gt;;<br><br>           };<br><br> <br><br> <br><br>And modified the driver by adding slow1 and cmd1 in all the structure (just like slow and cmd)<br><br>But when I am trying to get the gpio number for slow1 and cmd1 I am getting the below error(number gpio #31 and 32 are random numbers of gpio for testing, does it matters?) :<br><br>error : leds-ns2:probe of ns2-leds failed with error -2.What does error code -2 represents ?Is this a device tree parsing error?<br><br>ret = of_get_named_gpio(child, &quot;slow1-gpio&quot;, 0);<br><br>                 if (ret &lt; 0)<br><br>                         return ret;<br><br>same error if I try to get the cmd1-gpio<br> <br><br>Thanks in advance !<br><br>Regards,<br><br>Rp<br><br>On Thu, Aug 4, 2016 at 9:23 AM, Raul Piper &lt;<a href="mailto:raulpblooper@gmail.com">raulpblooper@gmail.com</a>&gt; wrote:<br>&gt; make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- &lt;name of the dtb file&gt;.dtb<br>&gt;<br>&gt; This compiles fine.<br>&gt;<br>&gt; On Thu, Aug 4, 2016 at 1:06 AM, Frank Rowand &lt;<a href="mailto:frowand.list@gmail.com">frowand.list@gmail.com</a>&gt; wrote:<br>&gt;&gt; On 07/25/16 04:17, Raul Piper wrote:<br>&gt;&gt;&gt; Hi,<br>&gt;&gt;&gt; Where can I find the example for the  dynamic Loading of the device<br>&gt;&gt;&gt; tree and its corresponding device driver.<br>&gt;&gt;&gt; How can I build the dts with or without the kernel source.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; I am getting this error whenever I am trying to build the below sample<br>&gt;&gt;&gt; dts file using the dtc compiler.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; dtc -O dtb -o leds-ns2.dtb leds-ns2.dts<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Error: leds-ns2.dts:1.1-2 syntax error<br>&gt;&gt;<br>&gt;&gt; That is an error at line 1, columns 1-2. dtc does not understand cpp<br>&gt;&gt; directives, you need to process leds-ns2.dts with cpp. The Linux<br>&gt;&gt; build infrastructure does this for .dtb targets in makefiles.<br>&gt;&gt;<br>&gt;&gt;&gt; FATAL ERROR: Unable to parse input tree<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Below is the content  of the leds-ns2.dts<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; #include &lt;dt-bindings/leds/leds-ns2.h&gt;<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;  ns2-leds {<br>&gt;&gt;&gt;           compatible = &quot;lacie,ns2-leds&quot;;<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;           blue-sata {<br>&gt;&gt;&gt;                   label = &quot;ns2:blue:sata&quot;;<br>&gt;&gt;&gt;                   slow-gpio = &lt;&amp;gpio0 29 0&gt;;<br>&gt;&gt;&gt;                   cmd-gpio = &lt;&amp;gpio0 30 0&gt;;<br>&gt;&gt;&gt;                   modes-map = &lt;NS_V2_LED_OFF  0 1<br>&gt;&gt;&gt;                                NS_V2_LED_ON   1 0<br>&gt;&gt;&gt;                                NS_V2_LED_ON   0 0<br>&gt;&gt;&gt;                                NS_V2_LED_SATA 1 1&gt;;<br>&gt;&gt;&gt;           };<br>&gt;&gt;&gt;   };<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Thanks,<br>&gt;&gt;&gt; R<br>&gt;&gt;&gt; --<br>&gt;&gt;&gt; To unsubscribe from this list: send the line &quot;unsubscribe devicetree&quot; in<br>&gt;&gt;&gt; the body of a message to <a href="mailto:majordomo@vger.kernel.org">majordomo@vger.kernel.org</a><br>&gt;&gt;&gt; More majordomo info at  <a href="http://vger.kernel.org/majordomo-info.html">http://vger.kernel.org/majordomo-info.html</a><br>&gt;&gt;&gt;<br>&gt;&gt;<br></div>