From 0938f5b275702107c736e05e377dd1045a8cba27 Mon Sep 17 00:00:00 2001
From: Przemyslaw Marczak
Date: Mon, 2 Dec 2013 13:54:01 +0100
Subject: trats: usb: Add usb_cable_connected() function
Signed-off-by: Przemyslaw Marczak
Signed-off-by: Minkyu Kang
---
board/samsung/trats/trats.c | 11 +++++++++++
1 file changed, 11 insertions(+)
(limited to 'board/samsung/trats')
diff --git a/board/samsung/trats/trats.c b/board/samsung/trats/trats.c
index 7012c134fb..6bd106ed50 100644
--- a/board/samsung/trats/trats.c
+++ b/board/samsung/trats/trats.c
@@ -501,6 +501,17 @@ int board_usb_init(int index, enum usb_init_type init)
debug("USB_udc_probe\n");
return s3c_udc_probe(&s5pc210_otg_data);
}
+
+#ifdef CONFIG_USB_CABLE_CHECK
+int usb_cable_connected(void)
+{
+ struct pmic *muic = pmic_get("MAX8997_MUIC");
+ if (!muic)
+ return 0;
+
+ return !!muic->chrg->chrg_type(muic);
+}
+#endif
#endif
static void pmic_reset(void)
--
cgit v1.2.1