[LEDE-DEV] [PATCH 2/3] ramips-mt7621: add GPIO-config for Ubiquiti-EdgeRouterX(-SFP)

Sven Roederer devel-sven at geroedel.de
Sun May 14 17:37:16 PDT 2017


On Sonntag, 14. Mai 2017 23:00:38 CEST Martin Blumenstingl wrote:
> > / {
> > 
> >         model = "UBNT-ERX-SFP";
> >         
> >         i2c-gpio {
> >         
> >                 compatible = "i2c-gpio";
> >                 gpios = <&gpio0 3 GPIO_ACTIVE_HIGH /* sda */
> >                 
> >                          &gpio0 4 GPIO_ACTIVE_HIGH /* scl */
> >                          
> >                         >;
> >                 
> >                 #address-cells = <1>;
> >                 #size-cells = <0>;
> >                 
> >                 gpio_pca: pca9555 at 25 {
> >                 
> >                         compatible = "pca9555";
> >                         reg = <0x25>;
> 
> you seem to be missing two properties here which indicate that this is
> actually a GPIO controller:
> #gpio-cells = <2>;
> gpio-controller;
> 
> value 2 in #gpio-cells means that whenever you reference a GPIO (just
> like you do in your poe_passthrough node) that the first parameter is
> the pin number and the second parameter is the polarity (active
> high/low)
> gpio-controller should be self-explanatory
> 

Martin, having dts like:

gpio_pca: pca9555 at 25 {
  compatible = "pca9555";
  #gpio-cells = <2>;
  gpio-controller;
  reg = <0x25>;
};

end up in a similar thing as before

[    1.650000] ------------[ cut here ]------------
[    1.660000] WARNING: CPU: 0 PID: 1 at drivers/gpio/gpiolib.c:85 0x801dc2fc()
[    1.680000] invalid GPIO -517
[    1.680000] Modules linked in:
[    1.690000] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.4.61 #0


Not sure if this is better then the 
"/gpio_export/poe_passthrough: could not get #gpio-cells for /i2c-gpio/pca9555 at 25" fault.





More information about the Lede-dev mailing list