trats: usb: Add usb_cable_connected() function
authorPrzemyslaw Marczak <p.marczak@samsung.com>
Mon, 2 Dec 2013 12:54:01 +0000 (13:54 +0100)
committerMinkyu Kang <mk7.kang@samsung.com>
Tue, 3 Dec 2013 00:33:59 +0000 (09:33 +0900)
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
board/samsung/trats/trats.c
include/configs/trats.h

index 7012c134fb53bb628512de02204dd7f80122aeb1..6bd106ed502d6eb4d7d923ebc37d7bd38c9c7f0b 100644 (file)
@@ -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)
index 3d080c4d1956b153a649a0c3f4cda9341c7b590f..8ff9800b195736793a324c26d6d7ea3ca5a0cc29 100644 (file)
 #define CONFIG_USB_GADGET_S3C_UDC_OTG
 #define CONFIG_USB_GADGET_DUALSPEED
 #define CONFIG_USB_GADGET_VBUS_DRAW    2
+#define CONFIG_USB_CABLE_CHECK
 
 /* LCD */
 #define CONFIG_EXYNOS_FB