Kernel 3.7.1 and i2c_register_board_info

Started by schumi, March 19, 2013, 04:41:43 am

Previous topic - Next topic

schumi

Hello,
In previous ARM Linux projects and 2.6.x I did the following steps to use a I2c device driver in Linux ex:drivers/input/touchscreen/tsc2007.c

1)  Add to board file:
static struct i2c_board_info __initdata tsc2007_info[] = {
   {
                I2C_BOARD_INFO("tsc2007", 0x23),
                .platform_data = &tsc2007_info,
   },
};

2) then call:
  i2c_register_board_info(0, tsc2007_info,
            ARRAY_SIZE(tsc2007_info));

3) add tsc2007.c to build and tsc2007_init then tsc2007_probe is called and driver is used.


------------
So how come the same steps in imx233 3.7.1 do not work? I don't get any errors, but the tsc2007_probe does not get called. As if the i2c_register_board_info did not do what is it suppose to do...

All the examples for I2C devices I've seen for imx233 use i2c-dev to access i2c... but not i2c board info to use i2c device driver in kernel...How do I use a I2C device driver like tsc2007_probe in imx233 3.7.1 kernel?

Any help would be really appreciated.

Fadil Berisha

Quote from: schumi on March 19, 2013, 04:41:43 am
Hello,
In previous ARM Linux projects and 2.6.x I did the following steps to use a I2c device driver in Linux ex:drivers/input/touchscreen/tsc2007.c

1)  Add to board file:
static struct i2c_board_info __initdata tsc2007_info[] = {
   {
                I2C_BOARD_INFO("tsc2007", 0x23),
                .platform_data = &tsc2007_info,
   },
};

2) then call:
  i2c_register_board_info(0, tsc2007_info,
            ARRAY_SIZE(tsc2007_info));

3) add tsc2007.c to build and tsc2007_init then tsc2007_probe is called and driver is used.


------------
So how come the same steps in imx233 3.7.1 do not work? I don't get any errors, but the tsc2007_probe does not get called. As if the i2c_register_board_info did not do what is it suppose to do...

All the examples for I2C devices I've seen for imx233 use i2c-dev to access i2c... but not i2c board info to use i2c device driver in kernel...How do I use a I2C device driver like tsc2007_probe in imx233 3.7.1 kernel?

Any help would be really appreciated.

Hope you applied patch for i2c support. Please refer to README file at https://github.com/koliqi/imx23-olinuxino. After patch is applied you need to edit file imx23-olinuxino.dts and add node for your device tsc2007. You can find examples in this forum.

Fadil Berisha

schumi

Fadil, thanks for the reply. I already have i2c patch added and I2C Dev "i2cdetect -r 0" works fine. I can see my tsc2007 device on the i2c bus using i2c-dev. But I need kernel to driver boardinfo access to that driver (not i2c-dev).
So you mentioned examples/nodes on the forum, can you point me to one? Is that the new/imx233 way of doing kernel access of a i2c driver in kernel?

Thanks
Schu

schumi

Thanks. I figured it out. It is working now.

johnzhang

Could you please post the code ?

I'm having the same problem, no probe called.

Looks I2C driver is not supported by of_compatible_table declaration.

johnzhang

find out it because configured the driver to module, without loading it when start.

works out now.