This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

add i2c device to android SDK of am335x

Hi everyone,

I want to add my i2c device driver into the android SDK(i downloaded  it here:

 downloads.ti.com/.../TI_Android_JB_4.2.2_DevKit_4.1.1.bin)

the kerel version is 3.2.0 , is kernel/arch/arm/mach-omap2/board-am335xevm.c the right file that i need to modify?

  • Moving this to the Android forum.

  • Hi Jun,

    Adding support for a device on Android usually requires 2 steps:
    1) port the device driver into the kernel
    2) Add the HAL to interface the driver with Android framework

    the second step can be bypassed by doing JNI directly from the JAVA application, even thought this is not the recommended architecture for security reasons.

    The first step requires you to enable the driver in the kernel configuration (and develop it if it doesn't exist), then declare the device in the board file that you pointed since your kernel doesn't rely on the device tree: kernel/arch/arm/mach-omap2/board-am335xevm.c

    Adding the device is done this way:
    identify which i2c bus you are connected to and create a new struct i2c_board_info (at least i2c address and driver name), then register it on your i2c bus using the i2c_new_device function.