diff options
author | m-karicheri2@ti.com <m-karicheri2@ti.com> | 2012-08-02 12:53:48 -0400 |
---|---|---|
committer | Sekhar Nori <nsekhar@ti.com> | 2012-10-24 07:22:05 -0400 |
commit | b6f1ffed9d8a830ab94fd3fc6182e2fc8c77cba0 (patch) | |
tree | 3b4e4b12aa6af73d0f5d3c0c0a822acf7de7c823 /arch | |
parent | 6f0c0580b70c89094b3422ba81118c7b959c7556 (diff) |
ARM: davinci: convert platform code to use clk_prepare/clk_unprepare
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>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-davinci/board-dm355-evm.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-davinci/board-dm355-leopard.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-davinci/board-dm365-evm.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-davinci/board-dm644x-evm.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-davinci/board-neuros-osd2.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-davinci/devices-da8xx.c | 6 | ||||
-rw-r--r-- | arch/arm/mach-davinci/serial.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-davinci/time.c | 4 |
8 files changed, 12 insertions, 12 deletions
diff --git a/arch/arm/mach-davinci/board-dm355-evm.c b/arch/arm/mach-davinci/board-dm355-evm.c index 88ebea89abdf..cdf8d0746e79 100644 --- a/arch/arm/mach-davinci/board-dm355-evm.c +++ b/arch/arm/mach-davinci/board-dm355-evm.c | |||
@@ -324,7 +324,7 @@ static __init void dm355_evm_init(void) | |||
324 | if (IS_ERR(aemif)) | 324 | if (IS_ERR(aemif)) |
325 | WARN("%s: unable to get AEMIF clock\n", __func__); | 325 | WARN("%s: unable to get AEMIF clock\n", __func__); |
326 | else | 326 | else |
327 | clk_enable(aemif); | 327 | clk_prepare_enable(aemif); |
328 | 328 | ||
329 | platform_add_devices(davinci_evm_devices, | 329 | platform_add_devices(davinci_evm_devices, |
330 | ARRAY_SIZE(davinci_evm_devices)); | 330 | ARRAY_SIZE(davinci_evm_devices)); |
diff --git a/arch/arm/mach-davinci/board-dm355-leopard.c b/arch/arm/mach-davinci/board-dm355-leopard.c index 2f88103c6459..d41954507fc2 100644 --- a/arch/arm/mach-davinci/board-dm355-leopard.c +++ b/arch/arm/mach-davinci/board-dm355-leopard.c | |||
@@ -246,7 +246,7 @@ static __init void dm355_leopard_init(void) | |||
246 | if (IS_ERR(aemif)) | 246 | if (IS_ERR(aemif)) |
247 | WARN("%s: unable to get AEMIF clock\n", __func__); | 247 | WARN("%s: unable to get AEMIF clock\n", __func__); |
248 | else | 248 | else |
249 | clk_enable(aemif); | 249 | clk_prepare_enable(aemif); |
250 | 250 | ||
251 | platform_add_devices(davinci_leopard_devices, | 251 | platform_add_devices(davinci_leopard_devices, |
252 | ARRAY_SIZE(davinci_leopard_devices)); | 252 | ARRAY_SIZE(davinci_leopard_devices)); |
diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c index 1b4a8adcfdc9..5d49c75388ca 100644 --- a/arch/arm/mach-davinci/board-dm365-evm.c +++ b/arch/arm/mach-davinci/board-dm365-evm.c | |||
@@ -478,7 +478,7 @@ static void __init evm_init_cpld(void) | |||
478 | aemif_clk = clk_get(NULL, "aemif"); | 478 | aemif_clk = clk_get(NULL, "aemif"); |
479 | if (IS_ERR(aemif_clk)) | 479 | if (IS_ERR(aemif_clk)) |
480 | return; | 480 | return; |
481 | clk_enable(aemif_clk); | 481 | clk_prepare_enable(aemif_clk); |
482 | 482 | ||
483 | if (request_mem_region(DM365_ASYNC_EMIF_DATA_CE1_BASE, SECTION_SIZE, | 483 | if (request_mem_region(DM365_ASYNC_EMIF_DATA_CE1_BASE, SECTION_SIZE, |
484 | "cpld") == NULL) | 484 | "cpld") == NULL) |
@@ -489,7 +489,7 @@ static void __init evm_init_cpld(void) | |||
489 | SECTION_SIZE); | 489 | SECTION_SIZE); |
490 | fail: | 490 | fail: |
491 | pr_err("ERROR: can't map CPLD\n"); | 491 | pr_err("ERROR: can't map CPLD\n"); |
492 | clk_disable(aemif_clk); | 492 | clk_disable_unprepare(aemif_clk); |
493 | return; | 493 | return; |
494 | } | 494 | } |
495 | 495 | ||
diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c index f22572cee49d..a84dfcbc1154 100644 --- a/arch/arm/mach-davinci/board-dm644x-evm.c +++ b/arch/arm/mach-davinci/board-dm644x-evm.c | |||
@@ -776,7 +776,7 @@ static __init void davinci_evm_init(void) | |||
776 | struct davinci_soc_info *soc_info = &davinci_soc_info; | 776 | struct davinci_soc_info *soc_info = &davinci_soc_info; |
777 | 777 | ||
778 | aemif_clk = clk_get(NULL, "aemif"); | 778 | aemif_clk = clk_get(NULL, "aemif"); |
779 | clk_enable(aemif_clk); | 779 | clk_prepare_enable(aemif_clk); |
780 | 780 | ||
781 | if (HAS_ATA) { | 781 | if (HAS_ATA) { |
782 | if (HAS_NAND || HAS_NOR) | 782 | if (HAS_NAND || HAS_NOR) |
diff --git a/arch/arm/mach-davinci/board-neuros-osd2.c b/arch/arm/mach-davinci/board-neuros-osd2.c index 144bf31d68dd..3e3e3afebf88 100644 --- a/arch/arm/mach-davinci/board-neuros-osd2.c +++ b/arch/arm/mach-davinci/board-neuros-osd2.c | |||
@@ -188,7 +188,7 @@ static __init void davinci_ntosd2_init(void) | |||
188 | struct davinci_soc_info *soc_info = &davinci_soc_info; | 188 | struct davinci_soc_info *soc_info = &davinci_soc_info; |
189 | 189 | ||
190 | aemif_clk = clk_get(NULL, "aemif"); | 190 | aemif_clk = clk_get(NULL, "aemif"); |
191 | clk_enable(aemif_clk); | 191 | clk_prepare_enable(aemif_clk); |
192 | 192 | ||
193 | if (HAS_ATA) { | 193 | if (HAS_ATA) { |
194 | if (HAS_NAND) | 194 | if (HAS_NAND) |
diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c index bd2f72b414bc..d53612f12c52 100644 --- a/arch/arm/mach-davinci/devices-da8xx.c +++ b/arch/arm/mach-davinci/devices-da8xx.c | |||
@@ -900,7 +900,7 @@ static int da850_sata_init(struct device *dev, void __iomem *addr) | |||
900 | if (IS_ERR(da850_sata_clk)) | 900 | if (IS_ERR(da850_sata_clk)) |
901 | return PTR_ERR(da850_sata_clk); | 901 | return PTR_ERR(da850_sata_clk); |
902 | 902 | ||
903 | ret = clk_enable(da850_sata_clk); | 903 | ret = clk_prepare_enable(da850_sata_clk); |
904 | if (ret) | 904 | if (ret) |
905 | goto err0; | 905 | goto err0; |
906 | 906 | ||
@@ -931,7 +931,7 @@ static int da850_sata_init(struct device *dev, void __iomem *addr) | |||
931 | return 0; | 931 | return 0; |
932 | 932 | ||
933 | err1: | 933 | err1: |
934 | clk_disable(da850_sata_clk); | 934 | clk_disable_unprepare(da850_sata_clk); |
935 | err0: | 935 | err0: |
936 | clk_put(da850_sata_clk); | 936 | clk_put(da850_sata_clk); |
937 | return ret; | 937 | return ret; |
@@ -939,7 +939,7 @@ err0: | |||
939 | 939 | ||
940 | static void da850_sata_exit(struct device *dev) | 940 | static void da850_sata_exit(struct device *dev) |
941 | { | 941 | { |
942 | clk_disable(da850_sata_clk); | 942 | clk_disable_unprepare(da850_sata_clk); |
943 | clk_put(da850_sata_clk); | 943 | clk_put(da850_sata_clk); |
944 | } | 944 | } |
945 | 945 | ||
diff --git a/arch/arm/mach-davinci/serial.c b/arch/arm/mach-davinci/serial.c index 1875740fe27c..24ddb0d32a0f 100644 --- a/arch/arm/mach-davinci/serial.c +++ b/arch/arm/mach-davinci/serial.c | |||
@@ -95,7 +95,7 @@ int __init davinci_serial_init(struct davinci_uart_config *info) | |||
95 | continue; | 95 | continue; |
96 | } | 96 | } |
97 | 97 | ||
98 | clk_enable(uart_clk); | 98 | clk_prepare_enable(uart_clk); |
99 | p->uartclk = clk_get_rate(uart_clk); | 99 | p->uartclk = clk_get_rate(uart_clk); |
100 | 100 | ||
101 | if (!p->membase && p->mapbase) { | 101 | if (!p->membase && p->mapbase) { |
diff --git a/arch/arm/mach-davinci/time.c b/arch/arm/mach-davinci/time.c index 75da315b6587..9847938785ca 100644 --- a/arch/arm/mach-davinci/time.c +++ b/arch/arm/mach-davinci/time.c | |||
@@ -379,7 +379,7 @@ static void __init davinci_timer_init(void) | |||
379 | 379 | ||
380 | timer_clk = clk_get(NULL, "timer0"); | 380 | timer_clk = clk_get(NULL, "timer0"); |
381 | BUG_ON(IS_ERR(timer_clk)); | 381 | BUG_ON(IS_ERR(timer_clk)); |
382 | clk_enable(timer_clk); | 382 | clk_prepare_enable(timer_clk); |
383 | 383 | ||
384 | /* init timer hw */ | 384 | /* init timer hw */ |
385 | timer_init(); | 385 | timer_init(); |
@@ -429,7 +429,7 @@ void davinci_watchdog_reset(struct platform_device *pdev) | |||
429 | wd_clk = clk_get(&pdev->dev, NULL); | 429 | wd_clk = clk_get(&pdev->dev, NULL); |
430 | if (WARN_ON(IS_ERR(wd_clk))) | 430 | if (WARN_ON(IS_ERR(wd_clk))) |
431 | return; | 431 | return; |
432 | clk_enable(wd_clk); | 432 | clk_prepare_enable(wd_clk); |
433 | 433 | ||
434 | /* disable, internal clock source */ | 434 | /* disable, internal clock source */ |
435 | __raw_writel(0, base + TCR); | 435 | __raw_writel(0, base + TCR); |