Re: [PATCH 1/2 v2] spi: s3c64xx: use "cs-gpios" from spi node instead of "cs-gpio"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Tomasz,

On Tue, Jun 10, 2014 at 12:59 PM, Tomasz Figa <tomasz.figa@xxxxxxxxx> wrote:
> On 10.06.2014 21:58, Doug Anderson wrote:
>> Tomasz,
>>
>> On Tue, Jun 10, 2014 at 12:49 PM, Tomasz Figa <tomasz.figa@xxxxxxxxx> wrote:
>>> This is wrong. The "cs-gpios" property is supposed to be an array,
>>> indexed by chip select number of SPI devices (indicated by their "reg"
>>> properties).
>>>
>>> Moreover, is there a need to parse this manually in this driver? I can
>>> see respective parsing code in of_spi_register_master().
>>
>> I noticed this too (see my response), but I was confused about the
>> fact that nobody else uses the array created by
>> of_spi_register_master().  Any idea why?
>
> Hmm, I can see of_spi_register_master() assigning allocated pointer to
> master->cs_gpios, which is then used in spi_add_device() as follows:
>
>         if (master->cs_gpios)
>                 spi->cs_gpio = master->cs_gpios[spi->chip_select];

OK.  I haven't traced through all the code, but I did notice:

* spi-gpio.c: has its own cs_gpios[0], initted with of_get_named_gpio()
* spi-dw-mmio.c, spi-efm32.c, spi-imx.c, spi-pl022.c, spi-sirf.c all
seem to be looking at "cs-gpios" directly.

...but I see now that you're right that most drivers don't need to
actually look at cs_gpios and can just look at the device itself.

-Doug
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux