>-----Original Message-----
>From: Hennerich, Michael 
>Sent: Wednesday, May 26, 2010 5:08 PM
>To: Mike Frysinger
>Cc: Song, Barry; [email protected]; 
>[email protected]
>Subject: RE: [Linux-kernel-commits] [8604] 
>trunk/drivers/spi/spi_bfin5xx.c: [#5903], limit users to use 
>gpio cs while CHPA = 0
>
>Mike Frysinger wrote on 2010-05-26:
>> On Wed, May 26, 2010 at 04:46, Hennerich, Michael wrote:
>>> Mike Frysinger wrote on 2010-05-26:
>>>> 2010/5/26 Hennerich, Michael :
>>>>> Song, Barry wrote on 2010-05-26:
>>>>>> I don't think that fits with spi spec. For spi, changing CS means
>>>>>> two different spi_message in one spi_transfer. You should use two
>>>>>> spi_message with cs_change=1 for those devices. Thanks barry
>>>>> 
>>>>> This means we can drop the bfin_spi_adc driver and remove the
>>>> autobuffer DMA hack from the SPI bus driver as well.
>>>> 
>>>> but does this address the touchscreen parts ?
>>> 
>>> Well that checkin is missing a part that addresses the boards
>>> resources. Take a look at struct spi_board_info. Every device that
>>> doesn't set .mode uses SPI_MODE_0 or explicitly
>> sets MODE2 or MODE0, and doesn't declare an GPIO SSEL is broken.
>> 
>> i still think it sucks we block what the hardware can support, but i
>> commented in the bug rather than e-mail:
>> http://blackfin.uclinux.org/gf/tracker/5903
>> 
>> to fix our resources, i think we just need to change it from 
>using the
>> pin as a peripheral CS to a GPIO ?
>> -mike
>
>Two different things:
>The DMA mode where the SPI controls the SSEL is gone.
>
>For other more typical devices the board resources can be 
>fixed with something like this:
>
>Index: arch/blackfin/mach-bf548/boards/ezkit.c
>===================================================================
>--- arch/blackfin/mach-bf548/boards/ezkit.c     (revision 8840)
>+++ arch/blackfin/mach-bf548/boards/ezkit.c     (working copy)
>@@ -1041,7 +1041,7 @@
>                .irq                    = IRQ_PB4,      /* old 
>boards (<=Rev 1.3) use IRQ_PJ11 */
>                .max_speed_hz           = 12500000,     /* max 
>spi clock (SCK) speed in HZ */
>                .bus_num                = 0,
>-               .chip_select            = 2,
>+               .chip_select            = 
>P_IDENT(P_SPI0_SSEL2) + MAX_CTRL_CS,
>                .controller_data = &spi_ad7877_chip_info,
>        },
> #endif
>@@ -1108,7 +1108,7 @@
>
> /* SPI controller data */
> static struct bfin5xx_spi_master bf54x_spi_master_info0 = {
>-       .num_chipselect = 3,
>+       .num_chipselect = MAX_CTRL_CS + MAX_BLACKFIN_GPIOS,
>        .enable_dma = 1,  /* master has the ability to do dma 
>transfer */
>        .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
> };
>@@ -1124,7 +1124,7 @@
> };
>
> static struct bfin5xx_spi_master bf54x_spi_master_info1 = {
>-       .num_chipselect = 3,
>+       .num_chipselect = MAX_CTRL_CS + MAX_BLACKFIN_GPIOS,
>        .enable_dma = 1,  /* master has the ability to do dma 
>transfer */
>        .pin_req = {P_SPI1_SCK, P_SPI1_MISO, P_SPI1_MOSI, 0},
> };
>
>However if we introduce this limitation - I see no reason why 
>we would use the SPI SSEL at all.
>We can only use GPIO controlled SSEL, this would then allow us 
>also to turn the SPI off between transfers.

Agree.

>
>
>Greetings,
>Michael
>
>Analog Devices GmbH      Wilhelm-Wagenfeld-Str. 6      80807 Muenchen
>Sitz der Gesellschaft Muenchen, Registergericht Muenchen HRB 
>4036 Geschaeftsfuehrer Thomas Wessel, William A. Martin, Margaret Seif
>
>
>


_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to