Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 77353
b: refs/heads/master
c: 91f2795
h: refs/heads/master
i:
  77351: b8a410b
v: v3
  • Loading branch information
Manuel Lauss authored and Jean Delvare committed Jan 27, 2008
1 parent 6992696 commit 736a9f5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4bd28ebda2d48f16c1f16ff936a6927a4ef2194d
refs/heads/master: 91f27958d686da713c3b0a1dc205288898e44124
11 changes: 8 additions & 3 deletions trunk/drivers/i2c/busses/i2c-au1550.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ wait_master_done(struct i2c_au1550_data *adap)
}

static int
do_address(struct i2c_au1550_data *adap, unsigned int addr, int rd)
do_address(struct i2c_au1550_data *adap, unsigned int addr, int rd, int q)
{
volatile psc_smb_t *sp;
u32 stat;
Expand Down Expand Up @@ -134,6 +134,10 @@ do_address(struct i2c_au1550_data *adap, unsigned int addr, int rd)
if (rd)
addr |= 1;

/* zero-byte xfers stop immediately */
if (q)
addr |= PSC_SMBTXRX_STP;

/* Put byte into fifo, start up master.
*/
sp->psc_smbtxrx = addr;
Expand All @@ -142,7 +146,7 @@ do_address(struct i2c_au1550_data *adap, unsigned int addr, int rd)
au_sync();
if (wait_ack(adap))
return -EIO;
return 0;
return (q) ? wait_master_done(adap) : 0;
}

static u32
Expand Down Expand Up @@ -262,7 +266,8 @@ au1550_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, int num)

for (i = 0; !err && i < num; i++) {
p = &msgs[i];
err = do_address(adap, p->addr, p->flags & I2C_M_RD);
err = do_address(adap, p->addr, p->flags & I2C_M_RD,
(p->len == 0));
if (err || !p->len)
continue;
if (p->flags & I2C_M_RD)
Expand Down

0 comments on commit 736a9f5

Please sign in to comment.