diff options
author | Prashant Gaikwad <pgaikwad@nvidia.com> | 2012-06-05 00:29:35 -0400 |
---|---|---|
committer | Stephen Warren <swarren@nvidia.com> | 2012-06-11 13:53:29 -0400 |
commit | 6a5278d0715c5dfd42151bb6d7444db3f2ceed52 (patch) | |
tree | c6d19d9e65ebbb01d7c1745490444f3c95470783 | |
parent | cfaf025112d3856637ff34a767ef785ef5cf2ca9 (diff) |
ARM: tegra: add clk_prepare/clk_unprepare
Use clk_prepare/clk_unprepare as required by the generic clk framework.
Tested on Ventana and Cardhu.
Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
-rw-r--r-- | arch/arm/mach-tegra/cpu-tegra.c | 6 | ||||
-rw-r--r-- | arch/arm/mach-tegra/dma.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-tegra/pcie.c | 6 | ||||
-rw-r--r-- | arch/arm/mach-tegra/powergate.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-tegra/timer.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-tegra/usb_phy.c | 16 |
6 files changed, 19 insertions, 19 deletions
diff --git a/arch/arm/mach-tegra/cpu-tegra.c b/arch/arm/mach-tegra/cpu-tegra.c index 7a065f0cf633..ceb52db1e2f1 100644 --- a/arch/arm/mach-tegra/cpu-tegra.c +++ b/arch/arm/mach-tegra/cpu-tegra.c | |||
@@ -189,8 +189,8 @@ static int tegra_cpu_init(struct cpufreq_policy *policy) | |||
189 | return PTR_ERR(emc_clk); | 189 | return PTR_ERR(emc_clk); |
190 | } | 190 | } |
191 | 191 | ||
192 | clk_enable(emc_clk); | 192 | clk_prepare_enable(emc_clk); |
193 | clk_enable(cpu_clk); | 193 | clk_prepare_enable(cpu_clk); |
194 | 194 | ||
195 | cpufreq_frequency_table_cpuinfo(policy, freq_table); | 195 | cpufreq_frequency_table_cpuinfo(policy, freq_table); |
196 | cpufreq_frequency_table_get_attr(freq_table, policy->cpu); | 196 | cpufreq_frequency_table_get_attr(freq_table, policy->cpu); |
@@ -212,7 +212,7 @@ static int tegra_cpu_init(struct cpufreq_policy *policy) | |||
212 | static int tegra_cpu_exit(struct cpufreq_policy *policy) | 212 | static int tegra_cpu_exit(struct cpufreq_policy *policy) |
213 | { | 213 | { |
214 | cpufreq_frequency_table_cpuinfo(policy, freq_table); | 214 | cpufreq_frequency_table_cpuinfo(policy, freq_table); |
215 | clk_disable(emc_clk); | 215 | clk_disable_unprepare(emc_clk); |
216 | clk_put(emc_clk); | 216 | clk_put(emc_clk); |
217 | clk_put(cpu_clk); | 217 | clk_put(cpu_clk); |
218 | return 0; | 218 | return 0; |
diff --git a/arch/arm/mach-tegra/dma.c b/arch/arm/mach-tegra/dma.c index abea4f6e2dd5..2698d7d5c9ca 100644 --- a/arch/arm/mach-tegra/dma.c +++ b/arch/arm/mach-tegra/dma.c | |||
@@ -720,7 +720,7 @@ int __init tegra_dma_init(void) | |||
720 | ret = PTR_ERR(c); | 720 | ret = PTR_ERR(c); |
721 | goto fail; | 721 | goto fail; |
722 | } | 722 | } |
723 | ret = clk_enable(c); | 723 | ret = clk_prepare_enable(c); |
724 | if (ret != 0) { | 724 | if (ret != 0) { |
725 | pr_err("Unable to enable clock for APB DMA\n"); | 725 | pr_err("Unable to enable clock for APB DMA\n"); |
726 | goto fail; | 726 | goto fail; |
diff --git a/arch/arm/mach-tegra/pcie.c b/arch/arm/mach-tegra/pcie.c index 0e09137506ec..d3ad5150d660 100644 --- a/arch/arm/mach-tegra/pcie.c +++ b/arch/arm/mach-tegra/pcie.c | |||
@@ -723,9 +723,9 @@ static int tegra_pcie_power_regate(void) | |||
723 | 723 | ||
724 | tegra_pcie_xclk_clamp(false); | 724 | tegra_pcie_xclk_clamp(false); |
725 | 725 | ||
726 | clk_enable(tegra_pcie.afi_clk); | 726 | clk_prepare_enable(tegra_pcie.afi_clk); |
727 | clk_enable(tegra_pcie.pex_clk); | 727 | clk_prepare_enable(tegra_pcie.pex_clk); |
728 | return clk_enable(tegra_pcie.pll_e); | 728 | return clk_prepare_enable(tegra_pcie.pll_e); |
729 | } | 729 | } |
730 | 730 | ||
731 | static int tegra_pcie_clocks_get(void) | 731 | static int tegra_pcie_clocks_get(void) |
diff --git a/arch/arm/mach-tegra/powergate.c b/arch/arm/mach-tegra/powergate.c index f5b12fb4ff12..15d506501ccc 100644 --- a/arch/arm/mach-tegra/powergate.c +++ b/arch/arm/mach-tegra/powergate.c | |||
@@ -146,7 +146,7 @@ int tegra_powergate_sequence_power_up(int id, struct clk *clk) | |||
146 | if (ret) | 146 | if (ret) |
147 | goto err_power; | 147 | goto err_power; |
148 | 148 | ||
149 | ret = clk_enable(clk); | 149 | ret = clk_prepare_enable(clk); |
150 | if (ret) | 150 | if (ret) |
151 | goto err_clk; | 151 | goto err_clk; |
152 | 152 | ||
@@ -162,7 +162,7 @@ int tegra_powergate_sequence_power_up(int id, struct clk *clk) | |||
162 | return 0; | 162 | return 0; |
163 | 163 | ||
164 | err_clamp: | 164 | err_clamp: |
165 | clk_disable(clk); | 165 | clk_disable_unprepare(clk); |
166 | err_clk: | 166 | err_clk: |
167 | tegra_powergate_power_off(id); | 167 | tegra_powergate_power_off(id); |
168 | err_power: | 168 | err_power: |
diff --git a/arch/arm/mach-tegra/timer.c b/arch/arm/mach-tegra/timer.c index 315672c7bd48..57b5bdc13b9b 100644 --- a/arch/arm/mach-tegra/timer.c +++ b/arch/arm/mach-tegra/timer.c | |||
@@ -189,7 +189,7 @@ static void __init tegra_init_timer(void) | |||
189 | " Assuming 12Mhz input clock.\n"); | 189 | " Assuming 12Mhz input clock.\n"); |
190 | rate = 12000000; | 190 | rate = 12000000; |
191 | } else { | 191 | } else { |
192 | clk_enable(clk); | 192 | clk_prepare_enable(clk); |
193 | rate = clk_get_rate(clk); | 193 | rate = clk_get_rate(clk); |
194 | } | 194 | } |
195 | 195 | ||
@@ -201,7 +201,7 @@ static void __init tegra_init_timer(void) | |||
201 | if (IS_ERR(clk)) | 201 | if (IS_ERR(clk)) |
202 | pr_warn("Unable to get rtc-tegra clock\n"); | 202 | pr_warn("Unable to get rtc-tegra clock\n"); |
203 | else | 203 | else |
204 | clk_enable(clk); | 204 | clk_prepare_enable(clk); |
205 | 205 | ||
206 | switch (rate) { | 206 | switch (rate) { |
207 | case 12000000: | 207 | case 12000000: |
diff --git a/arch/arm/mach-tegra/usb_phy.c b/arch/arm/mach-tegra/usb_phy.c index 54e353c8e304..022b33a05c3a 100644 --- a/arch/arm/mach-tegra/usb_phy.c +++ b/arch/arm/mach-tegra/usb_phy.c | |||
@@ -247,7 +247,7 @@ static void utmip_pad_power_on(struct tegra_usb_phy *phy) | |||
247 | unsigned long val, flags; | 247 | unsigned long val, flags; |
248 | void __iomem *base = phy->pad_regs; | 248 | void __iomem *base = phy->pad_regs; |
249 | 249 | ||
250 | clk_enable(phy->pad_clk); | 250 | clk_prepare_enable(phy->pad_clk); |
251 | 251 | ||
252 | spin_lock_irqsave(&utmip_pad_lock, flags); | 252 | spin_lock_irqsave(&utmip_pad_lock, flags); |
253 | 253 | ||
@@ -259,7 +259,7 @@ static void utmip_pad_power_on(struct tegra_usb_phy *phy) | |||
259 | 259 | ||
260 | spin_unlock_irqrestore(&utmip_pad_lock, flags); | 260 | spin_unlock_irqrestore(&utmip_pad_lock, flags); |
261 | 261 | ||
262 | clk_disable(phy->pad_clk); | 262 | clk_disable_unprepare(phy->pad_clk); |
263 | } | 263 | } |
264 | 264 | ||
265 | static int utmip_pad_power_off(struct tegra_usb_phy *phy) | 265 | static int utmip_pad_power_off(struct tegra_usb_phy *phy) |
@@ -272,7 +272,7 @@ static int utmip_pad_power_off(struct tegra_usb_phy *phy) | |||
272 | return -EINVAL; | 272 | return -EINVAL; |
273 | } | 273 | } |
274 | 274 | ||
275 | clk_enable(phy->pad_clk); | 275 | clk_prepare_enable(phy->pad_clk); |
276 | 276 | ||
277 | spin_lock_irqsave(&utmip_pad_lock, flags); | 277 | spin_lock_irqsave(&utmip_pad_lock, flags); |
278 | 278 | ||
@@ -284,7 +284,7 @@ static int utmip_pad_power_off(struct tegra_usb_phy *phy) | |||
284 | 284 | ||
285 | spin_unlock_irqrestore(&utmip_pad_lock, flags); | 285 | spin_unlock_irqrestore(&utmip_pad_lock, flags); |
286 | 286 | ||
287 | clk_disable(phy->pad_clk); | 287 | clk_disable_unprepare(phy->pad_clk); |
288 | 288 | ||
289 | return 0; | 289 | return 0; |
290 | } | 290 | } |
@@ -580,7 +580,7 @@ static int ulpi_phy_power_on(struct tegra_usb_phy *phy) | |||
580 | msleep(5); | 580 | msleep(5); |
581 | gpio_direction_output(config->reset_gpio, 1); | 581 | gpio_direction_output(config->reset_gpio, 1); |
582 | 582 | ||
583 | clk_enable(phy->clk); | 583 | clk_prepare_enable(phy->clk); |
584 | msleep(1); | 584 | msleep(1); |
585 | 585 | ||
586 | val = readl(base + USB_SUSP_CTRL); | 586 | val = readl(base + USB_SUSP_CTRL); |
@@ -689,7 +689,7 @@ struct tegra_usb_phy *tegra_usb_phy_open(struct device *dev, int instance, | |||
689 | err = PTR_ERR(phy->pll_u); | 689 | err = PTR_ERR(phy->pll_u); |
690 | goto err0; | 690 | goto err0; |
691 | } | 691 | } |
692 | clk_enable(phy->pll_u); | 692 | clk_prepare_enable(phy->pll_u); |
693 | 693 | ||
694 | parent_rate = clk_get_rate(clk_get_parent(phy->pll_u)); | 694 | parent_rate = clk_get_rate(clk_get_parent(phy->pll_u)); |
695 | for (i = 0; i < ARRAY_SIZE(tegra_freq_table); i++) { | 695 | for (i = 0; i < ARRAY_SIZE(tegra_freq_table); i++) { |
@@ -735,7 +735,7 @@ struct tegra_usb_phy *tegra_usb_phy_open(struct device *dev, int instance, | |||
735 | return phy; | 735 | return phy; |
736 | 736 | ||
737 | err1: | 737 | err1: |
738 | clk_disable(phy->pll_u); | 738 | clk_disable_unprepare(phy->pll_u); |
739 | clk_put(phy->pll_u); | 739 | clk_put(phy->pll_u); |
740 | err0: | 740 | err0: |
741 | kfree(phy); | 741 | kfree(phy); |
@@ -810,7 +810,7 @@ void tegra_usb_phy_close(struct tegra_usb_phy *phy) | |||
810 | clk_put(phy->clk); | 810 | clk_put(phy->clk); |
811 | else | 811 | else |
812 | utmip_pad_close(phy); | 812 | utmip_pad_close(phy); |
813 | clk_disable(phy->pll_u); | 813 | clk_disable_unprepare(phy->pll_u); |
814 | clk_put(phy->pll_u); | 814 | clk_put(phy->pll_u); |
815 | kfree(phy); | 815 | kfree(phy); |
816 | } | 816 | } |