[U-Boot] [PATCH 2/2] spi: add common spi3 controller driver

Jagan Teki
2014-12-02T22:08:46Z

On 18 November 2014 at 14:28, Scott Jiang <scott.jiang.linux@gmail.com> wrote:
> 2014-11-17 3:23 GMT+08:00 Jagan Teki <jagannadh.teki@gmail.com>:
>> Hi Scott,
>>
>> On 25 September 2014 14:55, Scott Jiang <scott.jiang.linux@gmail.com> wrote:
>>> SPI3 controller is not only used on BF609 platform. So we add a common controller
>>> driver and leave machine specific configuration in board drivers.
>>> Remove obsolete spi6xx.h and select new board driver in configuration file.
>>>
>>> Signed-off-by: Scott Jiang <scott.jiang.linux@gmail.com>
>>> ---
>>> drivers/spi/Makefile | 1 +
>>> drivers/spi/adi_spi3.c | 222 ++++++++++++++++
>>
>> I think adi_spi3.c is a copy of bfin_spi6xx.c with excluded-ed stuff of bf609
>>
>> And also the difference is of chipselect and slave setup handling, why can't
>> we use same driver my making this difference stuff in particular macro.
>>
>> Please try in that sense, It's not looking good to have one driver
>> file with only
>> having chip selct handing and slave setup.
>>
>
> Would you mind moving spi_cs_is_valid() to arch/xx/include/asm/mach-xxx/spi.h?
> Because the number of spi controllers and the cs number of each controller might
> be different for different board. It use macros to do this before,
> while it's more difficult
> as boards become more.

IMHO, it's not a good idea to move the driver stuff to arc/xx/include
I do understand that
the this logic is more designed towards specific board.

Solutions on my mind:
- try to use dm
- then make a cs logic and get the attributes from the dts.

thanks!
--
Jagan.