From 2ac6985a7466a1c8a7aa8b2fa24d360925a82764 Mon Sep 17 00:00:00 2001 From: Andrew Dyer Date: Mon, 29 Dec 2008 17:36:01 -0600 Subject: soft_i2c.c add option for repeated start in i2c_read() This patch adds a #define to optionally change the behaviour of i2c_read() in soft_i2c.c to send an I2C repeated start instead of a stop-start between sending the device address pointer write and reading back the data. The current behaviour is retained as the default. While most devices will work either way, I have a smart battery(*) that requires repeated start, and someone at some point found a device that required a stop-start. (*) http://www.inspired-energy.com/Standard_Products/NL2054/NL2054%20Rev1.0%20Data%20Sheet.pdf Signed-off-by: Andrew Dyer --- README | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'README') diff --git a/README b/README index ad792d394f..afcc6714b1 100644 --- a/README +++ b/README @@ -1509,6 +1509,15 @@ The following options need to be configured: Bus on the MPC8260. But it should be not so difficult to add this option to other architectures. + CONFIG_SOFT_I2C_READ_REPEATED_START + + defining this will force the i2c_read() function in + the soft_i2c driver to perform an I2C repeated start + between writing the address pointer and reading the + data. If this define is omitted the default behaviour + of doing a stop-start sequence will be used. Most I2C + devices can use either method, but some require one or + the other. - SPI Support: CONFIG_SPI -- cgit v1.2.1