On Wednesday 23 July 2008, hartleys wrote:
> On Wednesday, July 23, 2008 David Brownell wrote:
> >> This patch makes the at25 driver call spi_setup before any read/write
> 
> >> access to the eeprom to insure that the device mode and clock is set 
> >> correctly.
> >
> > Why would this be needed though?  It was called before probe(), and
> > nothing changed the setup ... so it should still be valid.
> 
> With multiple slaves another driver could change the clock.

No it can't.  If you're seeing that behavior, it's a bug in your
SPI controller driver ... it's not properly keeping track of
the device settings.  The spi_setup() call only changes records
of settings for that device; those settings become active the
next time I/O is performed to that device.  The controllers often
have per-chipselect registers with settings for speed, mode, word
size, and so forth.  If they don't have such registers, they need
to emulate having them.

Also, note that your patch wouldn't actually work around that
controller driver bug.  A driver for a different SPI device
could issue requests between the spi_setup() you added and
the I/O calls ...

- Dave


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
spi-devel-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/spi-devel-general

Reply via email to