summaryrefslogtreecommitdiff
path: root/drivers/i2c/omap24xx_i2c.c
diff options
context:
space:
mode:
authorAllen Martin <amartin@nvidia.com>2012-12-19 13:02:36 -0800
committerAllen Martin <amartin@nvidia.com>2012-12-19 13:02:36 -0800
commita098cf41fdb2a6607c675f7fe4f3164617c9367e (patch)
treeb37acb36f65909e6f74cc537d73efd883a1485a6 /drivers/i2c/omap24xx_i2c.c
parentb8a7c467960ffb4d5a5e1eef5f7783fb6f594542 (diff)
parent095728803eedfce850a2f85828f79500cb09979e (diff)
downloadu-boot-imx-a098cf41fdb2a6607c675f7fe4f3164617c9367e.zip
u-boot-imx-a098cf41fdb2a6607c675f7fe4f3164617c9367e.tar.gz
u-boot-imx-a098cf41fdb2a6607c675f7fe4f3164617c9367e.tar.bz2
Merge remote-tracking branch 'u-boot/master' into u-boot-arm-merged
Conflicts: README arch/arm/cpu/armv7/exynos/clock.c board/samsung/universal_c210/universal.c drivers/misc/Makefile drivers/power/power_fsl.c include/configs/mx35pdk.h include/configs/mx53loco.h include/configs/seaboard.h
Diffstat (limited to 'drivers/i2c/omap24xx_i2c.c')
-rw-r--r--drivers/i2c/omap24xx_i2c.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/i2c/omap24xx_i2c.c b/drivers/i2c/omap24xx_i2c.c
index 094305f..af454f9 100644
--- a/drivers/i2c/omap24xx_i2c.c
+++ b/drivers/i2c/omap24xx_i2c.c
@@ -179,7 +179,8 @@ static int i2c_read_byte(u8 devaddr, u16 regoffset, u8 alen, u8 *value)
if (status & I2C_STAT_XRDY) {
w = tmpbuf[i++];
#if !(defined(CONFIG_OMAP243X) || defined(CONFIG_OMAP34XX) || \
- defined(CONFIG_OMAP44XX) || defined(CONFIG_AM33XX))
+ defined(CONFIG_OMAP44XX) || defined(CONFIG_AM33XX) || \
+ defined(CONFIG_OMAP54XX))
w |= tmpbuf[i++] << 8;
#endif
writew(w, &i2c_base->data);
@@ -209,7 +210,8 @@ static int i2c_read_byte(u8 devaddr, u16 regoffset, u8 alen, u8 *value)
}
if (status & I2C_STAT_RRDY) {
#if defined(CONFIG_OMAP243X) || defined(CONFIG_OMAP34XX) || \
- defined(CONFIG_OMAP44XX) || defined(CONFIG_AM33XX)
+ defined(CONFIG_OMAP44XX) || defined(CONFIG_AM33XX) || \
+ defined(CONFIG_OMAP54XX)
*value = readb(&i2c_base->data);
#else
*value = readw(&i2c_base->data);
@@ -239,7 +241,8 @@ static void flush_fifo(void)
stat = readw(&i2c_base->stat);
if (stat == I2C_STAT_RRDY) {
#if defined(CONFIG_OMAP243X) || defined(CONFIG_OMAP34XX) || \
- defined(CONFIG_OMAP44XX) || defined(CONFIG_AM33XX)
+ defined(CONFIG_OMAP44XX) || defined(CONFIG_AM33XX) || \
+ defined(CONFIG_OMAP54XX)
readb(&i2c_base->data);
#else
readw(&i2c_base->data);
@@ -289,7 +292,8 @@ int i2c_probe(uchar chip)
if (status & I2C_STAT_RRDY) {
res = 0;
#if defined(CONFIG_OMAP243X) || defined(CONFIG_OMAP34XX) || \
- defined(CONFIG_OMAP44XX) || defined(CONFIG_AM33XX)
+ defined(CONFIG_OMAP44XX) || defined(CONFIG_AM33XX) || \
+ defined(CONFIG_OMAP54XX)
readb(&i2c_base->data);
#else
readw(&i2c_base->data);
@@ -376,7 +380,8 @@ int i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int len)
if (status & I2C_STAT_XRDY) {
w = (i < 0) ? tmpbuf[2+i] : buffer[i];
#if !(defined(CONFIG_OMAP243X) || defined(CONFIG_OMAP34XX) || \
- defined(CONFIG_OMAP44XX) || defined(CONFIG_AM33XX))
+ defined(CONFIG_OMAP44XX) || defined(CONFIG_AM33XX) || \
+ defined(CONFIG_OMAP54XX))
w |= ((++i < 0) ? tmpbuf[2+i] : buffer[i]) << 8;
#endif
writew(w, &i2c_base->data);