title: Kernel driver, is pinctrl property always needed when using GPIO overlay?
body: <p>I've asked this question on Unix Stackexchange, but it seems it was a wrong place for this kind of problem. Ad rem:</p>
  
  <p>I'm creating a kernel driver for SPI controlled display, which is meant to be working with Raspberry PI. Besides the three SPI lines, the display has 3 additional control lines: <em>BUSY</em>, <em>RST</em> and <em>DC</em>. In order to has a possibility of controlling these lines, my DTS has to include additional fragment for GPIO.</p>
  
  <pre><code>fragment@0 {
      target = &lt;&amp;spi0&gt;;
      __overlay__ {
          #address-cells = &lt;1&gt;;
          #size-cells = &lt;0&gt;;
  
          status = "okay";
  
          spidev@0 {
              status = "disabled";
          };
  
          epd0: epd@0 {
              compatible = "waveshare,epd";
              reg = &lt;0&gt;;
  
              pinctrl-names = "default";
              pinctrl-0 = &lt;&amp;epd_pins&gt;;
  
              spi-max-frequency = &lt;1000000&gt;;
  
              width = &lt;128&gt;;
              height = &lt;296&gt;;
  
              dc-gpios = &lt;&amp;gpio 16 0&gt;;
              reset-gpios = &lt;&amp;gpio 20 0&gt;;
              busy-gpios = &lt;&amp;gpio 21 0&gt;;
  
              status = "okay";
          };
      };
  };
  
  fragment@1 {
      target = &lt;&amp;gpio&gt;;
      __overlay__ {
          epd_pins: epd_pins {
              brcm,pins = &lt;16 20 21&gt;; /* DC RST BUSY */
              brcm,function = &lt;1 1 0&gt;; /* out out in */
          };
      };
  };
  </code></pre>
  
  <p>That DTS works perfectly fine and I didn't expect any troubles. But there is one thing I'm not sure about:</p>
  
  <pre><code>pinctrl-names = "default";
  pinctrl-0 = &lt;&amp;epd_pins&gt;;
  </code></pre>
  
  <p>I've seen properties like that in other's DTs with <code>gpio</code> fragments, but not always; sometimes they are, sometimes they're not. If I comment out these two lines, it seems like nothing changes, and my driver still works as it should.</p>
  
  <p>I have two questions:</p>
  
  <ol>
  <li>What is the purpose of those <code>pinctrl</code> lines? I'm aware of pin controller subsystem, but I'm asking strictly in context of my DT.</li>
  <li>Why do I need to declare the <code>gpio</code> overlay? I set IN or OUT function directly from my driver code anyway and my gpio numbers are defined in <code>spi</code> overlay (<code>dc-gpios</code>, <code>reset-gpios</code>, <code>busy-gpios</code>).</li>
  </ol>