summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDongjin Kim <tobetter@gmail.com>2019-08-22 06:21:30 +0300
committerDongjin Kim <tobetter@hardkernel.com>2019-08-23 05:33:33 +0300
commitfac4d2da0a1b61dfdeaca0034a45151ff5983fb8 (patch)
tree3a81f6346eb1b1c2d0faea4eb57f61038e4506f8
parent95264d19d04930f67f10f162df70de447659329d (diff)
downloadu-boot-odroidc2-v2015.01.tar.xz
ODROID-C2: manage OTG port to run USB host when OTG cable is attacheds905_6.0.1_v5.5s905_6.0.1_v5.4s905_6.0.1_v5.3odroidc2-v2015.01
Change-Id: I3a929c0484637b0d53f1af84586665e99aebc5a3 Signed-off-by: Dongjin Kim <tobetter@gmail.com>
-rw-r--r--board/hardkernel/odroidc2/odroidc2.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/board/hardkernel/odroidc2/odroidc2.c b/board/hardkernel/odroidc2/odroidc2.c
index aa6cb46d4d..c2c1bd26e4 100644
--- a/board/hardkernel/odroidc2/odroidc2.c
+++ b/board/hardkernel/odroidc2/odroidc2.c
@@ -553,7 +553,14 @@ int board_init(void)
gpio_direction_output(GPIO_OTG_PWREN, 0);
#if defined(CONFIG_USB_DWC_OTG_HCD)
- amlogic_usb_init(&usb_config0, BOARD_USB_MODE_SLAVE);
+ usb_peri_reg_t *peri = (usb_peri_reg_t*)PREI_USB_PHY_REG_A;
+ usb_adp_bc_data_t adp_bc;
+
+ adp_bc.d32 = peri->adp_bc;
+
+ amlogic_usb_init(&usb_config0,
+ (adp_bc.b.iddig) ? BOARD_USB_MODE_SLAVE
+ : BOARD_USB_MODE_HOST);
amlogic_usb_init(&usb_config1, BOARD_USB_MODE_HOST);
#endif