diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-14 14:13:04 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-14 14:13:04 -0400 |
commit | bced86359918326a65258b1be245834e5c493c88 (patch) | |
tree | 72566bf1beefd3e1cc267e2dd5cc3188ab87b836 /drivers/i2c/algos/i2c-algo-bit.c | |
parent | ceb804cd0f63b0e0a87b81913b66add6de03043d (diff) | |
parent | 0a9c14751377a1407f5e35791e13651d2fc7801c (diff) |
Merge branch 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging
* 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
i2c-algo-bit: Add pre- and post-xfer hooks
at24: Init dynamic bin_attribute structures
i2c: Drop configure option I2C_DEBUG_CHIP
tsl2550: Move from i2c/chips to misc
i2c-i801: Don't use the block buffer for I2C block writes
i2c-powermac: Be less verbose in the absence of real errors.
i2c-smbus: Use device_lock/device_unlock
Diffstat (limited to 'drivers/i2c/algos/i2c-algo-bit.c')
-rw-r--r-- | drivers/i2c/algos/i2c-algo-bit.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/i2c/algos/i2c-algo-bit.c b/drivers/i2c/algos/i2c-algo-bit.c index e25e13980af3..e8d568c3fb09 100644 --- a/drivers/i2c/algos/i2c-algo-bit.c +++ b/drivers/i2c/algos/i2c-algo-bit.c | |||
@@ -522,6 +522,12 @@ static int bit_xfer(struct i2c_adapter *i2c_adap, | |||
522 | int i, ret; | 522 | int i, ret; |
523 | unsigned short nak_ok; | 523 | unsigned short nak_ok; |
524 | 524 | ||
525 | if (adap->pre_xfer) { | ||
526 | ret = adap->pre_xfer(i2c_adap); | ||
527 | if (ret < 0) | ||
528 | return ret; | ||
529 | } | ||
530 | |||
525 | bit_dbg(3, &i2c_adap->dev, "emitting start condition\n"); | 531 | bit_dbg(3, &i2c_adap->dev, "emitting start condition\n"); |
526 | i2c_start(adap); | 532 | i2c_start(adap); |
527 | for (i = 0; i < num; i++) { | 533 | for (i = 0; i < num; i++) { |
@@ -570,6 +576,9 @@ static int bit_xfer(struct i2c_adapter *i2c_adap, | |||
570 | bailout: | 576 | bailout: |
571 | bit_dbg(3, &i2c_adap->dev, "emitting stop condition\n"); | 577 | bit_dbg(3, &i2c_adap->dev, "emitting stop condition\n"); |
572 | i2c_stop(adap); | 578 | i2c_stop(adap); |
579 | |||
580 | if (adap->post_xfer) | ||
581 | adap->post_xfer(i2c_adap); | ||
573 | return ret; | 582 | return ret; |
574 | } | 583 | } |
575 | 584 | ||