summaryrefslogtreecommitdiff
path: root/board/keymile/mgsuvd/mgsuvd.c
diff options
context:
space:
mode:
Diffstat (limited to 'board/keymile/mgsuvd/mgsuvd.c')
-rw-r--r--board/keymile/mgsuvd/mgsuvd.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/board/keymile/mgsuvd/mgsuvd.c b/board/keymile/mgsuvd/mgsuvd.c
index c51ea7e76e..d78b2da653 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);
+}