diff options
author | Olof Johansson <olof@lixom.net> | 2012-02-08 18:32:04 -0500 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2012-02-08 18:32:04 -0500 |
commit | ac819a86a76dc29d18306f5c998c38af1ebb58cd (patch) | |
tree | c1d5b4280897edebdf8954b4290b26b105110c84 | |
parent | 0180a7d012e413a956e3f46fcbeb8dbf3374a19c (diff) | |
parent | 5ef97faa31ccf34d6fef0964aea3c924f9d534fe (diff) |
Merge branch 'features/imx-clk-prepare' of git://git.pengutronix.de/git/imx/linux-2.6 into next/drivers
* 'features/imx-clk-prepare' of git://git.pengutronix.de/git/imx/linux-2.6:
mmc: sdhci-esdhc-imx: add clk_prepare/clk_unprepare
i2c: imx: add clk_prepare/clk_unprepare
serial: imx: add clk_prepare/clk_unprepare
ARM: mx31moboard: add clk_prepare/clk_unprepare
ARM: pm-imx5: add clk_prepare/clk_unprepare
ARM: mxc: audmux-v2: add clk_prepare/clk_unprepare
ARM: mxc: arch_reset: add clk_prepare/clk_unprepare
ARM: mxc: epit: add clk_prepare/clk_unprepare
ARM: mxc: pwm: add clk_prepare/clk_unprepare
ARM: mxc: ahci: add clk_prepare/clk_unprepare
ARM: mxc: time: add clk_prepare/clk_unprepare
-rw-r--r-- | arch/arm/mach-imx/mach-mx31moboard.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-imx/pm-imx5.c | 4 | ||||
-rw-r--r-- | arch/arm/plat-mxc/audmux-v2.c | 8 | ||||
-rw-r--r-- | arch/arm/plat-mxc/devices/platform-ahci-imx.c | 16 | ||||
-rw-r--r-- | arch/arm/plat-mxc/epit.c | 2 | ||||
-rw-r--r-- | arch/arm/plat-mxc/pwm.c | 4 | ||||
-rw-r--r-- | arch/arm/plat-mxc/system.c | 2 | ||||
-rw-r--r-- | arch/arm/plat-mxc/time.c | 2 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-imx.c | 4 | ||||
-rw-r--r-- | drivers/mmc/host/sdhci-esdhc-imx.c | 6 | ||||
-rw-r--r-- | drivers/tty/serial/imx.c | 7 |
11 files changed, 28 insertions, 29 deletions
diff --git a/arch/arm/mach-imx/mach-mx31moboard.c b/arch/arm/mach-imx/mach-mx31moboard.c index f225262b5c38..96e042d0c9a9 100644 --- a/arch/arm/mach-imx/mach-mx31moboard.c +++ b/arch/arm/mach-imx/mach-mx31moboard.c | |||
@@ -507,7 +507,7 @@ static void mx31moboard_poweroff(void) | |||
507 | struct clk *clk = clk_get_sys("imx2-wdt.0", NULL); | 507 | struct clk *clk = clk_get_sys("imx2-wdt.0", NULL); |
508 | 508 | ||
509 | if (!IS_ERR(clk)) | 509 | if (!IS_ERR(clk)) |
510 | clk_enable(clk); | 510 | clk_prepare_enable(clk); |
511 | 511 | ||
512 | mxc_iomux_mode(MX31_PIN_WATCHDOG_RST__WATCHDOG_RST); | 512 | mxc_iomux_mode(MX31_PIN_WATCHDOG_RST__WATCHDOG_RST); |
513 | 513 | ||
diff --git a/arch/arm/mach-imx/pm-imx5.c b/arch/arm/mach-imx/pm-imx5.c index 6dc093448057..e26a9cb05ed8 100644 --- a/arch/arm/mach-imx/pm-imx5.c +++ b/arch/arm/mach-imx/pm-imx5.c | |||
@@ -89,7 +89,7 @@ void mx5_cpu_lp_set(enum mxc_cpu_pwr_mode mode) | |||
89 | 89 | ||
90 | static int mx5_suspend_prepare(void) | 90 | static int mx5_suspend_prepare(void) |
91 | { | 91 | { |
92 | return clk_enable(gpc_dvfs_clk); | 92 | return clk_prepare_enable(gpc_dvfs_clk); |
93 | } | 93 | } |
94 | 94 | ||
95 | static int mx5_suspend_enter(suspend_state_t state) | 95 | static int mx5_suspend_enter(suspend_state_t state) |
@@ -119,7 +119,7 @@ static int mx5_suspend_enter(suspend_state_t state) | |||
119 | 119 | ||
120 | static void mx5_suspend_finish(void) | 120 | static void mx5_suspend_finish(void) |
121 | { | 121 | { |
122 | clk_disable(gpc_dvfs_clk); | 122 | clk_disable_unprepare(gpc_dvfs_clk); |
123 | } | 123 | } |
124 | 124 | ||
125 | static int mx5_pm_valid(suspend_state_t state) | 125 | static int mx5_pm_valid(suspend_state_t state) |
diff --git a/arch/arm/plat-mxc/audmux-v2.c b/arch/arm/plat-mxc/audmux-v2.c index 8cced35009bd..0e51fc36b5be 100644 --- a/arch/arm/plat-mxc/audmux-v2.c +++ b/arch/arm/plat-mxc/audmux-v2.c | |||
@@ -73,13 +73,13 @@ static ssize_t audmux_read_file(struct file *file, char __user *user_buf, | |||
73 | return -ENOMEM; | 73 | return -ENOMEM; |
74 | 74 | ||
75 | if (audmux_clk) | 75 | if (audmux_clk) |
76 | clk_enable(audmux_clk); | 76 | clk_prepare_enable(audmux_clk); |
77 | 77 | ||
78 | ptcr = readl(audmux_base + MXC_AUDMUX_V2_PTCR(port)); | 78 | ptcr = readl(audmux_base + MXC_AUDMUX_V2_PTCR(port)); |
79 | pdcr = readl(audmux_base + MXC_AUDMUX_V2_PDCR(port)); | 79 | pdcr = readl(audmux_base + MXC_AUDMUX_V2_PDCR(port)); |
80 | 80 | ||
81 | if (audmux_clk) | 81 | if (audmux_clk) |
82 | clk_disable(audmux_clk); | 82 | clk_disable_unprepare(audmux_clk); |
83 | 83 | ||
84 | ret = snprintf(buf, PAGE_SIZE, "PDCR: %08x\nPTCR: %08x\n", | 84 | ret = snprintf(buf, PAGE_SIZE, "PDCR: %08x\nPTCR: %08x\n", |
85 | pdcr, ptcr); | 85 | pdcr, ptcr); |
@@ -172,13 +172,13 @@ int mxc_audmux_v2_configure_port(unsigned int port, unsigned int ptcr, | |||
172 | return -ENOSYS; | 172 | return -ENOSYS; |
173 | 173 | ||
174 | if (audmux_clk) | 174 | if (audmux_clk) |
175 | clk_enable(audmux_clk); | 175 | clk_prepare_enable(audmux_clk); |
176 | 176 | ||
177 | writel(ptcr, audmux_base + MXC_AUDMUX_V2_PTCR(port)); | 177 | writel(ptcr, audmux_base + MXC_AUDMUX_V2_PTCR(port)); |
178 | writel(pdcr, audmux_base + MXC_AUDMUX_V2_PDCR(port)); | 178 | writel(pdcr, audmux_base + MXC_AUDMUX_V2_PDCR(port)); |
179 | 179 | ||
180 | if (audmux_clk) | 180 | if (audmux_clk) |
181 | clk_disable(audmux_clk); | 181 | clk_disable_unprepare(audmux_clk); |
182 | 182 | ||
183 | return 0; | 183 | return 0; |
184 | } | 184 | } |
diff --git a/arch/arm/plat-mxc/devices/platform-ahci-imx.c b/arch/arm/plat-mxc/devices/platform-ahci-imx.c index d8a56aee521b..ade4a1c4e2a3 100644 --- a/arch/arm/plat-mxc/devices/platform-ahci-imx.c +++ b/arch/arm/plat-mxc/devices/platform-ahci-imx.c | |||
@@ -60,9 +60,9 @@ static int imx_sata_init(struct device *dev, void __iomem *addr) | |||
60 | dev_err(dev, "no sata clock.\n"); | 60 | dev_err(dev, "no sata clock.\n"); |
61 | return PTR_ERR(sata_clk); | 61 | return PTR_ERR(sata_clk); |
62 | } | 62 | } |
63 | ret = clk_enable(sata_clk); | 63 | ret = clk_prepare_enable(sata_clk); |
64 | if (ret) { | 64 | if (ret) { |
65 | dev_err(dev, "can't enable sata clock.\n"); | 65 | dev_err(dev, "can't prepare/enable sata clock.\n"); |
66 | goto put_sata_clk; | 66 | goto put_sata_clk; |
67 | } | 67 | } |
68 | 68 | ||
@@ -73,9 +73,9 @@ static int imx_sata_init(struct device *dev, void __iomem *addr) | |||
73 | ret = PTR_ERR(sata_ref_clk); | 73 | ret = PTR_ERR(sata_ref_clk); |
74 | goto release_sata_clk; | 74 | goto release_sata_clk; |
75 | } | 75 | } |
76 | ret = clk_enable(sata_ref_clk); | 76 | ret = clk_prepare_enable(sata_ref_clk); |
77 | if (ret) { | 77 | if (ret) { |
78 | dev_err(dev, "can't enable sata ref clock.\n"); | 78 | dev_err(dev, "can't prepare/enable sata ref clock.\n"); |
79 | goto put_sata_ref_clk; | 79 | goto put_sata_ref_clk; |
80 | } | 80 | } |
81 | 81 | ||
@@ -104,11 +104,11 @@ static int imx_sata_init(struct device *dev, void __iomem *addr) | |||
104 | return 0; | 104 | return 0; |
105 | 105 | ||
106 | release_sata_ref_clk: | 106 | release_sata_ref_clk: |
107 | clk_disable(sata_ref_clk); | 107 | clk_disable_unprepare(sata_ref_clk); |
108 | put_sata_ref_clk: | 108 | put_sata_ref_clk: |
109 | clk_put(sata_ref_clk); | 109 | clk_put(sata_ref_clk); |
110 | release_sata_clk: | 110 | release_sata_clk: |
111 | clk_disable(sata_clk); | 111 | clk_disable_unprepare(sata_clk); |
112 | put_sata_clk: | 112 | put_sata_clk: |
113 | clk_put(sata_clk); | 113 | clk_put(sata_clk); |
114 | 114 | ||
@@ -117,10 +117,10 @@ put_sata_clk: | |||
117 | 117 | ||
118 | static void imx_sata_exit(struct device *dev) | 118 | static void imx_sata_exit(struct device *dev) |
119 | { | 119 | { |
120 | clk_disable(sata_ref_clk); | 120 | clk_disable_unprepare(sata_ref_clk); |
121 | clk_put(sata_ref_clk); | 121 | clk_put(sata_ref_clk); |
122 | 122 | ||
123 | clk_disable(sata_clk); | 123 | clk_disable_unprepare(sata_clk); |
124 | clk_put(sata_clk); | 124 | clk_put(sata_clk); |
125 | 125 | ||
126 | } | 126 | } |
diff --git a/arch/arm/plat-mxc/epit.c b/arch/arm/plat-mxc/epit.c index d3467f818c33..9129c9e7d532 100644 --- a/arch/arm/plat-mxc/epit.c +++ b/arch/arm/plat-mxc/epit.c | |||
@@ -203,7 +203,7 @@ static int __init epit_clockevent_init(struct clk *timer_clk) | |||
203 | 203 | ||
204 | void __init epit_timer_init(struct clk *timer_clk, void __iomem *base, int irq) | 204 | void __init epit_timer_init(struct clk *timer_clk, void __iomem *base, int irq) |
205 | { | 205 | { |
206 | clk_enable(timer_clk); | 206 | clk_prepare_enable(timer_clk); |
207 | 207 | ||
208 | timer_base = base; | 208 | timer_base = base; |
209 | 209 | ||
diff --git a/arch/arm/plat-mxc/pwm.c b/arch/arm/plat-mxc/pwm.c index e032717f7d02..c0cab2270dd1 100644 --- a/arch/arm/plat-mxc/pwm.c +++ b/arch/arm/plat-mxc/pwm.c | |||
@@ -132,7 +132,7 @@ int pwm_enable(struct pwm_device *pwm) | |||
132 | int rc = 0; | 132 | int rc = 0; |
133 | 133 | ||
134 | if (!pwm->clk_enabled) { | 134 | if (!pwm->clk_enabled) { |
135 | rc = clk_enable(pwm->clk); | 135 | rc = clk_prepare_enable(pwm->clk); |
136 | if (!rc) | 136 | if (!rc) |
137 | pwm->clk_enabled = 1; | 137 | pwm->clk_enabled = 1; |
138 | } | 138 | } |
@@ -145,7 +145,7 @@ void pwm_disable(struct pwm_device *pwm) | |||
145 | writel(0, pwm->mmio_base + MX3_PWMCR); | 145 | writel(0, pwm->mmio_base + MX3_PWMCR); |
146 | 146 | ||
147 | if (pwm->clk_enabled) { | 147 | if (pwm->clk_enabled) { |
148 | clk_disable(pwm->clk); | 148 | clk_disable_unprepare(pwm->clk); |
149 | pwm->clk_enabled = 0; | 149 | pwm->clk_enabled = 0; |
150 | } | 150 | } |
151 | } | 151 | } |
diff --git a/arch/arm/plat-mxc/system.c b/arch/arm/plat-mxc/system.c index 3599bf2cfd4f..f30dcacbbd0a 100644 --- a/arch/arm/plat-mxc/system.c +++ b/arch/arm/plat-mxc/system.c | |||
@@ -48,7 +48,7 @@ void mxc_restart(char mode, const char *cmd) | |||
48 | 48 | ||
49 | clk = clk_get_sys("imx2-wdt.0", NULL); | 49 | clk = clk_get_sys("imx2-wdt.0", NULL); |
50 | if (!IS_ERR(clk)) | 50 | if (!IS_ERR(clk)) |
51 | clk_enable(clk); | 51 | clk_prepare_enable(clk); |
52 | wcr_enable = (1 << 2); | 52 | wcr_enable = (1 << 2); |
53 | } | 53 | } |
54 | 54 | ||
diff --git a/arch/arm/plat-mxc/time.c b/arch/arm/plat-mxc/time.c index 1c96cdb4c35e..7daf7c9a413b 100644 --- a/arch/arm/plat-mxc/time.c +++ b/arch/arm/plat-mxc/time.c | |||
@@ -283,7 +283,7 @@ void __init mxc_timer_init(struct clk *timer_clk, void __iomem *base, int irq) | |||
283 | { | 283 | { |
284 | uint32_t tctl_val; | 284 | uint32_t tctl_val; |
285 | 285 | ||
286 | clk_enable(timer_clk); | 286 | clk_prepare_enable(timer_clk); |
287 | 287 | ||
288 | timer_base = base; | 288 | timer_base = base; |
289 | 289 | ||
diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c index 58832e578fff..8d1ab6fa88e1 100644 --- a/drivers/i2c/busses/i2c-imx.c +++ b/drivers/i2c/busses/i2c-imx.c | |||
@@ -196,7 +196,7 @@ static int i2c_imx_start(struct imx_i2c_struct *i2c_imx) | |||
196 | 196 | ||
197 | dev_dbg(&i2c_imx->adapter.dev, "<%s>\n", __func__); | 197 | dev_dbg(&i2c_imx->adapter.dev, "<%s>\n", __func__); |
198 | 198 | ||
199 | clk_enable(i2c_imx->clk); | 199 | clk_prepare_enable(i2c_imx->clk); |
200 | writeb(i2c_imx->ifdr, i2c_imx->base + IMX_I2C_IFDR); | 200 | writeb(i2c_imx->ifdr, i2c_imx->base + IMX_I2C_IFDR); |
201 | /* Enable I2C controller */ | 201 | /* Enable I2C controller */ |
202 | writeb(0, i2c_imx->base + IMX_I2C_I2SR); | 202 | writeb(0, i2c_imx->base + IMX_I2C_I2SR); |
@@ -245,7 +245,7 @@ static void i2c_imx_stop(struct imx_i2c_struct *i2c_imx) | |||
245 | 245 | ||
246 | /* Disable I2C controller */ | 246 | /* Disable I2C controller */ |
247 | writeb(0, i2c_imx->base + IMX_I2C_I2CR); | 247 | writeb(0, i2c_imx->base + IMX_I2C_I2CR); |
248 | clk_disable(i2c_imx->clk); | 248 | clk_disable_unprepare(i2c_imx->clk); |
249 | } | 249 | } |
250 | 250 | ||
251 | static void __init i2c_imx_set_clk(struct imx_i2c_struct *i2c_imx, | 251 | static void __init i2c_imx_set_clk(struct imx_i2c_struct *i2c_imx, |
diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index d601e41af282..f4e82d45cafa 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c | |||
@@ -463,7 +463,7 @@ static int __devinit sdhci_esdhc_imx_probe(struct platform_device *pdev) | |||
463 | err = PTR_ERR(clk); | 463 | err = PTR_ERR(clk); |
464 | goto err_clk_get; | 464 | goto err_clk_get; |
465 | } | 465 | } |
466 | clk_enable(clk); | 466 | clk_prepare_enable(clk); |
467 | pltfm_host->clk = clk; | 467 | pltfm_host->clk = clk; |
468 | 468 | ||
469 | if (!is_imx25_esdhc(imx_data)) | 469 | if (!is_imx25_esdhc(imx_data)) |
@@ -558,7 +558,7 @@ no_card_detect_irq: | |||
558 | gpio_free(boarddata->wp_gpio); | 558 | gpio_free(boarddata->wp_gpio); |
559 | no_card_detect_pin: | 559 | no_card_detect_pin: |
560 | no_board_data: | 560 | no_board_data: |
561 | clk_disable(pltfm_host->clk); | 561 | clk_disable_unprepare(pltfm_host->clk); |
562 | clk_put(pltfm_host->clk); | 562 | clk_put(pltfm_host->clk); |
563 | err_clk_get: | 563 | err_clk_get: |
564 | kfree(imx_data); | 564 | kfree(imx_data); |
@@ -585,7 +585,7 @@ static int __devexit sdhci_esdhc_imx_remove(struct platform_device *pdev) | |||
585 | gpio_free(boarddata->cd_gpio); | 585 | gpio_free(boarddata->cd_gpio); |
586 | } | 586 | } |
587 | 587 | ||
588 | clk_disable(pltfm_host->clk); | 588 | clk_disable_unprepare(pltfm_host->clk); |
589 | clk_put(pltfm_host->clk); | 589 | clk_put(pltfm_host->clk); |
590 | kfree(imx_data); | 590 | kfree(imx_data); |
591 | 591 | ||
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index 0b7fed746b27..e7feceeebc2f 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c | |||
@@ -1508,7 +1508,7 @@ static int serial_imx_probe(struct platform_device *pdev) | |||
1508 | ret = PTR_ERR(sport->clk); | 1508 | ret = PTR_ERR(sport->clk); |
1509 | goto unmap; | 1509 | goto unmap; |
1510 | } | 1510 | } |
1511 | clk_enable(sport->clk); | 1511 | clk_prepare_enable(sport->clk); |
1512 | 1512 | ||
1513 | sport->port.uartclk = clk_get_rate(sport->clk); | 1513 | sport->port.uartclk = clk_get_rate(sport->clk); |
1514 | 1514 | ||
@@ -1531,8 +1531,8 @@ deinit: | |||
1531 | if (pdata && pdata->exit) | 1531 | if (pdata && pdata->exit) |
1532 | pdata->exit(pdev); | 1532 | pdata->exit(pdev); |
1533 | clkput: | 1533 | clkput: |
1534 | clk_disable_unprepare(sport->clk); | ||
1534 | clk_put(sport->clk); | 1535 | clk_put(sport->clk); |
1535 | clk_disable(sport->clk); | ||
1536 | unmap: | 1536 | unmap: |
1537 | iounmap(sport->port.membase); | 1537 | iounmap(sport->port.membase); |
1538 | free: | 1538 | free: |
@@ -1552,11 +1552,10 @@ static int serial_imx_remove(struct platform_device *pdev) | |||
1552 | 1552 | ||
1553 | if (sport) { | 1553 | if (sport) { |
1554 | uart_remove_one_port(&imx_reg, &sport->port); | 1554 | uart_remove_one_port(&imx_reg, &sport->port); |
1555 | clk_disable_unprepare(sport->clk); | ||
1555 | clk_put(sport->clk); | 1556 | clk_put(sport->clk); |
1556 | } | 1557 | } |
1557 | 1558 | ||
1558 | clk_disable(sport->clk); | ||
1559 | |||
1560 | if (pdata && pdata->exit) | 1559 | if (pdata && pdata->exit) |
1561 | pdata->exit(pdev); | 1560 | pdata->exit(pdev); |
1562 | 1561 | ||