zl870213 发表于 2011-8-18 09:11:55

飞凌-fatfish 发表于 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的例子

飞凌-fatfish 发表于 2011-8-18 11:30:03

在init函数中,还要调用
s3c64xx_spi_set_info(1,0,1);
spi_register_board_info(forlinx6410_mc251x_info,ARRAY_SIZE(forlinx6410_mc251x_info));

这些初始化和注册的函数。
页: [1]
查看完整版本: arm外扩 AD(上操作系统)