Hi all,
I have added the latest patches and now it works!
But only if I either add an alias for tca8418 - or modprobe tca8418_keypad.
So there is still some confusion in the driver binding/matching/loading.
I tried to fgrep for tca8418 in the whole source tree - but did only find references to tca8418_keypad.
Including my device tree.
modprobe -c also only knows tca8418_keypad
But still the kernel reports:
root@gta04:~# more /sys/devices/ocp.3/4807a000.i2c/i2c-3/3-0034/name
tca8418
root@gta04:~# more /proc/device-tree/ocp/i2c\@4807a000/tca8418_keypad\@34/name
tca8418_keypad
root@gta04:~#
I don't know where the name entry in /sys/devices comes from.
So I start to think there is some hidden code to strip off the _keypad from the DT node name...
Maybe something in the i2c driver is forming the name "i2c:tca8418" *and*
stripping off the _keypad from the DT node name. This would be an unexpected strange
side-effect of choosing a driver file name with an underscore.
So I now understand why the 0006-add-tca8418_keypad-tca8418-alias.patch makes it
work as a work-around. But I don't understand why we really should need it...
Ok, after some more grepping around I found this in drivers/of/base.c:
/**
* of_modalias_node - Lookup appropriate modalias for a device node
* @node: pointer to a device tree node
* @modalias: Pointer to buffer that modalias value will be copied into
* @len: Length of modalias value
*
* Based on the value of the compatible property, this routine will attempt
* to choose an appropriate modalias value for a particular device tree node.
* It does this by stripping the manufacturer prefix (as delimited by a ',')
* from the first entry in the compatible list property.
*
* This routine returns 0 on success, <0 on failure.
*/
So this means that the module name is finally formed by
"i2c:" + second_component_of(property("compatible"))
Therefore it is indeed "i2c:tca8418" what the DT loader looks for!
And it is *not* the "name" property of the DT node which is what
I had expected in my ignorance :)
Now, since the module has a different name, we need this alias and
those people who made the driver "DT ready" did not recognise.
And I have added a comment to the device tree/driver.
Anyways, this it is a good piece of knowledge about the guts of the Linux kernel.
BR,
Nikolaus
PS: sources and kernel binary are pushed