我正在编写一个多功能内核驱动模块,基于http://lxr.free-electrons.com/source/drivers/mfd/wm8350-i2c.c?v=4.4和http://lxr.free- electrons.com/source/drivers/mfd/wm8350-core.c?v=4.4
我对如何/何时/为什么wm8350_i2c_probe()
调用该函数感到困惑。
该i2c_add_driver()
调用将 a 注册struct i2c_driver
到 i2c 子系统,并且该结构包含.probe
指向该wm8350_i2c_probe()
函数的指针。
我自己制作了这些模块的类似物。被xxx_i2c_init()
调用insmod
但 i2c 子系统不调用该xxx_i2c_probe()
函数。
这里有一些我不明白的地方。为什么 i2c 子系统不wm8350_i2c_probe()
通过 register 调用该函数.probe
?