From: Chunfeng Yun Date: Mon, 23 May 2022 09:04:49 +0000 (+0800) Subject: usb: mtu3: add support controller reset X-Git-Tag: v6.1-rc5~724^2~165 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e84e3e99256e2aedab5f45f8e02bc98c891b9188;p=platform%2Fkernel%2Flinux-starfive.git usb: mtu3: add support 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 Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/20220523090449.14430-4-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/mtu3/mtu3_plat.c b/drivers/usb/mtu3/mtu3_plat.c index 4309ed9..d14494b 100644 --- a/drivers/usb/mtu3/mtu3_plat.c +++ b/drivers/usb/mtu3/mtu3_plat.c @@ -13,6 +13,7 @@ #include #include #include +#include #include "mtu3.h" #include "mtu3_dr.h" @@ -345,6 +346,12 @@ static int mtu3_probe(struct platform_device *pdev) dev_info(dev, "wakeup irq %d\n", ssusb->wakeup_irq); } + ret = device_reset_optional(dev); + if (ret) { + dev_err_probe(dev, ret, "failed to reset controller\n"); + goto comm_exit; + } + ssusb_ip_sw_reset(ssusb); if (IS_ENABLED(CONFIG_USB_MTU3_HOST))