1
votes

I'm having trouble talking to an i2c device in linux. The device is connected to the SMBus which normally comes up as /dev/i2c-0. My driver's init function is getting called and the driver is registered via i2c_add_driver however the driver never gets probed.

In the initialization function for my hardware board I'm calling i2c_register_board_info(n, i2c_board_info, array_size). Here n should be 0 to register the device on the SMBus, however whatever I set n to causes the SMBus to instead come up as /dev/i2c-(n + 1).

Any ideas?

1
This probably needs more specific information, but I can't immediately guess what. - XTL

1 Answers

0
votes

You should use i2c_add_numbered_adapter instead of i2c_add_adapter in your bus driver.