summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorHeiko Schocher <hs@denx.de>2008-10-17 13:52:51 +0200
committerWolfgang Denk <wd@denx.de>2008-10-18 21:54:04 +0200
commita21ca95f8b9dca22714952b348e4905ac157b5cd (patch)
tree2d1fa9efebc62a32d80d1b79c2783df4d6c75191 /include
parentcac9cf7875c2a01d63422820ed4732a9bdf5ab7b (diff)
downloadu-boot-imx-a21ca95f8b9dca22714952b348e4905ac157b5cd.zip
u-boot-imx-a21ca95f8b9dca22714952b348e4905ac157b5cd.tar.gz
u-boot-imx-a21ca95f8b9dca22714952b348e4905ac157b5cd.tar.bz2
mgsuvd: fix compiler warning when using soft_i2c driver
Signed-off-by: Heiko Schocher <hs@denx.de>
Diffstat (limited to 'include')
-rw-r--r--include/configs/mgsuvd.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/include/configs/mgsuvd.h b/include/configs/mgsuvd.h
index 416e4db..1604285 100644
--- a/include/configs/mgsuvd.h
+++ b/include/configs/mgsuvd.h
@@ -346,8 +346,8 @@
/*
* Software (bit-bang) I2C driver configuration
*/
-#define I2C_BASE_DIR (CONFIG_SYS_PIGGY_BASE + 0x04)
-#define I2C_BASE_PORT (CONFIG_SYS_PIGGY_BASE + 0x09)
+#define I2C_BASE_DIR ((u16 *)(CONFIG_SYS_PIGGY_BASE + 0x04))
+#define I2C_BASE_PORT ((u8 *)(CONFIG_SYS_PIGGY_BASE + 0x09))
#define SDA_BIT 0x40
#define SCL_BIT 0x80
@@ -356,18 +356,18 @@
#define I2C_ACTIVE do {} while (0)
#define I2C_TRISTATE do {} while (0)
-#define I2C_READ i2c_soft_read_pin ()
+#define I2C_READ ((in_8(I2C_BASE_PORT) & SDA_BIT) == SDA_BIT)
#define I2C_SDA(bit) if(bit) { \
- *(unsigned short *)(I2C_BASE_DIR) &= ~SDA_CONF; \
+ clrbits(be16, I2C_BASE_DIR, SDA_CONF); \
} else { \
- *(unsigned char *)(I2C_BASE_PORT) &= ~SDA_BIT; \
- *(unsigned short *)(I2C_BASE_DIR) |= SDA_CONF; \
+ clrbits(8, I2C_BASE_PORT, SDA_BIT); \
+ setbits(be16, I2C_BASE_DIR, SDA_CONF); \
}
#define I2C_SCL(bit) if(bit) { \
- *(unsigned short *)(I2C_BASE_DIR) &= ~SCL_CONF; \
+ clrbits(be16, I2C_BASE_DIR, SCL_CONF); \
} else { \
- *(unsigned char *)(I2C_BASE_PORT) &= ~SCL_BIT; \
- *(unsigned short *)(I2C_BASE_DIR) |= SCL_CONF; \
+ clrbits(8, I2C_BASE_PORT, SCL_BIT); \
+ setbits(be16, I2C_BASE_DIR, SCL_CONF); \
}
#define I2C_DELAY udelay(50) /* 1/4 I2C clock duration */