summaryrefslogtreecommitdiffstats
path: root/drivers/usb/mtu3
diff options
context:
space:
mode:
authorChunfeng Yun <chunfeng.yun@mediatek.com>2021-06-08 09:57:31 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-06-15 15:42:20 +0200
commitb057da6d549103268a1fcb54046b209309447ae8 (patch)
treea851ea8833ce3de9e7e7b672f21942e6e6c6a57e /drivers/usb/mtu3
parentusb: isp1760: Fix meaningless check in isp1763_run() (diff)
downloadlinux-b057da6d549103268a1fcb54046b209309447ae8.tar.xz
linux-b057da6d549103268a1fcb54046b209309447ae8.zip
usb: mtu3: power down device IP by default
Power down device IP by default until @udc_start is called. Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com> Link: https://lore.kernel.org/r/1623139069-8173-6-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/mtu3')
-rw-r--r--drivers/usb/mtu3/mtu3_core.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/usb/mtu3/mtu3_core.c b/drivers/usb/mtu3/mtu3_core.c
index 6b5da98de648..e306b93c007d 100644
--- a/drivers/usb/mtu3/mtu3_core.c
+++ b/drivers/usb/mtu3/mtu3_core.c
@@ -921,16 +921,15 @@ int ssusb_gadget_init(struct ssusb_mtk *ssusb)
device_init_wakeup(dev, true);
+ /* power down device IP for power saving by default */
+ mtu3_stop(mtu);
+
ret = mtu3_gadget_setup(mtu);
if (ret) {
dev_err(dev, "mtu3 gadget init failed:%d\n", ret);
goto gadget_err;
}
- /* init as host mode, power down device IP for power saving */
- if (mtu->ssusb->dr_mode == USB_DR_MODE_OTG)
- mtu3_stop(mtu);
-
ssusb_dev_debugfs_init(ssusb);
dev_dbg(dev, " %s() done...\n", __func__);