]> git.baikalelectronics.ru Git - kernel.git/commitdiff
usb: gadget: omap_udc: Make it CCF clk API compatible
authorJanusz Krzysztofik <jmkrzyszt@gmail.com>
Sat, 2 Apr 2022 11:26:58 +0000 (13:26 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 21 Apr 2022 17:17:40 +0000 (19:17 +0200)
The driver, OMAP1 specific, now omits clk_prepare/unprepare() steps, not
supported by OMAP1 custom implementation of clock API.  However, non-CCF
stubs of those functions exist for use on such platforms until converted
to CCF.

Update the driver to be compatible with CCF implementation of clock API.

Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
Link: https://lore.kernel.org/r/20220402112658.130191-1-jmkrzyszt@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/udc/omap_udc.c

index 2d9815dad2ff15abab3325a871841e673a4cde71..d81af616fddc2a82250b228fca5c3fa505cb8cb7 100644 (file)
@@ -2606,6 +2606,8 @@ static void omap_udc_release(struct device *dev)
        if (udc->dc_clk) {
                if (udc->clk_requested)
                        omap_udc_enable_clock(0);
+               clk_unprepare(udc->hhc_clk);
+               clk_unprepare(udc->dc_clk);
                clk_put(udc->hhc_clk);
                clk_put(udc->dc_clk);
        }
@@ -2770,8 +2772,8 @@ static int omap_udc_probe(struct platform_device *pdev)
                hhc_clk = clk_get(&pdev->dev, "usb_hhc_ck");
                BUG_ON(IS_ERR(dc_clk) || IS_ERR(hhc_clk));
                /* can't use omap_udc_enable_clock yet */
-               clk_enable(dc_clk);
-               clk_enable(hhc_clk);
+               clk_prepare_enable(dc_clk);
+               clk_prepare_enable(hhc_clk);
                udelay(100);
        }
 
@@ -2780,8 +2782,8 @@ static int omap_udc_probe(struct platform_device *pdev)
                hhc_clk = clk_get(&pdev->dev, "l3_ocpi_ck");
                BUG_ON(IS_ERR(dc_clk) || IS_ERR(hhc_clk));
                /* can't use omap_udc_enable_clock yet */
-               clk_enable(dc_clk);
-               clk_enable(hhc_clk);
+               clk_prepare_enable(dc_clk);
+               clk_prepare_enable(hhc_clk);
                udelay(100);
        }
 
@@ -2929,8 +2931,8 @@ cleanup0:
                usb_put_phy(xceiv);
 
        if (cpu_is_omap16xx() || cpu_is_omap7xx()) {
-               clk_disable(hhc_clk);
-               clk_disable(dc_clk);
+               clk_disable_unprepare(hhc_clk);
+               clk_disable_unprepare(dc_clk);
                clk_put(hhc_clk);
                clk_put(dc_clk);
        }