From 989fcd186208a839d2e212d22e9a8f042456d050 Mon Sep 17 00:00:00 2001 From: Shawn Guo Date: Tue, 20 Dec 2011 16:12:34 +0800 Subject: [PATCH] --- yaml --- r: 281955 b: refs/heads/master c: 6abda3e129bfe4d74b5c274da7dff0e2b1488818 h: refs/heads/master i: 281953: 56f7ae97f7498f7b4c24f7230046a82f0945db56 281951: 742466116803cc7ef1471644c3c60b59c4302d92 v: v3 --- [refs] | 2 +- trunk/arch/arm/Kconfig | 1 + trunk/arch/arm/mach-mxs/clock.c | 31 ++++++++++++++++++++++--------- 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/[refs] b/[refs] index 43aa1f265fd3..1a4973543672 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 5c77f5608a5081632b9530e5f3260f8b63247bd8 +refs/heads/master: 6abda3e129bfe4d74b5c274da7dff0e2b1488818 diff --git a/trunk/arch/arm/Kconfig b/trunk/arch/arm/Kconfig index 776d76b8cb69..dc461637e778 100644 --- a/trunk/arch/arm/Kconfig +++ b/trunk/arch/arm/Kconfig @@ -442,6 +442,7 @@ config ARCH_MXS select ARCH_REQUIRE_GPIOLIB select CLKDEV_LOOKUP select CLKSRC_MMIO + select HAVE_CLK_PREPARE help Support for Freescale MXS-based family of processors diff --git a/trunk/arch/arm/mach-mxs/clock.c b/trunk/arch/arm/mach-mxs/clock.c index 755eec0b5a89..97a6f4acc6cc 100644 --- a/trunk/arch/arm/mach-mxs/clock.c +++ b/trunk/arch/arm/mach-mxs/clock.c @@ -74,10 +74,15 @@ static int __clk_enable(struct clk *clk) return 0; } -/* This function increments the reference count on the clock and enables the - * clock if not already enabled. The parent clock tree is recursively enabled +/* + * The clk_enable/clk_disable could be called by drivers in atomic context, + * so they should not really hold mutex. Instead, clk_prepare/clk_unprepare + * can hold a mutex, as the pair will only be called in non-atomic context. + * Before migrating to common clk framework, we can have __clk_enable and + * __clk_disable called in clk_prepare/clk_unprepare with mutex held and + * leave clk_enable/clk_disable as the dummy functions. */ -int clk_enable(struct clk *clk) +int clk_prepare(struct clk *clk) { int ret = 0; @@ -90,13 +95,9 @@ int clk_enable(struct clk *clk) return ret; } -EXPORT_SYMBOL(clk_enable); +EXPORT_SYMBOL(clk_prepare); -/* This function decrements the reference count on the clock and disables - * the clock when reference count is 0. The parent clock tree is - * recursively disabled - */ -void clk_disable(struct clk *clk) +void clk_unprepare(struct clk *clk) { if (clk == NULL || IS_ERR(clk)) return; @@ -105,6 +106,18 @@ void clk_disable(struct clk *clk) __clk_disable(clk); mutex_unlock(&clocks_mutex); } +EXPORT_SYMBOL(clk_unprepare); + +int clk_enable(struct clk *clk) +{ + return 0; +} +EXPORT_SYMBOL(clk_enable); + +void clk_disable(struct clk *clk) +{ + /* nothing to do */ +} EXPORT_SYMBOL(clk_disable); /* Retrieve the *current* clock rate. If the clock itself