1 From ece5ffd9e15e9c8471e58b581a098032a679d34e Mon Sep 17 00:00:00 2001
2 From: Al Cooper <alcooperx@gmail.com>
3 Date: Fri, 3 Jan 2020 13:18:00 -0500
4 Subject: [PATCH] phy: usb: Get all drivers that use USB clks using correct
7 The BRCM USB Phy, ohci, ehci and xhci drivers all use the USB clocks
8 but not all drivers use the clk_prepare_enable/clk_disable_unprepare
9 versions to enable/disable the clocks. This change gets all drivers
10 using the prepare version.
12 Signed-off-by: Al Cooper <alcooperx@gmail.com>
13 Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
14 Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
16 drivers/phy/broadcom/phy-brcm-usb.c | 28 ++++++++++++++--------------
17 1 file changed, 14 insertions(+), 14 deletions(-)
19 --- a/drivers/phy/broadcom/phy-brcm-usb.c
20 +++ b/drivers/phy/broadcom/phy-brcm-usb.c
21 @@ -74,8 +74,8 @@ static int brcm_usb_phy_init(struct phy
23 mutex_lock(&priv->mutex);
24 if (priv->init_count++ == 0) {
25 - clk_enable(priv->usb_20_clk);
26 - clk_enable(priv->usb_30_clk);
27 + clk_prepare_enable(priv->usb_20_clk);
28 + clk_prepare_enable(priv->usb_30_clk);
29 brcm_usb_init_common(&priv->ini);
31 mutex_unlock(&priv->mutex);
32 @@ -106,8 +106,8 @@ static int brcm_usb_phy_exit(struct phy
33 mutex_lock(&priv->mutex);
34 if (--priv->init_count == 0) {
35 brcm_usb_uninit_common(&priv->ini);
36 - clk_disable(priv->usb_20_clk);
37 - clk_disable(priv->usb_30_clk);
38 + clk_disable_unprepare(priv->usb_20_clk);
39 + clk_disable_unprepare(priv->usb_30_clk);
41 mutex_unlock(&priv->mutex);
43 @@ -360,8 +360,8 @@ static int brcm_usb_phy_probe(struct pla
45 brcm_usb_uninit_eohci(&priv->ini);
46 brcm_usb_uninit_common(&priv->ini);
47 - clk_disable(priv->usb_20_clk);
48 - clk_disable(priv->usb_30_clk);
49 + clk_disable_unprepare(priv->usb_20_clk);
50 + clk_disable_unprepare(priv->usb_30_clk);
52 phy_provider = devm_of_phy_provider_register(dev, brcm_usb_phy_xlate);
54 @@ -381,8 +381,8 @@ static int brcm_usb_phy_suspend(struct d
55 struct brcm_usb_phy_data *priv = dev_get_drvdata(dev);
57 if (priv->init_count) {
58 - clk_disable(priv->usb_20_clk);
59 - clk_disable(priv->usb_30_clk);
60 + clk_disable_unprepare(priv->usb_20_clk);
61 + clk_disable_unprepare(priv->usb_30_clk);
65 @@ -391,8 +391,8 @@ static int brcm_usb_phy_resume(struct de
67 struct brcm_usb_phy_data *priv = dev_get_drvdata(dev);
69 - clk_enable(priv->usb_20_clk);
70 - clk_enable(priv->usb_30_clk);
71 + clk_prepare_enable(priv->usb_20_clk);
72 + clk_prepare_enable(priv->usb_30_clk);
73 brcm_usb_init_ipp(&priv->ini);
76 @@ -405,13 +405,13 @@ static int brcm_usb_phy_resume(struct de
77 brcm_usb_init_eohci(&priv->ini);
78 } else if (priv->has_eohci) {
79 brcm_usb_uninit_eohci(&priv->ini);
80 - clk_disable(priv->usb_20_clk);
81 + clk_disable_unprepare(priv->usb_20_clk);
83 if (priv->phys[BRCM_USB_PHY_3_0].inited) {
84 brcm_usb_init_xhci(&priv->ini);
85 } else if (priv->has_xhci) {
86 brcm_usb_uninit_xhci(&priv->ini);
87 - clk_disable(priv->usb_30_clk);
88 + clk_disable_unprepare(priv->usb_30_clk);
92 @@ -419,8 +419,8 @@ static int brcm_usb_phy_resume(struct de
94 brcm_usb_uninit_eohci(&priv->ini);
95 brcm_usb_uninit_common(&priv->ini);
96 - clk_disable(priv->usb_20_clk);
97 - clk_disable(priv->usb_30_clk);
98 + clk_disable_unprepare(priv->usb_20_clk);
99 + clk_disable_unprepare(priv->usb_30_clk);