diff options
Diffstat (limited to 'drivers/i2c/algos')
-rw-r--r-- | drivers/i2c/algos/i2c-algo-bit.c | 10 | ||||
-rw-r--r-- | drivers/i2c/algos/i2c-algo-pca.c | 2 | ||||
-rw-r--r-- | drivers/i2c/algos/i2c-algo-pcf.c | 3 |
3 files changed, 10 insertions, 5 deletions
diff --git a/drivers/i2c/algos/i2c-algo-bit.c b/drivers/i2c/algos/i2c-algo-bit.c index e25e13980af3..a39e6cff86e7 100644 --- a/drivers/i2c/algos/i2c-algo-bit.c +++ b/drivers/i2c/algos/i2c-algo-bit.c | |||
@@ -24,7 +24,6 @@ | |||
24 | #include <linux/kernel.h> | 24 | #include <linux/kernel.h> |
25 | #include <linux/module.h> | 25 | #include <linux/module.h> |
26 | #include <linux/delay.h> | 26 | #include <linux/delay.h> |
27 | #include <linux/slab.h> | ||
28 | #include <linux/init.h> | 27 | #include <linux/init.h> |
29 | #include <linux/errno.h> | 28 | #include <linux/errno.h> |
30 | #include <linux/sched.h> | 29 | #include <linux/sched.h> |
@@ -522,6 +521,12 @@ static int bit_xfer(struct i2c_adapter *i2c_adap, | |||
522 | int i, ret; | 521 | int i, ret; |
523 | unsigned short nak_ok; | 522 | unsigned short nak_ok; |
524 | 523 | ||
524 | if (adap->pre_xfer) { | ||
525 | ret = adap->pre_xfer(i2c_adap); | ||
526 | if (ret < 0) | ||
527 | return ret; | ||
528 | } | ||
529 | |||
525 | bit_dbg(3, &i2c_adap->dev, "emitting start condition\n"); | 530 | bit_dbg(3, &i2c_adap->dev, "emitting start condition\n"); |
526 | i2c_start(adap); | 531 | i2c_start(adap); |
527 | for (i = 0; i < num; i++) { | 532 | for (i = 0; i < num; i++) { |
@@ -570,6 +575,9 @@ static int bit_xfer(struct i2c_adapter *i2c_adap, | |||
570 | bailout: | 575 | bailout: |
571 | bit_dbg(3, &i2c_adap->dev, "emitting stop condition\n"); | 576 | bit_dbg(3, &i2c_adap->dev, "emitting stop condition\n"); |
572 | i2c_stop(adap); | 577 | i2c_stop(adap); |
578 | |||
579 | if (adap->post_xfer) | ||
580 | adap->post_xfer(i2c_adap); | ||
573 | return ret; | 581 | return ret; |
574 | } | 582 | } |
575 | 583 | ||
diff --git a/drivers/i2c/algos/i2c-algo-pca.c b/drivers/i2c/algos/i2c-algo-pca.c index 78d42aae0089..dcdaf8e675bf 100644 --- a/drivers/i2c/algos/i2c-algo-pca.c +++ b/drivers/i2c/algos/i2c-algo-pca.c | |||
@@ -453,8 +453,6 @@ static int pca_init(struct i2c_adapter *adap) | |||
453 | */ | 453 | */ |
454 | int raise_fall_time; | 454 | int raise_fall_time; |
455 | 455 | ||
456 | struct i2c_algo_pca_data *pca_data = adap->algo_data; | ||
457 | |||
458 | /* Ignore the reset function from the module, | 456 | /* Ignore the reset function from the module, |
459 | * we can use the parallel bus reset | 457 | * we can use the parallel bus reset |
460 | */ | 458 | */ |
diff --git a/drivers/i2c/algos/i2c-algo-pcf.c b/drivers/i2c/algos/i2c-algo-pcf.c index 7ce75775ec73..5eebf562ff31 100644 --- a/drivers/i2c/algos/i2c-algo-pcf.c +++ b/drivers/i2c/algos/i2c-algo-pcf.c | |||
@@ -29,7 +29,6 @@ | |||
29 | #include <linux/kernel.h> | 29 | #include <linux/kernel.h> |
30 | #include <linux/module.h> | 30 | #include <linux/module.h> |
31 | #include <linux/delay.h> | 31 | #include <linux/delay.h> |
32 | #include <linux/slab.h> | ||
33 | #include <linux/init.h> | 32 | #include <linux/init.h> |
34 | #include <linux/errno.h> | 33 | #include <linux/errno.h> |
35 | #include <linux/i2c.h> | 34 | #include <linux/i2c.h> |
@@ -176,7 +175,7 @@ static int pcf_init_8584 (struct i2c_algo_pcf_data *adap) | |||
176 | */ | 175 | */ |
177 | if (((temp = get_pcf(adap, 1)) & 0x7f) != (0)) { | 176 | if (((temp = get_pcf(adap, 1)) & 0x7f) != (0)) { |
178 | DEB2(printk(KERN_ERR "i2c-algo-pcf.o: PCF detection failed -- can't select S0 (0x%02x).\n", temp)); | 177 | DEB2(printk(KERN_ERR "i2c-algo-pcf.o: PCF detection failed -- can't select S0 (0x%02x).\n", temp)); |
179 | return -ENXIO; /* definetly not PCF8584 */ | 178 | return -ENXIO; /* definitely not PCF8584 */ |
180 | } | 179 | } |
181 | 180 | ||
182 | /* load own address in S0, effective address is (own << 1) */ | 181 | /* load own address in S0, effective address is (own << 1) */ |