Apply alvintpwang patch to fix read 24cXX issue; increase timeout on i2c_write_2b to fix write 24cXXwq issue
This commit is contained in:
parent
fd58aaae76
commit
6217cde586
1 changed files with 3 additions and 2 deletions
5
24cXX.c
5
24cXX.c
|
@ -43,7 +43,7 @@ static int i2c_write_2b(struct eeprom *e, __u8 buf[2])
|
||||||
r = i2c_smbus_write_byte_data(e->fd, buf[0], buf[1]);
|
r = i2c_smbus_write_byte_data(e->fd, buf[0], buf[1]);
|
||||||
if(r < 0)
|
if(r < 0)
|
||||||
fprintf(stderr, "Error i2c_write_2b: %s\n", strerror(errno));
|
fprintf(stderr, "Error i2c_write_2b: %s\n", strerror(errno));
|
||||||
usleep(10);
|
usleep(10000);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,7 +69,8 @@ static int i2c_write_3b(struct eeprom *e, __u8 buf[3])
|
||||||
|
|
||||||
int eeprom_open(char *dev_fqn, int addr, int type, struct eeprom* e)
|
int eeprom_open(char *dev_fqn, int addr, int type, struct eeprom* e)
|
||||||
{
|
{
|
||||||
int funcs, fd, r;
|
unsigned long funcs;
|
||||||
|
int fd, r;
|
||||||
e->fd = e->addr = 0;
|
e->fd = e->addr = 0;
|
||||||
e->dev = 0;
|
e->dev = 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue