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?
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.
The probe routine specifies a physical device ID as a device node property so that the bus driver can find the appropriate device driver for this device node. Note that the device ID is bus class specific. For instance, on PCI bus, the device ID is the vendor/device IDs pair.
A probe is a single-stranded sequence of DNA or RNA used to search for its complementary sequence in a sample genome. The probe is placed into contact with the sample under conditions that allow the probe sequence to hybridize with its complementary sequence.
Kernel probes are a set of tools to collect Linux kernel debugging and performance information. Developers and system administrators usually use them either to debug the kernel, or to find system performance bottlenecks. The reported data can then be used to tune the system for better performance.
To register a character device, we need to use the register_chrdev function: int register_chrdev (unsigned int major, const char * name, const struct file_operations * fops);
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
.
Here's the call chain in your I2C case:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With