The I2C subsystem manages one or more buses, with devices on those buses having 7-bit addresses. This organisation is replicated in the Device Tree for I2C. The "#address-cells = <1>;" property tells Device Tree parsing tools that subnodes there should have a one-word address, where that address appears as a "reg" property of the subnode and as the part of the name of that subnode after an "@" (although the naming part is more of a convention than an absolute requirement - uniqueness is sufficient).
When the I2C bus is registered with the framework, it walks through all of the subnodes, trying to parse them as valid declarations of I2C devices. Your overlay (apart from missing the final closing "};") defines a subnode with no "reg" property, which causes the kernel to log an error:
Code: Select all
$ dmesg -l err
[ 4.962014] i2c i2c-1: of_i2c: invalid reg on /soc/i2c@7e804000/sampledev
[ 4.962033] i2c i2c-1: Failed to create I2C device for /soc/i2c@7e804000/sampledev
Adding a "reg" property will get you further:
Code: Select all
target = <&i2c_arm>;
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
compatible = "i2c-eeprom";
reg = < 0x10 >;
(I've include the address in the node name to get you into good habits)
This will allow the I2C device parsing to succeed. You can monitor your progress by loading the overlay at runtime (not from config.txt) while monitoring udev activity.
In one window:
And in another:
The udevadm output will include the device address and compatible string. Provided your module has the correct compatible string and is registered correctly it should get as far as your probe function. At some point after that it will become important that you have a device on the bus with the expected address, most of the work has been done.