mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-21 14:41:31 +00:00
soft_i2c: Pull SDA high before reading
Spotted by Dean Capindale. Systems that support open-drain GPIO properly are allowed provide an empty I2C_TRISTATE define. However, this means that we need to be careful not to drive SDA low when the slave is expected to respond. This patch adds a missing I2C_SDA(1) to read_byte() required to tristate the SDA line on systems that support open-drain GPIO. Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
This commit is contained in:
parent
f979690ee3
commit
110e006fe6
1 changed files with 1 additions and 0 deletions
|
@ -252,6 +252,7 @@ static uchar read_byte(int ack)
|
|||
* Read 8 bits, MSB first.
|
||||
*/
|
||||
I2C_TRISTATE;
|
||||
I2C_SDA(1);
|
||||
data = 0;
|
||||
for(j = 0; j < 8; j++) {
|
||||
I2C_SCL(0);
|
||||
|
|
Loading…
Add table
Reference in a new issue