On Fri, Oct 22, 2010 at 03:25, Grant Likely wrote:
> On Fri, Oct 22, 2010 at 02:41:12AM -0400, Mike Frysinger wrote:
>> On Fri, Oct 22, 2010 at 02:30, Grant Likely wrote:
>> > On Fri, Oct 22, 2010 at 02:01:47AM -0400, Mike Frysinger wrote:
>> >> From: Michael Hennerich <michael.henner...@analog.com>
>> >>
>> >> The gpiolib code does not allow people to do gpio_request() on a GPIO
>> >> once it has already been requested.  So make sure we only request the
>> >> pin on the first setup of a SPI device.  Otherwise, if you attempts to
>> >> reconfigure a SPI device on the fly (like change bit sizes), the setup
>> >> function incorrectly fails.
>> >
>> > Doesn't that mean that the gpio pin be requested at device probe time
>> > instead of in a function that can be repeatedly called?
>>
>> not sure what you mean.  this is a pin specific to a spi slave device.
>>  there is no "spi probe" function for spi slave devices, only the "spi
>> setup" function.
>
> The spi master device is responsible for managing its own cs lines,
> and it should know what they are at bfin_spi_probe time.  Looking at
> commit d3cc71f7 which reworked the cs_gpio bits, I see that the
> blackfin driver places the gpio information with the slave instance.
>
> One could be argue that the spi_slave can be considered the owner of
> spi ss lines, but that runs counter to current conventions, and
> counter to how I want to implement common infrastructure for handling
> gpio slave select lines.
>
> I see that this patch is a bug fix, and the driver already implements
> bad behaviour, so I have little choice but to pick it up.  However, it
> is only a band-aid solution and in the long term it should be
> refactored to store the gpio slave-select lines with the spi_master
> device (probably after some common gpio-slave-select infrastructure is
> put in place).

i disagree.  if any GPIO at all may be used as a CS, how could the SPI
master driver have any idea at all what GPIO a slave might choose to
use ?  or who is to say that the GPIO in question is available when
the SPI bus master registers itself if the GPIO sits on a GPIO
expander board (e.g. i2c) and not the SOC ?

this is information that only the SPI client knows about and that the
slave device is binding to.  putting slave information into the master
resources makes no sense to me.
-mike

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general

Reply via email to