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的例子 在init函数中,还要调用
s3c64xx_spi_set_info(1,0,1);
spi_register_board_info(forlinx6410_mc251x_info,ARRAY_SIZE(forlinx6410_mc251x_info));
这些初始化和注册的函数。
页:
[1]