SPI chip select problem
Johannes Stezenbach
js at sig21.net
Mon Jun 25 06:48:59 EDT 2012
On Mon, Jun 25, 2012 at 02:07:34PM +0400, Antony Pavlov wrote:
> On 25 June 2012 12:53, Johannes Stezenbach <js at sig21.net> wrote:
> > On Mon, Jun 25, 2012 at 11:45:06AM +0400, Antony Pavlov wrote:
> >>
> >> There is the 'cs_change' flag for *_spi_transfer() method, but this
> >> flag does not used at all!
> >
> > altera_spi.c and mic_spi.c use it, but often this is not needed (e.g. for
> > SPI flashes) so to keep the code simple and small it might be better
> > to not implement cs_change handling.
>
> But I have not found any common code where cs_change is managed.
It doesn't need to be handled in common code, the spi_device
driver requests a cs_change if it needs one, the spi_master driver
programs the hardware to do it. Common code in drivers/spi/spi.c
doesn't need to care. (To clarify: cs_change does not mean
to switch from one CS to another, it means to pulse the
CS line between spi_transfers of a spi_message. Some devices
need that in some cases.)
Johannes
More information about the barebox
mailing list