Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756445Ab3CNJq7 (ORCPT ); Thu, 14 Mar 2013 05:46:59 -0400 Received: from hqemgate04.nvidia.com ([216.228.121.35]:15694 "EHLO hqemgate04.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752477Ab3CNJq5 (ORCPT ); Thu, 14 Mar 2013 05:46:57 -0400 X-PGP-Universal: processed; by hqnvupgp08.nvidia.com on Thu, 14 Mar 2013 02:40:14 -0700 Message-ID: <1363254687.3311.35.camel@bilhuang-vm1> Subject: Re: [RFC v2 1/1] clk: Add notifier support in clk_prepare/clk_unprepare From: Bill Huang To: "mturquette@linaro.org" CC: "patches@linaro.org" , "linux-kernel@vger.kernel.org" , "linaro-dev@lists.linaro.org" , "linux-arm-kernel@lists.infradead.org" Date: Thu, 14 Mar 2013 02:51:27 -0700 In-Reply-To: <1363253464-3200-1-git-send-email-bilhuang@nvidia.com> References: <1363253464-3200-1-git-send-email-bilhuang@nvidia.com> X-Mailer: Evolution 3.2.3-0ubuntu6 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-9" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1819 Lines: 56 On Thu, 2013-03-14 at 17:31 +0800, Bill Huang wrote: > Add the below two notifier events so drivers which are interested in > knowing the clock status can act accordingly. This is extremely useful > in some of the DVFS (Dynamic Voltage Frequency Scaling) design. > > CLK_PREPARED > CLK_UNPREPARED > > Signed-off-by: Bill Huang > --- > drivers/clk/clk.c | 3 +++ > include/linux/clk.h | 2 ++ > 2 files changed, 5 insertions(+) > > diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c > index ed87b24..3292cec 100644 > --- a/drivers/clk/clk.c > +++ b/drivers/clk/clk.c > @@ -550,6 +550,7 @@ void clk_unprepare(struct clk *clk) > { > mutex_lock(&prepare_lock); > __clk_unprepare(clk); > + __clk_notify(clk, CLK_UNPREPARED, clk->rate, clk->rate); > mutex_unlock(&prepare_lock); > } > EXPORT_SYMBOL_GPL(clk_unprepare); > @@ -598,6 +599,8 @@ int clk_prepare(struct clk *clk) > > mutex_lock(&prepare_lock); > ret = __clk_prepare(clk); > + if (!ret) > + __clk_notify(clk, CLK_PREPARED, clk->rate, clk->rate); > mutex_unlock(&prepare_lock); > > return ret; > diff --git a/include/linux/clk.h b/include/linux/clk.h > index b3ac22d..16c1d92 100644 > --- a/include/linux/clk.h > +++ b/include/linux/clk.h > @@ -43,6 +43,8 @@ struct clk; > #define PRE_RATE_CHANGE BIT(0) > #define POST_RATE_CHANGE BIT(1) > #define ABORT_RATE_CHANGE BIT(2) > +#define CLK_PREPARED BIT(3) > +#define CLK_UNPREPARED BIT(4) > > /** > * struct clk_notifier - associate a clk with a notifier Sorry, I'll send v3 since this bread build. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/