Messages in this thread | | | From | Felipe Balbi <> | Subject | Re: [PATCH 3/3] usb: dwc3: dwc3-qcom: Find USB connector and register role switch | Date | Mon, 10 Aug 2020 15:13:52 +0300 |
| |
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]
| |