On Wed, Nov 25, 2009 at 03:11:57PM -0700, Grant Likely wrote:
> On Wed, Nov 25, 2009 at 1:41 PM, Torsten Fleischer
> <[email protected]> wrote:
> > On Wen, Nov 25, 2009 at 01:33:57 Grant Likely wrote:
> >> Thanks.  However, there needs to be a proper description of what this
> >> patch does to go in the commit header.  Can you please write one?
> >>
> >> Thanks,
> >> g.
> >>
> > [...]
> >
> > The initialization of the chip selects is removed from the probe() function 
> > of
> > the spi_mpc8xxx driver, because the driver doesn't know the polarity of the
> > chip selects of the SPI devices at the time of its initialization.
> >
> > For this reason the initialization of the several chip selects is postponed
> > to the point of time when the very first SPI transfer to the associated 
> > device
> > occurs.
> >
> >
> > Signed-off-by: Torsten Fleischer <[email protected]>
> 
> Ah.  I understand what you're doing now.   Hmmm.  This approach
> concerns me because it relies on firmware or platform code to get CS
> gpios set up properly before the driver is probed.

Yes, that was said at the very beginning of this thread.

>  Firmware doesn't
> always get it right, and I prefer to avoid platform specific setups as
> much as possible.  Why can't the CS polarity be encoded into the
> device tree so the driver *does* have the polarity data at probe time?

We have the spi-cs-high property, but it duplicates compatible
property. 'compatible' is enough to tell whether some device has
cs-high or cs-low (device's driver knows that already).

The problem is that SPI bus master doesn't know all the devices,
so it can't extract that information from the compatible string.
To workaround that we can use 'spi-cs-high', but that's ugly
workaround.

SPI modes (0,1,2,3) is another matter, some devices can work in
several modes, so 'spi-cpol' and 'spi-cpha' are actually useful.

-- 
Anton Vorontsov
email: [email protected]
irc://irc.freenode.net/bd2

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
spi-devel-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/spi-devel-general

Reply via email to