About libertas spi driver

Andrey Yurovsky yurovsky at gmail.com
Wed Mar 31 15:19:12 EDT 2010


On Fri, Feb 26, 2010 at 5:40 PM, Soohyung Cho <celius202 at gmail.com> wrote:
> Hello.
>
> We developed a s3c2442-based custom board and
> it has WM-G-MR-09 wireless lan chip connected with spi interface.
>
> I added spi_register_board_info to our mach-xxx.c like cm-x270.c
> and I included libertas spi modules.
>
> When the board starts, if_spi_init_module function is called but
> if_spi_probe function is never called.
>
> Do I miss something?
> Any help will be appreciated.

You need to fill out a struct of type libertas_spi_platform_data which
is then referenced in the .platform_data member of struct
spi_board_info, which in turn is passed to spi_register_board_info()
to register the device with the SPI subsystem.  The .modalias needs to
be "libertas_spi" to match up with the driver.  For example, something
like:

static struct libertas_spi_platform_data libertas_spi_pdata = {
        .use_dummy_writes       = 1,
        .gpio_cs                = 0,
};

static struct spi_board_info my_spi_chips[] = {
        {
                .modalias       = "libertas_spi",
                .mode           = SPI_MODE_0,
                .max_speed_hz   = 50000000,
                .bus_num        = 1,
                .chip_select    = 0,
                .platform_data  = &libertas_spi_pdata,
        },
};

/* and somewhere later when you register platform devices for your board */
spi_register_board_info(my_spi_chips, ARRAY_SIZE(my_spi_chips));

Please see the bottom of:
http://linuxwireless.org/en/users/Drivers/libertas for more
documentation.

  -Andrey



More information about the libertas-dev mailing list