From 04938b63b9baec705a2434c969079e5ea3cb0c6e Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Thu, 6 Jun 2024 18:39:34 +0800 Subject: [PATCH] usb: dwc3: core: pipe_clk/pipe_clk depends on CONFIG_NO_GKI Fixes: ef32b29caa4e ("UPSTREAM: usb: dwc3: add optional PHY interface clocks") Signed-off-by: Tao Huang Change-Id: I9a578ce6b75463c6ed2e6197951b7bb8f034045b --- drivers/usb/dwc3/core.c | 8 ++++++++ drivers/usb/dwc3/core.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index daf94ff63898..1b38a14aed55 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -853,6 +853,7 @@ static int dwc3_clk_enable(struct dwc3 *dwc) if (ret) goto disable_ref_clk; +#ifdef CONFIG_NO_GKI ret = clk_prepare_enable(dwc->utmi_clk); if (ret) goto disable_susp_clk; @@ -860,13 +861,16 @@ static int dwc3_clk_enable(struct dwc3 *dwc) ret = clk_prepare_enable(dwc->pipe_clk); if (ret) goto disable_utmi_clk; +#endif return 0; +#ifdef CONFIG_NO_GKI disable_utmi_clk: clk_disable_unprepare(dwc->utmi_clk); disable_susp_clk: clk_disable_unprepare(dwc->susp_clk); +#endif disable_ref_clk: clk_disable_unprepare(dwc->ref_clk); disable_bus_clk: @@ -876,8 +880,10 @@ disable_bus_clk: static void dwc3_clk_disable(struct dwc3 *dwc) { +#ifdef CONFIG_NO_GKI clk_disable_unprepare(dwc->pipe_clk); clk_disable_unprepare(dwc->utmi_clk); +#endif clk_disable_unprepare(dwc->susp_clk); clk_disable_unprepare(dwc->ref_clk); clk_disable_unprepare(dwc->bus_clk); @@ -1852,6 +1858,7 @@ static int dwc3_get_clocks(struct dwc3 *dwc) } } +#ifdef CONFIG_NO_GKI /* specific to Rockchip RK3588 */ dwc->utmi_clk = devm_clk_get_optional(dev, "utmi"); if (IS_ERR(dwc->utmi_clk)) { @@ -1865,6 +1872,7 @@ static int dwc3_get_clocks(struct dwc3 *dwc) return dev_err_probe(dev, PTR_ERR(dwc->pipe_clk), "could not get pipe clock\n"); } +#endif return 0; } diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index 9a6086d84dd2..f4f7cf88105f 100644 --- a/drivers/usb/dwc3/core.h +++ b/drivers/usb/dwc3/core.h @@ -1179,8 +1179,10 @@ struct dwc3 { struct clk *bus_clk; struct clk *ref_clk; struct clk *susp_clk; +#ifdef CONFIG_NO_GKI struct clk *utmi_clk; struct clk *pipe_clk; +#endif struct reset_control *reset;