3

I am trying to implement an application that will allow me to access the i2c bus from the user space similar to this https://www.kernel.org/doc/Documentation/i2c/dev-interface. Here it is stated that using smbus commands is preferred over using simple i2c read /write .Could someone please help me with why is this the case.

Also to use smbus commands ,I got away with simply including these files in my header https://fossies.org/linux/i2c-tools/lib/smbus.c
and https://fossies.org/linux/i2c-tools/include/i2c/smbus.h

as SMBus functions are no longer defined in "linux/i2c-dev.h".

Reference : https://github.com/hallard/ArduiPi_OLED/issues/15.
Is there a better way of achieving this functionality ?
Also why have the SMBus methods have been removed from "linux/i2c-dev.h"

yash
  • 31
  • 3

1 Answers1

0

http://www.ti.com/lit/an/sloa132/sloa132.pdf

The biggest disadvantage of using SMBus over I2C directly is the speed, the SMBus supports only up to 100KHz and if you use the I2C directly it can do up to 2MHz.

Had the same task on RedHat, at the end I switched to I2C and all went good.

zalxov
  • 51
  • 3