All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] trats: usb: Add usb_cable_connected() function
@ 2013-11-13 10:54 Przemyslaw Marczak
  2013-11-28  9:16 ` Przemyslaw Marczak
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Przemyslaw Marczak @ 2013-11-13 10:54 UTC (permalink / raw)
  To: u-boot

Changes:
- define function usb_cable_connected() in trats board file
  which returns 1 if cable is connected and 0 otherwise
- trats.h: add CONFIG_USB_CHECK_CABLE

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Cc: Minkyu Kang <mk7.kang@samsung.com>
---
 board/samsung/trats/trats.c |   10 ++++++++++
 include/configs/trats.h     |    1 +
 2 files changed, 11 insertions(+)

diff --git a/board/samsung/trats/trats.c b/board/samsung/trats/trats.c
index 7f61d17..9ed70d3 100644
--- a/board/samsung/trats/trats.c
+++ b/board/samsung/trats/trats.c
@@ -500,6 +500,16 @@ void board_usb_init(void)
 	debug("USB_udc_probe\n");
 	s3c_udc_probe(&s5pc210_otg_data);
 }
+
+#ifdef CONFIG_USB_CABLE_CHECK
+int usb_cable_connected(void)
+{
+	struct pmic *muic = pmic_get("MAX8997_MUIC");
+	int cable_connected = muic->chrg->chrg_type(muic);
+
+	return !!cable_connected;
+}
+#endif
 #endif
 
 static void pmic_reset(void)
diff --git a/include/configs/trats.h b/include/configs/trats.h
index 24ea06b..7f8009e 100644
--- a/include/configs/trats.h
+++ b/include/configs/trats.h
@@ -300,6 +300,7 @@
 #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
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-12-03 10:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-13 10:54 [U-Boot] [PATCH] trats: usb: Add usb_cable_connected() function Przemyslaw Marczak
2013-11-28  9:16 ` Przemyslaw Marczak
2013-12-02  2:26 ` Minkyu Kang
2013-12-02 12:54 ` [U-Boot] [PATCH v2] " Przemyslaw Marczak
2013-12-03  0:35   ` Minkyu Kang
2013-12-03 10:38     ` Przemyslaw Marczak

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.