- 论坛徽章:
- 0
|
I2C1 和 DS2460驱动
Linux 2.6.27在i2c上没有2.6.29上成熟,不能按照那一套来做,譬如在board-smartarm.c中增加:499 //static struct i2c_board_info __initdata smartarm3250_i2c_ds2460_info [] = {500 // {501 // I2C_BOARD_INFO("epc-ds2460", 0x40),502 // },503 //};
698 /* I2C based DS2460 on I2C1 */699 // i2c_register_board_info(0, smartarm3250_i2c_ds2460_info,700 // ARRAY_SIZE(smartarm3250_i2c_ds2460_info));这是行不通的。
只能来硬的,直接在i2c驱动中增加i2c器件的绑定:drivers/i2c/busses/i2c-pnx.c656 if (pdev->id == 1) { //I2C2657 struct i2c_board_info info = {658 I2C_BOARD_INFO("pcf8563", 0xa3 >> 1),659 };660 client = i2c_new_device(i2c_pnx->adapter, &info);661662 if (client == NULL) {663 printk("check pcf8563 failed \n");664 }665 }666667 if (pdev->id == 0) { //I2C1668 struct i2c_board_info info2 = {669 I2C_BOARD_INFO("ds2460", 0x80 >> 1),670 };671 client = i2c_new_device(i2c_pnx->adapter, &info2);672673 if (client == NULL) {674 printk("check ds2460 failed \n");675 }676 }
注意,这里的I2C_BOARD_INFO中的名称一定要与ds2460.c的id表中的一致,否则无法注册。
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/51797/showart_2144280.html |
|