AnsweredAssumed Answered

GPIO definition in SPI-device in device tree

Question asked by mc maddie on Jan 18, 2018
Latest reply on Jan 18, 2018 by mc maddie

We have i.MX6 based HW that has been running Yocto 2.2 and kernel 4.1.x up until now. Now I'm starting to test Yocto 2.4 with kernel 4.14 and ran to some problems that hopefully someone here could help with.

 

We have second supervisor MCU connected to i.MX6 via SPI. There is extra GPIO that MCU uses to tell for i.MX6 if it's ready to transmit data or not.

 

In Yocto 2.2 that is defined like this in device tree:

 

 

&ecspi1 {
   fsl,spi-num-chipselects = <1>;
   cs-gpios = <&gpio5 25 0>;
   pinctrl-names = "default";
   pinctrl-0 = <&pinctrl_ecspi1>;
   status = "okay";

   supervisor: ss@0 {
      #address-cells = <1>;
      #size-cells = <1>;
      compatible = "ss";
      spi-max-frequency = <1000000>;
      reg = <0>;
      rdy-gpios = <&gpio4 5 0>;

   };

};

That worked just fine and in driver I could use following line to read if the rdy-gpios is available:

 

nb = of_gpio_named_count(np, "rdy-gpios");

When I try that same driver with Yocto 2.4 and Linux 4.14 the of_gpio_named_count returns -ENOENT - error which in turn means "No such file or directory". Also this is confirmed if I look from sysfs: 

/sys/devices/soc0/soc/2000000.aips-bus/2000000.spba-bus/2008000.ecspi/of_node/ss@0

 

In older system there is rdy-gpios - listed, but it's missing from newer system.

 

Does anyone know how should it be defined in Linux 4.14? Seems that it's more of device tree issue and not so much driver.

Outcomes