|
板凳
楼主 |
发表于 2016-12-5 10:08:45
|
只看该作者
#define SABRESD_ECSPI1_CS1 IMX_GPIO_NR(2, 30) //liupeibin #define SABRESD_ECSPI1_CS1 IMX_GPIO_NR(3, 19)
#define SABRESD_ECSPI2_CS0 IMX_GPIO_NR(2, 26)
static struct spi_board_info imx6_sabresd_spi_nor_device[] __initdata = {
{
.modalias = "spidev",
.max_speed_hz = 500000, /* max spi clock (SCK) speed in HZ */
.bus_num = 0,
.chip_select = 0,
.mode = SPI_MODE_0,
},
};
static struct spi_board_info imx6_sabresd_spi_device[] __initdata = {
{
.modalias = "spidev",
.max_speed_hz = 500000, /* max spi clock (SCK) speed in HZ */
.bus_num = 1,
.chip_select = 0,
.mode = SPI_MODE_0,
},
};
static void spi_device_init(void)
{
spi_register_board_info(imx6_sabresd_spi_nor_device,
ARRAY_SIZE(imx6_sabresd_spi_nor_device));
//liupeibin 20161201
gpio_set_value(SABRESD_ECSPI1_CS1, 1);
}
static void spi2_device_init(void)
{
spi_register_board_info(imx6_sabresd_spi_device,
ARRAY_SIZE(imx6_sabresd_spi_device));
//liupeibin 20161201
gpio_set_value(SABRESD_ECSPI2_CS0, 1);
}
|
|