Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Chunfeng Yun and committed by
Greg Kroah-Hartman
32b615ed 0efcd085

+7
+7
drivers/usb/host/xhci-mtk.c
··· 18 18 #include <linux/pm_wakeirq.h> 19 19 #include <linux/regmap.h> 20 20 #include <linux/regulator/consumer.h> 21 + #include <linux/reset.h> 21 22 22 23 #include "xhci.h" 23 24 #include "xhci-mtk.h" ··· 550 549 ret = clk_bulk_prepare_enable(BULK_CLKS_NUM, mtk->clks); 551 550 if (ret) 552 551 goto disable_ldos; 552 + 553 + ret = device_reset_optional(dev); 554 + if (ret) { 555 + dev_err_probe(dev, ret, "failed to reset controller\n"); 556 + goto disable_clk; 557 + } 553 558 554 559 hcd = usb_create_hcd(driver, dev, dev_name(dev)); 555 560 if (!hcd) {