Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/shell/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux kernel 找不到i2c宏?_Linux Kernel_Driver_Linux Device Driver_I2c - Fatal编程技术网

Linux kernel 找不到i2c宏?

Linux kernel 找不到i2c宏?,linux-kernel,driver,linux-device-driver,i2c,Linux Kernel,Driver,Linux Device Driver,I2c,我正在raspPi上使用I2C驱动程序: /* register I2C device static */ static const struct i2c_board_info rasp_i2c_devices[] = { { "mbed", mbedID }, }; /* in the init function of my module */ i2c_register_board_info(0,rasp_i2c_devices,ARRAY_SIZE(rasp_i2c_devices

我正在raspPi上使用I2C驱动程序:

/* register I2C device static */
static const struct i2c_board_info rasp_i2c_devices[] = {
    { "mbed", mbedID },
};

/* in the init function of my module */
i2c_register_board_info(0,rasp_i2c_devices,ARRAY_SIZE(rasp_i2c_devices));
编译时,出现以下错误:

make[1]: Entering directory `/home/zilleplus/rasp/linux'
  Building modules, stage 2.
  MODPOST 1 modules
WARNING: "i2c_register_board_info" [/home/zilleplus/LedCube/Module/I2C/I2Crasp.ko] undefined!
-->交叉编译内核,make-j4 ARCH=arm交叉编译=${PITOOLSBIN}CONFIG\u调试\u节\u不匹配=y

我从这里到哪里去?我确实包括了
#包括

我真的不明白为什么我会犯这个错误

带小模块的粘贴箱演示问题:


响应my.config的注释部分:

CONFIG_I2C=y
CONFIG_I2C_BOARDINFO=y
CONFIG_I2C_COMPAT=y
CONFIG_I2C_CHARDEV=y
CONFIG_I2C_HELPER_AUTO=y
CONFIG_I2C_ALGOBIT=m

你启用了“配置I2C板信息”配置了吗?是的,我忘记提了,对不起,还是一样的奇怪。你的system.map有I2C板信息符号吗?。您是根据正确的内核(即KSRC path)编译的吗?我是根据正确的内核编译的,在这之前编译了helloworld和一个简单的char模块。System.map包含以下内容:c058ed5c T i2c_寄存器_板_信息显然,正在构建的ko是针对一个没有
i2c_寄存器_板_信息
的旧内核的。这很可能指向ko的build命令/makefile存在问题。