AnsweredAssumed Answered

SabreSD SPI Driver Queries

Question asked by Shweta Kak on Feb 3, 2015
Latest reply on Feb 10, 2015 by Jaymin Dabhi

Hi All,


I have few queries related to the SPI driver on SabreSD board. I am using Ltib on kernel 3.0. I have to configure few ICs using  ECSPI1.(The SPI is same but the ICs will be selected using Chip Select pin). My queries are as follows:

1.     Should I use "spidev" for configuration? After changing .modalias in board-mx6q_sabresd.c, I was able to see spidev0.0 in the /dev file structure. But if i change .bus_num or .chip_select to value other than 0, i am not getting any spidev node in /dev. Should i be really changing it if I am using only ECSPI1 (does .bus_num = 0 correspond to ECSPI1)?

2.     How to configure the chip selects? From what i have read, I need to configure the Chip select pins as GPIO. In the board-mx6q_sabresd.c there is one configuration given as:

       #define   SABRESD_ECSPI1_CS0     IMX_GPIO_NR(4, 9)


     So, for the other two Chip Selects should it be something like:

     #define SABRESD_ECSPI1_CS2   IMX_GPIO_NR(3, 24)        //  ECSPI1_CS2 is at pad EIM_D24   

     #define SABRESD_ECSPI1_CS1   IMX_GPIO_NR(5, 9)          //  ECSPI1_CS1 is at pad DISP0_DAT15


3.  Along with the above modification I have done following changes, but still no luck:


static int mx6q_sabresd_spi_cs1[] = {




static int mx6q_sabresd_spi_cs2[] = {






static const struct spi_imx_master mx6q_sabresd_spi_data1 __initconst = {

    .chipselect     = mx6q_sabresd_spi_cs1,

    .num_chipselect = ARRAY_SIZE(mx6q_sabresd_spi_cs1),


static const struct spi_imx_master mx6q_sabresd_spi_data2 __initconst = {

    .chipselect     = mx6q_sabresd_spi_cs2,

    .num_chipselect = ARRAY_SIZE(mx6q_sabresd_spi_cs2),



static void __init mx6_sabresd_board_init(void)




     imx6q_add_ecspi(0, &mx6q_sabresd_spi_data1); 

     imx6q_add_ecspi(0, &mx6q_sabresd_spi_data2);





Still nothing. I need to know if my thinking is correct here or not? How can i configure the ICs using SPI. Is there any documentation which can be referred? Should I get different spidev (like spidev1.0, spidev1.1 etc.) to configure the different ICs.?