- 积分
- 5593
贡献607
飞刀2 FD
注册时间2010-1-6
在线时间965 小时
|
发表于 2011-8-18 11:28:06
|
显示全部楼层
一般的清楚,除了需要外设芯片的驱动以外,还需要在mach-smdk6410.c中添加对spi外设的data、初始化等
static struct mcp251x_platform_data mcp251x_info = {
.oscillator_frequency = 8000000,
.board_specific_setup = NULL,
.transceiver_enable = NULL,
.power_enable = NULL,
};
static struct spi_board_info __initdata forlinx6410_mc251x_info[] = {
{
.modalias = "mcp251x", //must match with device driver id_table name
.platform_data = &mcp251x_info,
.irq = IRQ_EINT(16),
.max_speed_hz = 8000000, //maxium is 10MHz, but will lost data in my experience
.bus_num = 1,
.chip_select = 1,
.mode = SPI_MODE_0 //not required exactly since mcp251x driver will set it to SPI_MODE_0
},
};
这是一个mcp2515的例子 |
|