I2C gpio driver

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

I'm trying to get the i2c gpio driver working in order to communicate with my OV3620 cmos sensor. So far ISI works but i2c doesn't yet.

In order to talk to the OV3620 using i2c I took the tm13m3 driver and started modifying it. For now all micron tm13m3 specific i2c read/writes are disabled. The driver only initializes the reset / powerdown lines and advertises its slave address. The clock / data lines have been connected to PA7 and PA6.

The i2c-gpio driver and tm13m3 driver seem to load fine. For the i2c-gpio driver there are some entries in /sys/class/i2c-adapter/i2c-0. The tm13m3 also has some entries under /sys/bus/i2c/drivers. Further I see in dmesg that tm13m3 its attach_adapter is called when i2c-gpio is loaded and it attempts a probe. The function 'i2c_probe' returns 0 (success?). I also enabled debug messages in i2c-core but I don't see anything special happening there.

Does anyone have an idea on how to get i2c-gpio working? I forgot to mention I also registered some i2c_board_info for this device.

Thanks,
Roderick

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

After enabling debug messages in i2c-core I see that it finds my sensor (well likely because I registered in setup.c). I'm not sure where it is supposed to really probe the device and create a device file.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It seems you've got the board info correct, it should probe now (probing happens when the device and driver are both ready).

Does the tm13m3 have entries under /sys/bus/i2c/devices?

btw, 0 is a successful return code, yup.

Can you confirm if your driver is indeed being probed? A printk inside it's _probe method will do it.

What kind of device file are you looking for? Does the tm13m3 driver actually create a device file? If so, what's under /sys/class//?

-S.