提交 8aa90cf2 编写于 作者: S Stefan Wahren 提交者: Felipe Balbi

usb: dwc2: make otg clk optional

Fixes commit 09a75e85
("usb: dwc2: refactor common low-level hw code to platform.c")

The above commit consolidated the low-level phy access into a common
location. This change made the otg clk a requirement and broke some
platforms when it was moved into platform.c.

So make clk handling optional again.
Acked-by: NEric Anholt <eric@anholt.net>
Signed-off-by: NStefan Wahren <stefan.wahren@i2se.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: NJohn Youn <johnyoun@synopsys.com>
Tested-by: NMarek Szyprowski <m.szyprowski@samsung.com>
Fixes: 09a75e85 ("usb: dwc2: refactor common low-level hw code to platform.c")
Signed-off-by: NFelipe Balbi <balbi@ti.com>
上级 6c2dad69
...@@ -125,9 +125,11 @@ static int __dwc2_lowlevel_hw_enable(struct dwc2_hsotg *hsotg) ...@@ -125,9 +125,11 @@ static int __dwc2_lowlevel_hw_enable(struct dwc2_hsotg *hsotg)
if (ret) if (ret)
return ret; return ret;
ret = clk_prepare_enable(hsotg->clk); if (hsotg->clk) {
if (ret) ret = clk_prepare_enable(hsotg->clk);
return ret; if (ret)
return ret;
}
if (hsotg->uphy) if (hsotg->uphy)
ret = usb_phy_init(hsotg->uphy); ret = usb_phy_init(hsotg->uphy);
...@@ -175,7 +177,8 @@ static int __dwc2_lowlevel_hw_disable(struct dwc2_hsotg *hsotg) ...@@ -175,7 +177,8 @@ static int __dwc2_lowlevel_hw_disable(struct dwc2_hsotg *hsotg)
if (ret) if (ret)
return ret; return ret;
clk_disable_unprepare(hsotg->clk); if (hsotg->clk)
clk_disable_unprepare(hsotg->clk);
ret = regulator_bulk_disable(ARRAY_SIZE(hsotg->supplies), ret = regulator_bulk_disable(ARRAY_SIZE(hsotg->supplies),
hsotg->supplies); hsotg->supplies);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册