diff mbox

[6/9] ARM: mxc: audmux-v2: convert to clk_prepare/clk_unprepare

Message ID 1320900854-13031-6-git-send-email-richard.zhao@linaro.org
State Changes Requested
Headers show

Commit Message

Richard Zhao Nov. 10, 2011, 4:54 a.m. UTC
Signed-off-by: Richard Zhao <richard.zhao@linaro.org>
---
 arch/arm/plat-mxc/audmux-v2.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)
diff mbox

Patch

diff --git a/arch/arm/plat-mxc/audmux-v2.c b/arch/arm/plat-mxc/audmux-v2.c
index 8cced35..865e564 100644
--- a/arch/arm/plat-mxc/audmux-v2.c
+++ b/arch/arm/plat-mxc/audmux-v2.c
@@ -72,14 +72,18 @@  static ssize_t audmux_read_file(struct file *file, char __user *user_buf,
 	if (!buf)
 		return -ENOMEM;
 
-	if (audmux_clk)
+	if (audmux_clk) {
+		clk_prepare(audmux_clk);
 		clk_enable(audmux_clk);
+	}
 
 	ptcr = readl(audmux_base + MXC_AUDMUX_V2_PTCR(port));
 	pdcr = readl(audmux_base + MXC_AUDMUX_V2_PDCR(port));
 
-	if (audmux_clk)
+	if (audmux_clk) {
 		clk_disable(audmux_clk);
+		clk_unprepare(audmux_clk);
+	}
 
 	ret = snprintf(buf, PAGE_SIZE, "PDCR: %08x\nPTCR: %08x\n",
 		       pdcr, ptcr);
@@ -171,14 +175,18 @@  int mxc_audmux_v2_configure_port(unsigned int port, unsigned int ptcr,
 	if (!audmux_base)
 		return -ENOSYS;
 
-	if (audmux_clk)
+	if (audmux_clk) {
+		clk_prepare(audmux_clk);
 		clk_enable(audmux_clk);
+	}
 
 	writel(ptcr, audmux_base + MXC_AUDMUX_V2_PTCR(port));
 	writel(pdcr, audmux_base + MXC_AUDMUX_V2_PDCR(port));
 
-	if (audmux_clk)
+	if (audmux_clk) {
 		clk_disable(audmux_clk);
+		clk_unprepare(audmux_clk);
+	}
 
 	return 0;
 }