]> git.karo-electronics.de Git - karo-tx-linux.git/commit
i2c: Fall back to emulated SMBus if the operation isn't supported natively
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Tue, 24 Jul 2012 23:25:07 +0000 (09:25 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 24 Jul 2012 23:25:07 +0000 (09:25 +1000)
commitd40915f8a47270a22e92b497f624a8133ea69406
tree0a6b931104eb7cc385e40302e2362b91849b4a5b
parentd52f66b543d7492f4e69ba8da7d407daccc9521c
i2c: Fall back to emulated SMBus if the operation isn't supported natively

Adapter drivers might support only a subset of the SMBus operations
natively. Those drivers currently have to manually emulate unsupported
operations using I2C.

Make the i2c_smbus_xfer() function fall back to
i2c_smbus_xfer_emulated() when the adapter's .smbus_xfer() operation
returns -EOPNOTSUPP, like it already does when the .smbus_xfer()
operation isn't available at all.

[JD: Minor optimization.]

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
drivers/i2c/i2c-core.c