Skip to content

Commit

Permalink
Merge branch 'for-linus/i2c-2638' of git://git.fluff.org/bjdooks/linux
Browse files Browse the repository at this point in the history
* 'for-linus/i2c-2638' of git://git.fluff.org/bjdooks/linux:
  i2c-bfin-twi: move setup to the earlier subsys initcall
  i2c-bfin-twi: handle faulty slave devices better
  i2c-mv64xxx: send repeated START between messages in xfer
  i2c-nomadik: fix regression on adapter name
  i2c-omap: Set latency requirements only once for several messages
  i2c-eg20t: add driver for Intel EG20T
  i2c-ocores: add some device tree documentation
  i2c-ocores: Use devres for resource allocation
  i2c-ocores: Adapt for device tree
  i2c-iop3xx: add iomem annotation
  • Loading branch information
torvalds committed Jan 13, 2011
2 parents d200560 + dad9292 commit fe3c560
Show file tree
Hide file tree
Showing 10 changed files with 1,086 additions and 61 deletions.
8 changes: 8 additions & 0 deletions drivers/i2c/busses/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,14 @@ config I2C_XILINX
This driver can also be built as a module. If so, the module
will be called xilinx_i2c.

config I2C_EG20T
tristate "PCH I2C of Intel EG20T"
depends on PCI
help
This driver is for PCH(Platform controller Hub) I2C of EG20T which
is an IOH(Input/Output Hub) for x86 embedded processor.
This driver can access PCH I2C bus device.

comment "External I2C/SMBus adapter drivers"

config I2C_PARPORT
Expand Down
1 change: 1 addition & 0 deletions drivers/i2c/busses/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ obj-$(CONFIG_I2C_STU300) += i2c-stu300.o
obj-$(CONFIG_I2C_VERSATILE) += i2c-versatile.o
obj-$(CONFIG_I2C_OCTEON) += i2c-octeon.o
obj-$(CONFIG_I2C_XILINX) += i2c-xiic.o
obj-$(CONFIG_I2C_EG20T) += i2c-eg20t.o

# External I2C/SMBus adapter drivers
obj-$(CONFIG_I2C_PARPORT) += i2c-parport.o
Expand Down
24 changes: 23 additions & 1 deletion drivers/i2c/busses/i2c-bfin-twi.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <linux/completion.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/delay.h>

#include <asm/blackfin.h>
#include <asm/portmux.h>
Expand Down Expand Up @@ -159,6 +160,27 @@ static void bfin_twi_handle_interrupt(struct bfin_twi_iface *iface,
if (mast_stat & BUFWRERR)
dev_dbg(&iface->adap.dev, "Buffer Write Error\n");

/* Faulty slave devices, may drive SDA low after a transfer
* finishes. To release the bus this code generates up to 9
* extra clocks until SDA is released.
*/

if (read_MASTER_STAT(iface) & SDASEN) {
int cnt = 9;
do {
write_MASTER_CTL(iface, SCLOVR);
udelay(6);
write_MASTER_CTL(iface, 0);
udelay(6);
} while ((read_MASTER_STAT(iface) & SDASEN) && cnt--);

write_MASTER_CTL(iface, SDAOVR | SCLOVR);
udelay(6);
write_MASTER_CTL(iface, SDAOVR);
udelay(6);
write_MASTER_CTL(iface, 0);
}

/* If it is a quick transfer, only address without data,
* not an err, return 1.
*/
Expand Down Expand Up @@ -760,7 +782,7 @@ static void __exit i2c_bfin_twi_exit(void)
platform_driver_unregister(&i2c_bfin_twi_driver);
}

module_init(i2c_bfin_twi_init);
subsys_initcall(i2c_bfin_twi_init);
module_exit(i2c_bfin_twi_exit);

MODULE_AUTHOR("Bryan Wu, Sonic Zhang");
Expand Down
Loading

0 comments on commit fe3c560

Please sign in to comment.