From: Felipe Balbi <balbi@kernel.org>
To: Wesley Cheng <wcheng@codeaurora.org>,
bjorn.andersson@linaro.org, kishon@ti.com, vkoul@kernel.org,
agross@kernel.org, gregkh@linuxfoundation.org,
robh+dt@kernel.org
Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org,
jackp@codeaurora.org, Wesley Cheng <wcheng@codeaurora.org>
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 [thread overview]
Message-ID: <87ft8upukf.fsf@kernel.org> (raw)
In-Reply-To: <20200731045712.28495-4-wcheng@codeaurora.org>
[-- Attachment #1: Type: text/plain, Size: 1151 bytes --]
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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
next prev parent reply other threads:[~2020-08-10 12:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-31 4:57 [PATCH 0/3] Enable USB type C support on SM8150 Wesley Cheng
2020-07-31 4:57 ` [PATCH 1/3] arm64: boot: dts: qcom: sm8150: Add nodes for PMIC based typec detection Wesley Cheng
2020-07-31 4:57 ` [PATCH 2/3] phy: qcom-qmp: Register as a typec switch for orientation detection Wesley Cheng
2020-07-31 4:57 ` [PATCH 3/3] usb: dwc3: dwc3-qcom: Find USB connector and register role switch Wesley Cheng
2020-08-10 12:13 ` Felipe Balbi [this message]
2020-08-10 20:51 ` Wesley Cheng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ft8upukf.fsf@kernel.org \
--to=balbi@kernel.org \
--cc=agross@kernel.org \
--cc=bjorn.andersson@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=jackp@codeaurora.org \
--cc=kishon@ti.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=vkoul@kernel.org \
--cc=wcheng@codeaurora.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).