Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1381271

RE: [PATCHv2] wlcore: spi: add wl18xx support

From "Reizer, Eyal" <eyalr@ti.com>
Newsgroups linux.kernel
Subject RE: [PATCHv2] wlcore: spi: add wl18xx support
Date 2016-04-18 08:00 +0200
Message-ID <rpao1-n7-11@gated-at.bofh.it> (permalink)
References <rmi8p-1wn-3@gated-at.bofh.it> <rmi8p-1wn-1@gated-at.bofh.it> <rp3my-35m-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


> >
> > - all wilink family needs special init command for entering wspi mode.
> >   extra clock cycles should be sent after the spi init command while the
> >   cs pin is high.
> > - switch to controling the cs pin from the spi driver for achieveing the
> >   above.
> > - the selected cs gpio is read from the spi device-tree node using the
> >   cs-gpios field and setup as a gpio.
> > - See the example below for specifying the cs gpio using the cs-gpios entry
> > &spi0   {
> >         ...
> >         cs-gpios = <&gpio0 5 0>;
> >         ...
> >         wlcore: wlcore@0 {
> >                 compatible = "ti,wl1835";
> >         ...
> >         ...
> >         };
> > };
> >
> > Signed-off-by: Eyal Reizer <eyalr@ti.com>
> 
> I don't think this can work in general: not all SPI hosts uses GPIOs for
> controlling CS, so the logic can't work, and it's also a layering violation for the
> driver to look at the parent.
> 
> I would suggest fixing this using a new API function from the SPI core, if we
> don't already have a generic way to do it.
>
Originally this is what I have done until I was pointed to the generic cs-gpio mechanism 
in the SPI core. 
It is a generic mechanism already in the SPI core driver.
See: Documentation/devicetree/bindings/spi/spi-bus.txt

It is also part of the generic spi.h (include/Linux/spi/spi.h), already part of 
" struct spi_device" So it seemed redundant adding another mechanism for 
implementing the same.
Platform that interact with a wilink need to use it, and platforms that don't  
have this capability will probably not interact with a wilink device using SPI.

Best Regards,
Eyal

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCHv2] wlcore: spi: add wl18xx support Arnd Bergmann <arnd@arndb.de> - 2016-04-18 00:30 +0200
  RE: [PATCHv2] wlcore: spi: add wl18xx support "Reizer, Eyal" <eyalr@ti.com> - 2016-04-18 08:00 +0200
    Re: [PATCHv2] wlcore: spi: add wl18xx support Arnd Bergmann <arnd@arndb.de> - 2016-04-18 17:00 +0200
      RE: [PATCHv2] wlcore: spi: add wl18xx support "Reizer, Eyal" <eyalr@ti.com> - 2016-04-19 11:10 +0200
        Re: [PATCHv2] wlcore: spi: add wl18xx support Arnd Bergmann <arnd@arndb.de> - 2016-04-19 16:30 +0200
          RE: [PATCHv2] wlcore: spi: add wl18xx support "Reizer, Eyal" <eyalr@ti.com> - 2016-04-19 16:40 +0200
        Re: [PATCHv2] wlcore: spi: add wl18xx support Mark Brown <broonie@kernel.org> - 2016-04-19 19:20 +0200
          Re: [PATCHv2] wlcore: spi: add wl18xx support Mark Brown <broonie@kernel.org> - 2016-04-19 19:30 +0200
            Re: [PATCHv2] wlcore: spi: add wl18xx support Mark Brown <broonie@kernel.org> - 2016-04-19 20:00 +0200
              Re: [PATCHv2] wlcore: spi: add wl18xx support Mark Brown <broonie@kernel.org> - 2016-04-19 20:50 +0200
                RE: [PATCHv2] wlcore: spi: add wl18xx support "Reizer, Eyal" <eyalr@ti.com> - 2016-04-21 13:10 +0200
                Re: [PATCHv2] wlcore: spi: add wl18xx support Mark Brown <broonie@kernel.org> - 2016-04-21 13:20 +0200
    Re: [PATCHv2] wlcore: spi: add wl18xx support Mark Brown <broonie@kernel.org> - 2016-04-19 19:10 +0200

csiph-web