I have wrote a character driver to control my embedded hardware with my application, In my driver there is a feature to send a command to an I2C device which is connected to my embedded device.
in command line I am able to send the following code to my device:
i2cset -y 0 0x2c 0x00 0x05
I want to do same thing in kernel space within my driver, but I did not find a sample, all I got was in userspace, how can I do that in kernel space?
edit:
I know that with "i2c_master_send" or "i2c_smbus_read_byte" function I can send data to i2c devices, bu this function gets a structure called "i2c_client", I don't know how should I suppose to fill this structure to send data. It might be really silly but I could not figure it out how can I fill this structure.