diff options
author | Heiko Schocher <hs@denx.de> | 2008-10-15 09:36:03 +0200 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2008-10-18 21:54:01 +0200 |
commit | 9661bf9d120f760238b2a073b84f2baf05010057 (patch) | |
tree | c6ff961aff45582a645afea25d31b5e9ef5bc84d /board/keymile/mgsuvd/mgsuvd.c | |
parent | 98aed379586a155292efbf3209356836584b601c (diff) | |
download | u-boot-imx-9661bf9d120f760238b2a073b84f2baf05010057.zip u-boot-imx-9661bf9d120f760238b2a073b84f2baf05010057.tar.gz u-boot-imx-9661bf9d120f760238b2a073b84f2baf05010057.tar.bz2 |
mgcoge, mgsuvd: add I2C support.
Signed-off-by: Heiko Schocher <hs@denx.de>
Diffstat (limited to 'board/keymile/mgsuvd/mgsuvd.c')
-rw-r--r-- | board/keymile/mgsuvd/mgsuvd.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/board/keymile/mgsuvd/mgsuvd.c b/board/keymile/mgsuvd/mgsuvd.c index c51ea7e..d78b2da 100644 --- a/board/keymile/mgsuvd/mgsuvd.c +++ b/board/keymile/mgsuvd/mgsuvd.c @@ -225,3 +225,14 @@ void ft_board_setup(void *blob, bd_t *bd) ft_blob_update(blob, bd); } #endif /* defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT) */ + +int i2c_soft_read_pin (void) +{ + int val; + + *(unsigned short *)(I2C_BASE_DIR) &= ~SDA_CONF; + udelay(1); + val = *(unsigned char *)(I2C_BASE_PORT); + + return ((val & SDA_BIT) == SDA_BIT); +} |