This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

OMAP L138 : using gpio as chip select on spi

I am trying to configure an GPIO as chip select on SPI 1 interface.

I have a board that retrieve the signals from the Logic EVM and I am able to see the signals of clock, MOSI and MISO changing state when communicate with spi flash.

I have followed some topics on this forum [1] and was able to add a device that uses the spidev interface for spi.

Using that interface I am able to see the communications signals changing state, but chip select don't change state.

I found some examples [2] how to use /sys/class/gpio/ and was able to change the state to GP1[0] but after configure it as a chip select it don't make any change of state when using the device.

Any idea ?

Regards and a great 2011 :)

Aníbal

The configuration for the device :

static struct davinci_spi_platform_data da850_spi1_pdata = {
    .version     = SPI_VERSION_2,
    .num_chipselect = 2,
    .wdelay        = 0,
    .odd_parity    = 0,
    .parity_enable    = 0,
    .wait_enable    = 0,
    .timer_disable  = 0,
    .clk_internal    = 1,
    .cs_hold    = 1,
    .intr_level    = 0,
    .poll_mode    = 1,
    .use_dma    = 0,
    .c2tdelay    = 8,
    .t2cdelay    = 8,
};

[1] = {
        .modalias = "spidev",
        .mode = SPI_MODE_0,
        .max_speed_hz = 30000000,       /* max sample rate at 3V */
        .bus_num = 1,
        .chip_select = 1,
        .controller_data = (void *) 16, /* GP1[0] -> 1 x 16 + 0 = 16*/
    },

[1] - topics about spidev
* http://e2e.ti.com/support/embedded/f/354/t/74188.aspx
* http://e2e.ti.com/support/embedded/f/354/p/74188/297335.aspx

[2] - example how to use gpio class
* http://www.gumstix.net/wiki/index.php?title=GPIO

  • Using as reference a patch [1] for the hawkboard I was able to implement a spi using gpio, and then the chip select work.

    On linux-davinci git repository the davinci spi driver was rewritten, it will support this or it should work at this moment ?

     

    [1] - http://groups.google.com/group/hawkboard/browse_thread/thread/8d9ffcc0033681b9?pli=1