Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

m-karicheri2@ti.com and committed by
Sekhar Nori
b6f1ffed 6f0c0580

+12 -12
+1 -1
arch/arm/mach-davinci/board-dm355-evm.c
··· 324 324 if (IS_ERR(aemif)) 325 325 WARN("%s: unable to get AEMIF clock\n", __func__); 326 326 else 327 - clk_enable(aemif); 327 + clk_prepare_enable(aemif); 328 328 329 329 platform_add_devices(davinci_evm_devices, 330 330 ARRAY_SIZE(davinci_evm_devices));
+1 -1
arch/arm/mach-davinci/board-dm355-leopard.c
··· 246 246 if (IS_ERR(aemif)) 247 247 WARN("%s: unable to get AEMIF clock\n", __func__); 248 248 else 249 - clk_enable(aemif); 249 + clk_prepare_enable(aemif); 250 250 251 251 platform_add_devices(davinci_leopard_devices, 252 252 ARRAY_SIZE(davinci_leopard_devices));
+2 -2
arch/arm/mach-davinci/board-dm365-evm.c
··· 478 478 aemif_clk = clk_get(NULL, "aemif"); 479 479 if (IS_ERR(aemif_clk)) 480 480 return; 481 - clk_enable(aemif_clk); 481 + clk_prepare_enable(aemif_clk); 482 482 483 483 if (request_mem_region(DM365_ASYNC_EMIF_DATA_CE1_BASE, SECTION_SIZE, 484 484 "cpld") == NULL) ··· 489 489 SECTION_SIZE); 490 490 fail: 491 491 pr_err("ERROR: can't map CPLD\n"); 492 - clk_disable(aemif_clk); 492 + clk_disable_unprepare(aemif_clk); 493 493 return; 494 494 } 495 495
+1 -1
arch/arm/mach-davinci/board-dm644x-evm.c
··· 776 776 struct davinci_soc_info *soc_info = &davinci_soc_info; 777 777 778 778 aemif_clk = clk_get(NULL, "aemif"); 779 - clk_enable(aemif_clk); 779 + clk_prepare_enable(aemif_clk); 780 780 781 781 if (HAS_ATA) { 782 782 if (HAS_NAND || HAS_NOR)
+1 -1
arch/arm/mach-davinci/board-neuros-osd2.c
··· 188 188 struct davinci_soc_info *soc_info = &davinci_soc_info; 189 189 190 190 aemif_clk = clk_get(NULL, "aemif"); 191 - clk_enable(aemif_clk); 191 + clk_prepare_enable(aemif_clk); 192 192 193 193 if (HAS_ATA) { 194 194 if (HAS_NAND)
+3 -3
arch/arm/mach-davinci/devices-da8xx.c
··· 900 900 if (IS_ERR(da850_sata_clk)) 901 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 904 if (ret) 905 905 goto err0; 906 906 ··· 931 931 return 0; 932 932 933 933 err1: 934 - clk_disable(da850_sata_clk); 934 + clk_disable_unprepare(da850_sata_clk); 935 935 err0: 936 936 clk_put(da850_sata_clk); 937 937 return ret; ··· 939 939 940 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 943 clk_put(da850_sata_clk); 944 944 } 945 945
+1 -1
arch/arm/mach-davinci/serial.c
··· 95 95 continue; 96 96 } 97 97 98 - clk_enable(uart_clk); 98 + clk_prepare_enable(uart_clk); 99 99 p->uartclk = clk_get_rate(uart_clk); 100 100 101 101 if (!p->membase && p->mapbase) {
+2 -2
arch/arm/mach-davinci/time.c
··· 379 379 380 380 timer_clk = clk_get(NULL, "timer0"); 381 381 BUG_ON(IS_ERR(timer_clk)); 382 - clk_enable(timer_clk); 382 + clk_prepare_enable(timer_clk); 383 383 384 384 /* init timer hw */ 385 385 timer_init(); ··· 429 429 wd_clk = clk_get(&pdev->dev, NULL); 430 430 if (WARN_ON(IS_ERR(wd_clk))) 431 431 return; 432 - clk_enable(wd_clk); 432 + clk_prepare_enable(wd_clk); 433 433 434 434 /* disable, internal clock source */ 435 435 __raw_writel(0, base + TCR);