Merge tag 'for-v2020.07' of https://gitlab.denx.de/u-boot/custodians/u-boot-ubi
[oweals/u-boot.git] / cmd / rockusb.c
index af81cdcd028944468ab44f277e13bbe99547ecb3..9b70c6a6aff7bf0f16c4269e98d876680bfa5d0d 100644 (file)
@@ -1,7 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright (C) 2017 Eddie Cai <eddie.cai.linux@gmail.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -9,7 +8,7 @@
 #include <console.h>
 #include <g_dnl.h>
 #include <usb.h>
-#include <asm/arch/f_rockusb.h>
+#include <asm/arch-rockchip/f_rockusb.h>
 
 static int do_rockusb(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
 {
@@ -34,7 +33,7 @@ static int do_rockusb(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
        dev_index = simple_strtoul(devnum, NULL, 0);
        rockusb_dev_init(devtype, dev_index);
 
-       ret = board_usb_init(controller_index, USB_INIT_DEVICE);
+       ret = usb_gadget_initialize(controller_index);
        if (ret) {
                printf("USB init failed: %d\n", ret);
                return CMD_RET_FAILURE;
@@ -63,7 +62,7 @@ static int do_rockusb(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
 exit:
        g_dnl_unregister();
        g_dnl_clear_detach();
-       board_usb_cleanup(controller_index, USB_INIT_DEVICE);
+       usb_gadget_release(controller_index);
 
        return ret;
 }