Convert to plain udevice interaction with UDC controller
device, avoid the use of UDC uclass dev_array .
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> # on khadas vim3
Signed-off-by: Marek Vasut <marex@denx.de>
{
int controller_index;
char *usb_controller;
+ struct udevice *udc;
char *endp;
int ret;
return CMD_RET_FAILURE;
}
- ret = usb_gadget_initialize(controller_index);
+ ret = udc_device_get_by_index(controller_index, &udc);
if (ret) {
pr_err("USB init failed: %d\n", ret);
return CMD_RET_FAILURE;
if (ctrlc())
break;
schedule();
- usb_gadget_handle_interrupts(controller_index);
+ dm_usb_gadget_handle_interrupts(udc);
}
ret = CMD_RET_SUCCESS;
exit:
- usb_gadget_release(controller_index);
+ udc_device_put(udc);
g_dnl_unregister();
g_dnl_clear_detach();