summaryrefslogtreecommitdiff
path: root/board/hardkernel/odroidc2/odroidc2.c
diff options
context:
space:
mode:
Diffstat (limited to 'board/hardkernel/odroidc2/odroidc2.c')
-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