问题描述
probe()
呼叫如何被调用?谁称呼它?根据我的理解,__init()
注册driver
,然后以某种方式调用probe()
来register
设备数据和irq
等.它是如何发生的?
How does probe()
call gets called? Who calls it? As per my understanding, __init()
registers driver
and then somehow probe()
is called to register
the device data and irq
etc. How exactly it happens?
我正在使用触摸屏驱动程序,它的__init
将自身注册到i2c driver
.然后探测期望的i2c_clien
t数据,该数据返回null.我想跟踪它的填充位置.
I am working on touchscreen driver and its __init
registers itself to i2c driver
. Then probe expect i2c_clien
t data which returns null. I want to track where it gets filled.
推荐答案
长话短说:由于为该特定总线调用register_driver
,因此调用了驱动程序的probe()函数.更准确地说,它是由该bus_type
结构的probe()
调用的.您的情况:i2c_bus_type
.
Long story short: the probe() function of the driver is called as a result of calling the register_driver
for that specific bus. More precisely, it's called by the probe()
of that bus_type
structure. In your case: i2c_bus_type
.
这是您的I2C案例中的呼叫链:
Here's the call chain in your I2C case:
- i2c_register_driver
- driver_register
- bus_add_driver
- driver_attach
- __ driver_attach(针对您的设备)
- driver_probe_device
- really_probe
- i2c_device_probe(这是用于i2c驱动程序的dev-> bus-> probe)
- 您的probe_function
这篇关于谁调用驱动程序的probe()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!