Re: [PATCH 3/3] usb: dwc3: dwc3-qcom: Find USB connector and register role switch

From: Felipe Balbi
Date: Mon Aug 10 2020 - 08:14:05 EST



Hi,

Wesley Cheng <wcheng@xxxxxxxxxxxxxx> writes:
> @@ -190,6 +195,73 @@ static int dwc3_qcom_register_extcon(struct dwc3_qcom *qcom)
> return 0;
> }
>
> +static int dwc3_qcom_usb_role_switch_set(struct usb_role_switch *sw,
> + enum usb_role role)
> +{
> + struct dwc3_qcom *qcom = usb_role_switch_get_drvdata(sw);
> + struct fwnode_handle *child;
> + bool enable = false;
> +
> + if (!qcom->dwc3_drd_sw) {
> + child = device_get_next_child_node(qcom->dev, NULL);
> + if (child) {
> + qcom->dwc3_drd_sw = usb_role_switch_find_by_fwnode(child);
> + fwnode_handle_put(child);
> + if (IS_ERR(qcom->dwc3_drd_sw)) {
> + qcom->dwc3_drd_sw = NULL;
> + return 0;
> + }
> + }
> + }
> +
> + usb_role_switch_set_role(qcom->dwc3_drd_sw, role);

why is this done at the glue layer instead of core.c?

> + if (role == USB_ROLE_DEVICE)
> + enable = true;
> + else
> + enable = false;
> +
> + qcom->mode = (role == USB_ROLE_HOST) ? USB_DR_MODE_HOST :
> + USB_DR_MODE_PERIPHERAL;
> + dwc3_qcom_vbus_overrride_enable(qcom, enable);

could you add a patch fixing this typo?

--
balbi

Attachment: signature.asc
Description: PGP signature