On 08/01/2014 08:35 PM, Mark Brown wrote:
On Fri, Aug 01, 2014 at 07:40:32PM +0300, Grygorii Strashko wrote:
quoted
From: Murali Karicheri <redacted>
Currently driver supports only configuration of GPIO CS through
platform data. This patch enhances the driver to configure GPIO
CS through DT. Also update the DT binding documentation to
reflect the availability of cs-gpios.
Ah, sorry - this is the unapplied patch from before. It would have been
much better to submit this as the second patch after your rework patch
since this...
I can do this, but It will wait for a week :(
quoted
- if (pdata->chip_sel && chip_sel < pdata->num_chipselect &&
- pdata->chip_sel[chip_sel] != SPI_INTERN_CS)
+ if (np && master->cs_gpios != NULL && spi->cs_gpio >= 0) {
+ /* SPI core parse and update master->cs_gpio */
gpio_chipsel = true;
+ gpio = spi->cs_gpio;
+ } else if (pdata->chip_sel &&
+ chip_sel < pdata->num_chipselect &&
+ pdata->chip_sel[chip_sel] != SPI_INTERN_CS) {
+ /* platform data defines chip_sel */
+ gpio_chipsel = true;
+ gpio = pdata->chip_sel[chip_sel];
+ }
...still looks excessively confusing - it is way more logic than I'd
expect to see on every chip select.
Yep. Finally, patch "[PATCH v2 2/2] spi: davinci: use spi_device.cs_gpio to store gpio cs per spi device"
simplifies logic above.
Regards,
-grygorii