@@ -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;
}
Signed-off-by: Richard Zhao <richard.zhao@linaro.org> --- arch/arm/plat-mxc/audmux-v2.c | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-)