内核驱动
EEPROM 驱动路径:kernel/drivers/misc/eeprom/at24.c
编译文件:kernel/drivers/misc/eeprom/Makefile
先看Makefile:
obj-$(CONFIG_EEPROM_AT24) += at24.o
...
可知需要在配置文件中将 CONFIG_EEPROM_AT24 设为 y
kernel/arch/arm64/configs/***_defconfig:
CONFIG_EEPROM_AT24=y
这样,at24.c 就会被编译了。
看一下 at24.c,id_table 为:
static const struct i2c_device_id at24_ids[] = {
/* needs 8 addresses as A0-A2 are ignored */
{
"24c00", AT24_DEVICE_MAGIC(128 / 8, AT24_FLAG_TAKE8ADDR) },
/* old variants can't be handled with this generic entry! */
{
"24c01", AT24_DEVICE_MAGIC(1024 / 8, 0) },
{
"24c02", AT24_DEVICE_MAGIC(2048 / 8, 0) },
/* spd is a 24c02 in memory DIMMs */
{
"spd", AT24_DEVICE_MAGIC(2048 / 8,
AT24_FLAG_READONLY | AT24_FLAG_IRUGO) },
{
"24c04", AT24_DEVICE_MAGIC(4096 / 8, 0) },
/* 24rf08 quirk is handled at i2c-core */
{
<