请教SPI驱动问题
SPI设备:板级信息static struct spi_board_info ek_spi_devices[] = {
#if !defined(CONFIG_MMC_AT91)
{ /* DataFlash chip */
.modalias = "mtd_dataflash",
.chip_select = 1,
.max_speed_hz = 15 * 1000 * 1000,
.bus_num = 0,
},
#if defined(CONFIG_MTD_AT91_DATAFLASH_CARD)
{ /* DataFlash card */
.modalias = "mtd_dataflash",
.chip_select = 0,
.max_speed_hz = 15 * 1000 * 1000,
.bus_num = 0,
},
#endif
#endif
#if defined(CONFIG_SND_AT73C213) || defined(CONFIG_SND_AT73C213_MODULE)
{ /* AT73C213 DAC */
.modalias = "at73c213",
.chip_select = 0,
.max_speed_hz = 10 * 1000 * 1000,
.bus_num = 1,
},
#endif
/* spi can ,add by mrz */
#if defined(CONFIG_CAN_MCP2515_MODULE) ||defined(CONFIG_CAN_MCP2515)
//defined(CONFIG_CAN_MCP2515)
{
.modalias = "mcp2515",
.chip_select = 0,
// .controller_data = AT91_PIN_PB3,
.irq = AT91_PIN_PC6, //AT91SAM9260_ID_IRQ0,
.platform_data = &mcp251x_data,
.max_speed_hz = 10 * 1000 * 1000,
.bus_num = 1,
.mode = 0,
},
/*
如果一条SPI总线, 这里SPI0上,同时挂载了2种器件,MCP2515 at73c213,如果都加载了对应的驱动,这个时候不是会造成SPI总线冲突吗? SPI0有不通的片选的 第一个flash为spi0.1 ,第二个flash为spi0.0 。你说的mcp2515 和 at73c213得通过宏配置选择,如果同时存在,你要么分配在不同的spi总线上,如spi1,或者分配在同一spi的不同片选上。
页:
[1]