I am trying to update a kernel driver for Android, I have added some printk's to debug it, the _init function is invoked, but the probe function is not. What I am missing ? When/how is the probe function invoked ?
The code is available at: https://github.com/lamegopinto/kernel-2.6.32.27-M722HC/blob/master/drivers/power/rk2918_battery.c
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.
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.
The kernel calls device drivers during system initialization to determine which devices are available and to initialize those devices. System calls from user processes. The kernel calls a device driver to perform I/O operations on the device such as open(2), read(2), and ioctl(2). User-level requests.
The Linux kernel device drivers are, essentially, a shared library of privileged, memory resident, low level hardware handling routines. It is Linux's device drivers that handle the peculiarities of the devices they are managing. One of the basic features of is that it abstracts the handling of devices.
Found the answer after some research, For a "platform" device the probe function is invoked when a platform device is registered and it's device name matchs the name specified on the device driver.
More details here: http://comments.gmane.org/gmane.linux.kernel.kernelnewbies/37050
Now I just need to figure why the device is not being registered :\
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