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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <jan.kundrat@xxxxxxxxx> wrote:

+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




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux