From: Peter Chen <peter.chen@kernel.org>
To: linux-usb@vger.kernel.org
Cc: linux-imx@nxp.com, Peter Chen <peter.chen@nxp.com>
Subject: [PATCH 3/4] usb: chipidea: pull down dp for possible charger detection operation
Date: Mon, 27 Apr 2020 17:50:38 +0800 [thread overview]
Message-ID: <20200427095039.3833-3-peter.chen@kernel.org> (raw)
In-Reply-To: <20200427095039.3833-1-peter.chen@kernel.org>
From: Peter Chen <peter.chen@nxp.com>
The bootloader may use device mode, and keep dp up. We need dp
to be pulled down before possbile charger detection operation.
Signed-off-by: Peter Chen <peter.chen@nxp.com>
---
drivers/usb/chipidea/core.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
index ea8ac4a54a8d..804c0a5a213b 100644
--- a/drivers/usb/chipidea/core.c
+++ b/drivers/usb/chipidea/core.c
@@ -1123,8 +1123,11 @@ static int ci_hdrc_probe(struct platform_device *pdev)
if (!ci_otg_is_fsm_mode(ci)) {
/* only update vbus status for peripheral */
- if (ci->role == CI_ROLE_GADGET)
+ if (ci->role == CI_ROLE_GADGET) {
+ /* Pull down DP for possible charger detection */
+ hw_write(ci, OP_USBCMD, USBCMD_RS, 0);
ci_handle_vbus_change(ci);
+ }
ret = ci_role_start(ci, ci->role);
if (ret) {
--
2.17.1
next prev parent reply other threads:[~2020-04-27 9:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-27 9:50 [PATCH 1/4] usb: chipidea: introduce CI_HDRC_CONTROLLER_VBUS_EVENT glue layer use Peter Chen
2020-04-27 9:50 ` [PATCH 2/4] usb: chipidea: introduce imx7d USB charger detection Peter Chen
2020-04-27 9:50 ` Peter Chen [this message]
2020-04-27 9:50 ` [PATCH 4/4] usb: chipidea: usbmisc_imx: using different ops for imx7d and imx7ulp Peter Chen
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=20200427095039.3833-3-peter.chen@kernel.org \
--to=peter.chen@kernel.org \
--cc=linux-imx@nxp.com \
--cc=linux-usb@vger.kernel.org \
--cc=peter.chen@nxp.com \
/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).