To summarize the steps needed to write I2C client drivers, you need to:
- Declare device IDs supported by the driver. You can do that using i2c_device_id. If the DT is supported, use of_device_id too.
- Call MODULE_DEVICE_TABLE(i2c, my_id_table) in order to expose the driver along with its I2C device table IDs to userspace.
If the DT is supported, you must call MODULE_DEVICE_TABLE(of, your_of_match_table) in order to expose OF (device tree) related module aliases to user space. The preceding calls to MODULE_DEVICE_TABLE will export informations that will be collected by depmod to update the modules.alias file, thus allowing the driver to be automatically found and loaded if it is build as module.
- Write the probe and ...