[PATCH 3/3] libertas: if_spi, driver for libertas GSPI devices

Andrey Yurovsky andrey at cozybit.com
Fri Dec 19 11:31:13 EST 2008

Thanks Harald,

On Fri, Dec 19, 2008 at 8:08 AM, Harald Welte <laforge at gnumonks.org> wrote:
> Hi Colin,
> thanks a lot for your patch, it is greatly appreciated.
> Stefan Schmidt (see Cc) and myself are currently working on using a 8686
> attached t o SPI of a S3C2442 SoC.
> Let me make some comments on the actual code:
> On Mon, Dec 15, 2008 at 07:27:32PM -0800, Colin McCabe wrote:
>> +struct libertas_spi_platform_data {
>> +     u16 host_irq_num;
>> +
>> +     u16 gpio_cs;
>> +};
>> +     gpio_set_value(card->gpio_cs, 0); /* assert CS */
>> +     gpio_set_value(card->gpio_cs, 1); /* drop CS */
> Typically, in the Linux SPI framework, it is the SPI host controller
> driver that exercises the chipselect GPIO, not the client (device) driver.

The '8686 requires us to assert CS# and then hold it asserted for the
entire transaction.  The transaction is an arbitrary number of SPI
transfers.  Most host controllers cannot do this (they'll toggle CS#
between individual transactions) and therefore we chose to not use the
controller CS# line and use a GPIO.  Can you suggest a different way
to do this given the current SPI framework?

> Also, the host_irq_num is typically passed by the '.irq' member of
> spi_board_info structure, since it is board specific data (see e.g.
> arch/arm/mach-pxa/spitz.c)

The IRQ in question is a GPIO line asserted by the '8686 and it is not
otherwise an SPI line, however I see now that it should be set in
spi_board_info as you mention, we'll fix that.


More information about the libertas-dev mailing list