enable spi (mars board )

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

enable spi (mars board )

790件の閲覧回数
hamzadardour
Contributor II

Hi everyone,

I would like enable spi for user space, because I don't find spix.x in /dev.

I enter the command ( modprobe spidev ) and it works ( verefied with lsmod ).

I found in some forums that I have to change the code of the  file ( board-mx6q_marsboard.c )  to add spi for user space, but I don't know the gpio that I can use for the Cselect , this is the  part of the code that could enable the spi ,

( the code between starts is what I had added )

could you help me please ,

/* start

#define MX6Q_MARSBOARD_ECSPI1_CS0  IMX_GPIO_NR(2, 30)
#define MX6Q_MARSBOARD_ECSPI2_CS0  IMX_GPIO_NR(2, 27)
#define MX6Q_MARSBOARD_ECSPI3_CS0  IMX_GPIO_NR(**, **)   ( I don't know gpios number

static int mx6q_marsboard_spi0_cs[] = {

        MX6Q_MARSBOARD_ECSPI1_CS0,

};

static const struct spi_imx_master mx6q_marsboard_spi0_data __initconst = {

        .chipselect     = mx6q_marsboard_spi0_cs,

        .num_chipselect = ARRAY_SIZE(mx6q_marsboard_spi0_cs),

};

static int mx6q_marsboard_spi1_cs[] = {

        MX6Q_MARSBOARD_ECSPI2_CS0,

};

static const struct spi_imx_master mx6q_marsboard_spi1_data __initconst = {

        .chipselect     = mx6q_marsboard_spi1_cs,

        .num_chipselect = ARRAY_SIZE(mx6q_marsboard_spi1_cs),

};

//********************************** my code 1

static int mx6q_marsboard_spi2_cs[] = {

        MX6Q_MARSBOARD_ECSPI3_CS0,

};

static const struct spi_imx_master mx6q_marsboard_spi2_data __initconst = {

        .chipselect     = mx6q_marsboard_spi2_cs,

        .num_chipselect = ARRAY_SIZE(mx6q_marsboard_spi2_cs),

};

//***************************** end of my code 1

static struct spi_board_info imx6_marsboard_spi_devices[] __initdata = {

#if defined(CONFIG_MTD_M25P80)

    {

        .modalias = "m25p80",

        .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */

        .bus_num = 0,

        .chip_select = 0,

        .platform_data = &imx6_marsboard__spi_flash_data,

    },

#endif

        {

                .modalias = "ads7846",

                .bus_num = 1,

                .chip_select = 0,

                .max_speed_hz = 1500000,

                .irq = gpio_to_irq(MX6Q_MARSBOARD_RES_TCH_INT),

                .platform_data = &ads7846_config,

        },

//***************** my code 2

    {

        .modalias = "spidev",

        .max_speed_hz = 48000000, //48 Mbps

        .bus_num = 2,

        .chip_select = 0,

        .mode = 0,

    },

//****************** end of my code 2

};

*/ end

ラベル(1)
0 件の賞賛
返信
0 返答(返信)