lkml.org 
[lkml]   [2020]   [Aug]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 3/3] usb: dwc3: dwc3-qcom: Find USB connector and register role switch
Date

Hi,

Wesley Cheng <wcheng@codeaurora.org> 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
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2020-08-10 14:14    [W:3.171 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site