From: Pengcheng Li <lpc.li@hisilicon.com>
To: <johnyoun@synopsys.com>
Cc: <gregkh@linuxfoundation.org>, <linux-usb@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <xuejiancheng@hisilicon.com>,
<lidongpo@hisilicon.com>, <caizhiyong@hisilicon.com>,
Pengcheng Li <lpc.li@hisilicon.com>
Subject: [PATCH V2]usb: dwc2: Clear GUSBCFG.UsbTrdTim before setting
Date: Fri, 23 Sep 2016 20:34:56 +0800 [thread overview]
Message-ID: <1474634096-106548-1-git-send-email-lpc.li@hisilicon.com> (raw)
The USBTRDTIM field needs to be cleared before setting a new value.
Otherwise it will result in an incorrect value if phyif == GUSBCFG_PHYIF8.
Change-Id: Ib3e33cf4fd15ada41dc070ff7b93858daafbd10f
Signed-off-by: Pengcheng Li <lpc.li@hisilicon.com>
Acked-by: John Youn <johnyoun@synopsys.com>
---
drivers/usb/dwc2/gadget.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index af46adf..9e52e4f 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -2531,7 +2531,7 @@ void dwc2_hsotg_core_init_disconnected(struct dwc2_hsotg *hsotg,
/* keep other bits untouched (so e.g. forced modes are not lost) */
usbcfg = dwc2_readl(hsotg->regs + GUSBCFG);
usbcfg &= ~(GUSBCFG_TOUTCAL_MASK | GUSBCFG_PHYIF16 | GUSBCFG_SRPCAP |
- GUSBCFG_HNPCAP);
+ GUSBCFG_HNPCAP | GUSBCFG_USBTRDTIM_MASK);
/* set the PLL on, remove the HNP/SRP and set the PHY */
val = (hsotg->phyif == GUSBCFG_PHYIF8) ? 9 : 5;
@@ -3413,7 +3413,7 @@ static void dwc2_hsotg_init(struct dwc2_hsotg *hsotg)
/* keep other bits untouched (so e.g. forced modes are not lost) */
usbcfg = dwc2_readl(hsotg->regs + GUSBCFG);
usbcfg &= ~(GUSBCFG_TOUTCAL_MASK | GUSBCFG_PHYIF16 | GUSBCFG_SRPCAP |
- GUSBCFG_HNPCAP);
+ GUSBCFG_HNPCAP | GUSBCFG_USBTRDTIM_MASK);
/* set the PLL on, remove the HNP/SRP and set the PHY */
trdtim = (hsotg->phyif == GUSBCFG_PHYIF8) ? 9 : 5;
--
2.9.3
next reply other threads:[~2016-09-23 12:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-23 12:34 Pengcheng Li [this message]
2016-10-17 9:37 ` Felipe Balbi
2016-10-22 1:44 ` Lipengcheng
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=1474634096-106548-1-git-send-email-lpc.li@hisilicon.com \
--to=lpc.li@hisilicon.com \
--cc=caizhiyong@hisilicon.com \
--cc=gregkh@linuxfoundation.org \
--cc=johnyoun@synopsys.com \
--cc=lidongpo@hisilicon.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=xuejiancheng@hisilicon.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
all inboxes | Powered by JetHome®