I have a requirement to write a Linux device driver to interface to a peripheral display board that has buttons and leds on it.
Within the driver I need to read/write over I2C to another I2C device on the peripheral board, and then send button press events up to the application code from within the driver.
I think I have managed to "simulate" key/button events up to the app using the input subsystem, and I am fairly happy with that part of the requirement.
However, I am struggling with how to go about talking over the I2C bus to the peripheral I2C device. I don't want to have to write new I2C comms routines, as I can hopefully use I2C comms APIs that already exist.
My problem is that there is lots of documentation on how to go about using I2C from an app (user space) by using i2c-dev in the kernel, but nothing that I have found useful in explaining on how to make I2C calls on a specific I2C bus, from within my own driver ( my driver making calls to the i2c driver ??).
I hope that makes sense, I've looked at lots of things on the internet but nothing that seems to explain things simply.
Any help apprciated,
Thanks