Skip to content

Commit

Permalink
usb: dwc2: make otg clk optional
Browse files Browse the repository at this point in the history
Fixes commit 09a75e8
("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: Eric Anholt <eric@anholt.net>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: John Youn <johnyoun@synopsys.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Fixes: 09a75e8 ("usb: dwc2: refactor common low-level hw code to platform.c")
Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Stefan Wahren authored and Felipe Balbi committed Nov 19, 2015
1 parent 6c2dad6 commit 8aa90cf
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions drivers/usb/dwc2/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,11 @@ static int __dwc2_lowlevel_hw_enable(struct dwc2_hsotg *hsotg)
if (ret)
return ret;

ret = clk_prepare_enable(hsotg->clk);
if (ret)
return ret;
if (hsotg->clk) {
ret = clk_prepare_enable(hsotg->clk);
if (ret)
return ret;
}

if (hsotg->uphy)
ret = usb_phy_init(hsotg->uphy);
Expand Down Expand Up @@ -175,7 +177,8 @@ static int __dwc2_lowlevel_hw_disable(struct dwc2_hsotg *hsotg)
if (ret)
return ret;

clk_disable_unprepare(hsotg->clk);
if (hsotg->clk)
clk_disable_unprepare(hsotg->clk);

ret = regulator_bulk_disable(ARRAY_SIZE(hsotg->supplies),
hsotg->supplies);
Expand Down

0 comments on commit 8aa90cf

Please sign in to comment.