ARM: davinci: convert platform code to use clk_prepare/clk_unprepare
authorm-karicheri2@ti.com <m-karicheri2@ti.com>
Thu, 2 Aug 2012 16:53:48 +0000 (16:53 +0000)
committerSekhar Nori <nsekhar@ti.com>
Wed, 24 Oct 2012 11:22:05 +0000 (16:52 +0530)
As a first step towards migrating davinci platforms to use common clock
framework, replace all instances of clk_enable() with clk_prepare_enable()
and clk_disable() with clk_disable_unprepare(). Until the platform is
switched to use the CONFIG_HAVE_CLK_PREPARE Kconfig variable, this just
adds a might_sleep() call and would work without any issues.

This will make it easy later to switch to common clk based implementation
of clk driver from DaVinci specific driver.

Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Reviewed-by: Mike Turquette <mturquette@linaro.org>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
arch/arm/mach-davinci/board-dm355-evm.c
arch/arm/mach-davinci/board-dm355-leopard.c
arch/arm/mach-davinci/board-dm365-evm.c
arch/arm/mach-davinci/board-dm644x-evm.c
arch/arm/mach-davinci/board-neuros-osd2.c
arch/arm/mach-davinci/devices-da8xx.c
arch/arm/mach-davinci/serial.c
arch/arm/mach-davinci/time.c

index 88ebea89abdf9cbbd9233527057397d297436b7b..cdf8d0746e799df1e31aab36d96ac8f3a116cbb2 100644 (file)
@@ -324,7 +324,7 @@ static __init void dm355_evm_init(void)
        if (IS_ERR(aemif))
                WARN("%s: unable to get AEMIF clock\n", __func__);
        else
-               clk_enable(aemif);
+               clk_prepare_enable(aemif);
 
        platform_add_devices(davinci_evm_devices,
                             ARRAY_SIZE(davinci_evm_devices));
index 2f88103c64595c1f68a3ad9f7ca026e0b8644741..d41954507fc26794433d2fa248e14254b1b2f73c 100644 (file)
@@ -246,7 +246,7 @@ static __init void dm355_leopard_init(void)
        if (IS_ERR(aemif))
                WARN("%s: unable to get AEMIF clock\n", __func__);
        else
-               clk_enable(aemif);
+               clk_prepare_enable(aemif);
 
        platform_add_devices(davinci_leopard_devices,
                             ARRAY_SIZE(davinci_leopard_devices));
index 1b4a8adcfdc9f1f86f87079c8ab8b009e0bc105a..5d49c75388ca9782f6a8192469d6c6a0b93c6cdc 100644 (file)
@@ -478,7 +478,7 @@ static void __init evm_init_cpld(void)
        aemif_clk = clk_get(NULL, "aemif");
        if (IS_ERR(aemif_clk))
                return;
-       clk_enable(aemif_clk);
+       clk_prepare_enable(aemif_clk);
 
        if (request_mem_region(DM365_ASYNC_EMIF_DATA_CE1_BASE, SECTION_SIZE,
                        "cpld") == NULL)
@@ -489,7 +489,7 @@ static void __init evm_init_cpld(void)
                                SECTION_SIZE);
 fail:
                pr_err("ERROR: can't map CPLD\n");
-               clk_disable(aemif_clk);
+               clk_disable_unprepare(aemif_clk);
                return;
        }
 
index f22572cee49d89ade236851a04fdf2ba94fed2e6..a84dfcbc11544e6b6c9f4b56b3c5d1fcf76108d2 100644 (file)
@@ -776,7 +776,7 @@ static __init void davinci_evm_init(void)
        struct davinci_soc_info *soc_info = &davinci_soc_info;
 
        aemif_clk = clk_get(NULL, "aemif");
-       clk_enable(aemif_clk);
+       clk_prepare_enable(aemif_clk);
 
        if (HAS_ATA) {
                if (HAS_NAND || HAS_NOR)
index 144bf31d68ddd16a6fec1e3260f462d8ef1140f9..3e3e3afebf886d179f2e9fef5cf00013af54f5ba 100644 (file)
@@ -188,7 +188,7 @@ static __init void davinci_ntosd2_init(void)
        struct davinci_soc_info *soc_info = &davinci_soc_info;
 
        aemif_clk = clk_get(NULL, "aemif");
-       clk_enable(aemif_clk);
+       clk_prepare_enable(aemif_clk);
 
        if (HAS_ATA) {
                if (HAS_NAND)
index bd2f72b414bce03c87b4921e2962ff709cf815e4..d53612f12c52cfce5332996ba495899cff0e48b4 100644 (file)
@@ -900,7 +900,7 @@ static int da850_sata_init(struct device *dev, void __iomem *addr)
        if (IS_ERR(da850_sata_clk))
                return PTR_ERR(da850_sata_clk);
 
-       ret = clk_enable(da850_sata_clk);
+       ret = clk_prepare_enable(da850_sata_clk);
        if (ret)
                goto err0;
 
@@ -931,7 +931,7 @@ static int da850_sata_init(struct device *dev, void __iomem *addr)
        return 0;
 
 err1:
-       clk_disable(da850_sata_clk);
+       clk_disable_unprepare(da850_sata_clk);
 err0:
        clk_put(da850_sata_clk);
        return ret;
@@ -939,7 +939,7 @@ err0:
 
 static void da850_sata_exit(struct device *dev)
 {
-       clk_disable(da850_sata_clk);
+       clk_disable_unprepare(da850_sata_clk);
        clk_put(da850_sata_clk);
 }
 
index 1875740fe27cb030cdc71db2772adfbd5cc2e788..24ddb0d32a0f8c36b964d744c2837d34274a8ff4 100644 (file)
@@ -95,7 +95,7 @@ int __init davinci_serial_init(struct davinci_uart_config *info)
                        continue;
                }
 
-               clk_enable(uart_clk);
+               clk_prepare_enable(uart_clk);
                p->uartclk = clk_get_rate(uart_clk);
 
                if (!p->membase && p->mapbase) {
index 75da315b658724fabe134cb40fef3015b2df9697..9847938785caa5c5fdcfa134ad454ec8696bef53 100644 (file)
@@ -379,7 +379,7 @@ static void __init davinci_timer_init(void)
 
        timer_clk = clk_get(NULL, "timer0");
        BUG_ON(IS_ERR(timer_clk));
-       clk_enable(timer_clk);
+       clk_prepare_enable(timer_clk);
 
        /* init timer hw */
        timer_init();
@@ -429,7 +429,7 @@ void davinci_watchdog_reset(struct platform_device *pdev)
        wd_clk = clk_get(&pdev->dev, NULL);
        if (WARN_ON(IS_ERR(wd_clk)))
                return;
-       clk_enable(wd_clk);
+       clk_prepare_enable(wd_clk);
 
        /* disable, internal clock source */
        __raw_writel(0, base + TCR);
This page took 0.029211 seconds and 5 git commands to generate.