I have a i2c device which is connected to iMX6DL module, I am able to write data on it with the following command in terminal:
i2cset -y 0 0x2c 0x00 0x05
I have wrote a character driver, I want to access this device in my driver and work with it, I could not find a article to describe how to use i2c in kernel space, How should I work with i2c in kernel space?
thank you for your response, yes I saw that article and many others including some drivers.
In those articles there is a function called i2c_master_send. which I saw in all drivers used to send data to i2c bus. In this function there is a input structure called i2c_client. this structure must be filled to send data to i2c bus and device, but there is no describing or example that I could find to how to fill this structure. I assume if this structure filled correctly I am able to send data to my device on i2c0. Can you help me with i2c_client structure?