Thread (1 message) 1 message, 1 author, 2019-03-08

Re: [PATCH v2 3/4] pinctrl: mcp23s08: work around GPIO line naming

From: Jan Kundrát <hidden>
Date: 2019-03-08 12:51:13

On čtvrtek 7. března 2019 22:35:15 CET, Thomas Petazzoni wrote:
Hello Jan,

On Thu, 7 Mar 2019 14:31:02 +0100
Jan Kundrát [off-list ref] wrote:
quoted
+Line naming
+===========
+
+Because several gpio_chip instances are hidden below a single device tree
Mentioning a Linux specific data structure (gpio_chip here) in a Device
Tree binding documentation does not seem like a good idea. Bindings are
supposed to be OS-agnostic.
Hi Thomas, that's a fair comment. On the other hand, this driver's DT bindings are already quite Linux specific with their "microchip,spi-present-mask" workaround. The way I understand this, Linux does not support multiple child devices "within" one SPI slave. If there was proper support for this, this patch would be superfluous.

I, too, would love to see this driver changed so that the bindings look, e.g., like this:

 gpio_spi_chips: gpio@1 {
   compatible = "microchip,mcp23s17-multiple";

   gpio-bank@1 {
     compatible = "microchip,mcp23s17";
     reg = <1>;
     interrupt-parent = <&gpio1>;
     interrupts = <22 IRQ_TYPE_LEVEL_LOW>;
     interrupt-controller;
     #interrupt-cells = <2>;
     gpio-controller;
     #gpio-cells = <2>;
     microchip,irq-mirror;
     drive-open-drain;
     spi-max-frequency = <10000000>;
     gpio-line-names =
       "foo",
       //...
       ;
      random_pin {
        gpio-hog;
        gpios = <6 GPIO_ACTIVE_HIGH>;
        input;
        line-name = "this hogs just one pin";
      };
   };

   gpio-bank@2 {
     compatible = "microchip,mcp23s17";
     reg = <2>;
     interrupt-parent = <&gpio1>;
     interrupts = <22 IRQ_TYPE_LEVEL_LOW>;
     interrupt-controller;
     #interrupt-cells = <2>;
     gpio-controller;
     #gpio-cells = <2>;
     microchip,irq-mirror;
     drive-open-drain;
     spi-max-frequency = <10000000>;
     gpio-line-names =
       "bar",
       //...
       ;
   };

However, I am not volunteering to do this work -- that's quite out of my league and available time.

With kind regards,
Jan
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help