I am trying to configure the kernel for initialization of the TI-ADS7828 ADC on I2C 0. I am connecting the device to the TI-LCDK running MCDK_1_01_00_02 with linux 3.3-psp03.22.00.06
I used menuconfig to include the TI-ADS7828 device driver.
I am having trouble with board initialization in arch/arm/mach-davinici/board-omapl138-lcdk.c. Is there any documentation on how to setup platform_data and how to register the board on I2C 0?
When I boot the kernel with these changes I do not have i2c-0 rgistered as /dev/i2c-0, /sys/class/i2c-adapter , or /sys/class/i2c-dev
Code that I added:
/* I2C0 PINMUX pins */
static short omapl138_i2c0_pins[] __initdata = {
DA850_I2C0_SDA, DA850_I2C0_SCL, -1
};
static struct davinci_i2c_platform_data lcdk_i2c0_adc_pdata = {
.bus_freq = 100, /* kHz */
.bus_delay = 0, /* usec */
};
static struct i2c_board_info __initdata omapl138_lcdk_i2c0_devices[] = {
// MWS added for TI 7823 ADC
{
I2C_BOARD_INFO("ads7828", 0x48),
},
};
static void omapl138_lcdk_i2c_init(void)
{
int ret;
ret = davinci_cfg_reg_list(omapl138_i2c0_pins);
if (ret) {
pr_warn("omapl138_lcdk_init: i2c0 mux setup failed: %d\n", ret);
return;
}
// Init I2C
ret = da8xx_register_i2c(0, &lcdk_i2c0_adc_pdata);
if (ret) {
pr_warning("omapl138_lcdk_init: i2c0 registration failed: %d\n", ret);
return;
}
i2c_register_board_info(0, omapl138_lcdk_i2c0_devices,
ARRAY_SIZE(omapl138_lcdk_i2c0_devices));
}