mgsuvd: fix compiler warning when using soft_i2c driver
Signed-off-by: Heiko Schocher <hs@denx.de>
This commit is contained in:
parent
cac9cf7875
commit
a21ca95f8b
@ -34,6 +34,7 @@
|
|||||||
#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
|
#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
|
||||||
#include <i2c.h>
|
#include <i2c.h>
|
||||||
#endif
|
#endif
|
||||||
|
#include <asm/io.h>
|
||||||
|
|
||||||
extern int i2c_soft_read_pin (void);
|
extern int i2c_soft_read_pin (void);
|
||||||
|
|
||||||
@ -400,7 +401,7 @@ static void set_scl (int state)
|
|||||||
|
|
||||||
static int get_sda (void)
|
static int get_sda (void)
|
||||||
{
|
{
|
||||||
return i2c_soft_read_pin ();
|
return I2C_READ;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int get_scl (void)
|
static int get_scl (void)
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#include <common.h>
|
#include <common.h>
|
||||||
#ifdef CONFIG_MPC8260 /* only valid for MPC8260 */
|
#ifdef CONFIG_MPC8260 /* only valid for MPC8260 */
|
||||||
#include <ioports.h>
|
#include <ioports.h>
|
||||||
|
#include <asm/io.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_AT91RM9200 /* need this for the at91rm9200 */
|
#ifdef CONFIG_AT91RM9200 /* need this for the at91rm9200 */
|
||||||
#include <asm/io.h>
|
#include <asm/io.h>
|
||||||
@ -39,6 +40,9 @@
|
|||||||
#ifdef CONFIG_LPC2292
|
#ifdef CONFIG_LPC2292
|
||||||
#include <asm/arch/hardware.h>
|
#include <asm/arch/hardware.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef CONFIG_MPC866 /* only valid for MPC866 */
|
||||||
|
#include <asm/io.h>
|
||||||
|
#endif
|
||||||
#include <i2c.h>
|
#include <i2c.h>
|
||||||
|
|
||||||
/* #define DEBUG_I2C */
|
/* #define DEBUG_I2C */
|
||||||
|
@ -346,8 +346,8 @@
|
|||||||
/*
|
/*
|
||||||
* Software (bit-bang) I2C driver configuration
|
* Software (bit-bang) I2C driver configuration
|
||||||
*/
|
*/
|
||||||
#define I2C_BASE_DIR (CONFIG_SYS_PIGGY_BASE + 0x04)
|
#define I2C_BASE_DIR ((u16 *)(CONFIG_SYS_PIGGY_BASE + 0x04))
|
||||||
#define I2C_BASE_PORT (CONFIG_SYS_PIGGY_BASE + 0x09)
|
#define I2C_BASE_PORT ((u8 *)(CONFIG_SYS_PIGGY_BASE + 0x09))
|
||||||
|
|
||||||
#define SDA_BIT 0x40
|
#define SDA_BIT 0x40
|
||||||
#define SCL_BIT 0x80
|
#define SCL_BIT 0x80
|
||||||
@ -356,18 +356,18 @@
|
|||||||
|
|
||||||
#define I2C_ACTIVE do {} while (0)
|
#define I2C_ACTIVE do {} while (0)
|
||||||
#define I2C_TRISTATE 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) { \
|
#define I2C_SDA(bit) if(bit) { \
|
||||||
*(unsigned short *)(I2C_BASE_DIR) &= ~SDA_CONF; \
|
clrbits(be16, I2C_BASE_DIR, SDA_CONF); \
|
||||||
} else { \
|
} else { \
|
||||||
*(unsigned char *)(I2C_BASE_PORT) &= ~SDA_BIT; \
|
clrbits(8, I2C_BASE_PORT, SDA_BIT); \
|
||||||
*(unsigned short *)(I2C_BASE_DIR) |= SDA_CONF; \
|
setbits(be16, I2C_BASE_DIR, SDA_CONF); \
|
||||||
}
|
}
|
||||||
#define I2C_SCL(bit) if(bit) { \
|
#define I2C_SCL(bit) if(bit) { \
|
||||||
*(unsigned short *)(I2C_BASE_DIR) &= ~SCL_CONF; \
|
clrbits(be16, I2C_BASE_DIR, SCL_CONF); \
|
||||||
} else { \
|
} else { \
|
||||||
*(unsigned char *)(I2C_BASE_PORT) &= ~SCL_BIT; \
|
clrbits(8, I2C_BASE_PORT, SCL_BIT); \
|
||||||
*(unsigned short *)(I2C_BASE_DIR) |= SCL_CONF; \
|
setbits(be16, I2C_BASE_DIR, SCL_CONF); \
|
||||||
}
|
}
|
||||||
#define I2C_DELAY udelay(50) /* 1/4 I2C clock duration */
|
#define I2C_DELAY udelay(50) /* 1/4 I2C clock duration */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user