From: Li Jun <jun.li@nxp.com>
To: <peter.chen@nxp.com>, <hzpeterchen@gmail.com>
Cc: <linux-usb@vger.kernel.org>, Li Jun <jun.li@nxp.com>,
<stable@vger.kernel.org>
Subject: [PATCH v2] usb: chipidea: udc: don't touch DP when controller is in host mode
Date: Tue, 16 Aug 2016 19:19:11 +0800 [thread overview]
Message-ID: <1471346351-20860-1-git-send-email-jun.li@nxp.com> (raw)
When the controller is configured to be dual role and it's in host mode,
if bind udc and gadgt driver, those gadget operations will do gadget
disconnect and finally pull down DP line, which will break host function.
Cc: <stable@vger.kernel.org> # 4.1+
Signed-off-by: Li Jun <jun.li@nxp.com>
---
drivers/usb/chipidea/udc.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
index 761b804..846b77bc 100644
--- a/drivers/usb/chipidea/udc.c
+++ b/drivers/usb/chipidea/udc.c
@@ -1593,8 +1593,11 @@ static int ci_udc_pullup(struct usb_gadget *_gadget, int is_on)
{
struct ci_hdrc *ci = container_of(_gadget, struct ci_hdrc, gadget);
- /* Data+ pullup controlled by OTG state machine in OTG fsm mode */
- if (ci_otg_is_fsm_mode(ci))
+ /*
+ * Data+ pullup controlled by OTG state machine in OTG fsm mode;
+ * and don't touch Data+ in host mode for dual role config.
+ */
+ if (ci_otg_is_fsm_mode(ci) || ci->role == CI_ROLE_HOST)
return 0;
pm_runtime_get_sync(&ci->gadget.dev);
--
1.9.1
reply other threads:[~2016-08-16 13:47 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1471346351-20860-1-git-send-email-jun.li@nxp.com \
--to=jun.li@nxp.com \
--cc=hzpeterchen@gmail.com \
--cc=linux-usb@vger.kernel.org \
--cc=peter.chen@nxp.com \
--cc=stable@vger.kernel.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).