aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/host
diff options
context:
space:
mode:
authorGravatar Chunfeng Yun <chunfeng.yun@mediatek.com> 2022-05-23 17:04:48 +0800
committerGravatar Greg Kroah-Hartman <gregkh@linuxfoundation.org> 2022-06-10 11:50:05 +0200
commit32b615ed4b7da586eb447212e3d2665b8aa6fdb2 (patch)
treea7fd705e907fc7c4135ba9fc44c61e2a1a3a3a63 /drivers/usb/host
parentdt-bindings: usb: mtu3: add support 'resets' property (diff)
downloadlinux-32b615ed4b7da586eb447212e3d2665b8aa6fdb2.tar.gz
linux-32b615ed4b7da586eb447212e3d2665b8aa6fdb2.tar.bz2
linux-32b615ed4b7da586eb447212e3d2665b8aa6fdb2.zip
usb: xhci-mtk: add support optional controller reset
Add support controller reset via a reset-controller usually in infracfg, it's different with the software reset by IPPC which only used to reset MAC, and it will also reset IPPC meanwhile. Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com> Link: https://lore.kernel.org/r/20220523090449.14430-3-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host')
-rw-r--r--drivers/usb/host/xhci-mtk.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
index b1045f534a4b..01705e559c42 100644
--- a/drivers/usb/host/xhci-mtk.c
+++ b/drivers/usb/host/xhci-mtk.c
@@ -18,6 +18,7 @@
#include <linux/pm_wakeirq.h>
#include <linux/regmap.h>
#include <linux/regulator/consumer.h>
+#include <linux/reset.h>
#include "xhci.h"
#include "xhci-mtk.h"
@@ -550,6 +551,12 @@ static int xhci_mtk_probe(struct platform_device *pdev)
if (ret)
goto disable_ldos;
+ ret = device_reset_optional(dev);
+ if (ret) {
+ dev_err_probe(dev, ret, "failed to reset controller\n");
+ goto disable_clk;
+ }
+
hcd = usb_create_hcd(driver, dev, dev_name(dev));
if (!hcd) {
ret = -ENOMEM;