You can start by learning simple i2c client has already been implemented in the kernel, for example i2c DAC -
http://lxr.free-electrons.com/source/dr ... 17.c?a=arm.
Main steps:
1. Define
i2c_driver structure, which maps client ID to the probe and remove functions.
2. In the init module routine call function
i2c_add_driver with filled structure
i2c_driver.
3. If a client with given ID will be found on the bus, your probe function will be called and you will receive filled structure
i2c_client.
4. If the previous steps will be sucessfully completed you can use
i2c_master_send and
i2c_master_recv on
i2c_client to send/retrieve data.