From: "Hsin-Yi, Wang" <hsinyi@chromium.org>
To: linux-arm-kernel@lists.infradead.org
Cc: Chunfeng Yun <chunfeng.yun@mediatek.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org, linux-mediatek@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: [PATCH v4] usb/mtu3: power down device ip at setup
Date: Thu, 29 Nov 2018 11:16:27 +0800 [thread overview]
Message-ID: <20181129031627.45006-1-hsinyi@chromium.org> (raw)
In-Reply-To: <20181128095358.42498-1-hsinyi@chromium.org>
Originally, when dr_mode is USB_DR_MODE_HOST, it didn't power down device ip,
so host ip sleep will fail at ssusb_host_disable.
Power down device ip at ssusb_host_setup.
Signed-off-by: Hsin-Yi, Wang <hsinyi@chromium.org>
---
ChangeLog:
V3->V4:
*update comment
---
drivers/usb/mtu3/mtu3_plat.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/usb/mtu3/mtu3_plat.c b/drivers/usb/mtu3/mtu3_plat.c
index 46551f6d16fd..e086630e41a9 100644
--- a/drivers/usb/mtu3/mtu3_plat.c
+++ b/drivers/usb/mtu3/mtu3_plat.c
@@ -200,6 +200,14 @@ static void ssusb_ip_sw_reset(struct ssusb_mtk *ssusb)
mtu3_setbits(ssusb->ippc_base, U3D_SSUSB_IP_PW_CTRL0, SSUSB_IP_SW_RST);
udelay(1);
mtu3_clrbits(ssusb->ippc_base, U3D_SSUSB_IP_PW_CTRL0, SSUSB_IP_SW_RST);
+
+ /*
+ * device ip may be powered on in firmware/BROM stage before entering
+ * kernel stage;
+ * power down device ip, otherwise ip-sleep will fail when working as
+ * host only mode
+ */
+ mtu3_setbits(ssusb->ippc_base, U3D_SSUSB_IP_PW_CTRL2, SSUSB_IP_DEV_PDN);
}
/* ignore the error if the clock does not exist */
--
2.18.1
next prev parent reply other threads:[~2018-11-29 3:16 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-28 6:04 [PATCH] usb/mtu3: power down device ip at setup Hsin-Yi, Wang
2018-11-28 6:22 ` Chunfeng Yun
2018-11-28 6:59 ` Hsin-Yi Wang
[not found] ` <CAJMQK-joY4M-=4+XoYAC5SJUie554i_EO=7VgrkJj2JNbbDdxg@mail.gmail.com>
2018-11-28 7:02 ` Chunfeng Yun
2018-11-28 9:29 ` [V2] " Hsin-Yi, Wang
2018-11-28 9:41 ` Chunfeng Yun
2018-11-28 9:53 ` [V3] " Hsin-Yi, Wang
2018-11-29 1:20 ` Nicolas Boichat
2018-11-29 3:16 ` Hsin-Yi, Wang [this message]
2018-11-29 6:26 ` [PATCH v4] " Chunfeng Yun
2018-11-29 7:50 ` Hsin-Yi Wang
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=20181129031627.45006-1-hsinyi@chromium.org \
--to=hsinyi@chromium.org \
--cc=chunfeng.yun@mediatek.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-usb@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).