Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 188031
b: refs/heads/master
c: 0a9c147
h: refs/heads/master
i:
  188029: 6b3cf42
  188027: 9438bb4
  188023: 91115d2
  188015: 0381387
  187999: 4aaf7e7
  187967: 4d4a899
  187903: 163ff86
v: v3
  • Loading branch information
Jean Delvare committed Mar 13, 2010
1 parent 86457ba commit ac25f13
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d07b56b3098b9f32ae6dedeacbc594bd01dcfcd1
refs/heads/master: 0a9c14751377a1407f5e35791e13651d2fc7801c
9 changes: 9 additions & 0 deletions trunk/drivers/i2c/algos/i2c-algo-bit.c
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,12 @@ static int bit_xfer(struct i2c_adapter *i2c_adap,
int i, ret;
unsigned short nak_ok;

if (adap->pre_xfer) {
ret = adap->pre_xfer(i2c_adap);
if (ret < 0)
return ret;
}

bit_dbg(3, &i2c_adap->dev, "emitting start condition\n");
i2c_start(adap);
for (i = 0; i < num; i++) {
Expand Down Expand Up @@ -570,6 +576,9 @@ static int bit_xfer(struct i2c_adapter *i2c_adap,
bailout:
bit_dbg(3, &i2c_adap->dev, "emitting stop condition\n");
i2c_stop(adap);

if (adap->post_xfer)
adap->post_xfer(i2c_adap);
return ret;
}

Expand Down
2 changes: 2 additions & 0 deletions trunk/include/linux/i2c-algo-bit.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ struct i2c_algo_bit_data {
void (*setscl) (void *data, int state);
int (*getsda) (void *data);
int (*getscl) (void *data);
int (*pre_xfer) (struct i2c_adapter *);
void (*post_xfer) (struct i2c_adapter *);

/* local settings */
int udelay; /* half clock cycle time in us,
Expand Down

0 comments on commit ac25f13

Please sign in to comment.