From mboxrd@z Thu Jan 1 00:00:00 1970 From: Viresh Kumar Subject: Re: [PATCH v3 2/3] cpufreq-dt: add suspend frequency support Date: Mon, 7 Sep 2015 11:28:23 +0530 Message-ID: <20150907055823.GC26760@linux> References: <1441303892-32004-1-git-send-email-b.zolnierkie@samsung.com> <1441303892-32004-3-git-send-email-b.zolnierkie@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <1441303892-32004-3-git-send-email-b.zolnierkie@samsung.com> Sender: linux-clk-owner@vger.kernel.org To: Bartlomiej Zolnierkiewicz Cc: Thomas Abraham , Kukjin Kim , Kukjin Kim , Krzysztof Kozlowski , Marek Szyprowski , "Rafael J. Wysocki" , Sylwester Nawrocki , Michael Turquette , Tomasz Figa , Lukasz Majewski , Heiko Stuebner , Chanwoo Choi , Kevin Hilman , Javier Martinez Canillas , Tobias Jakobi , Anand Moon , linux-samsung-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org List-Id: linux-pm@vger.kernel.org On 03-09-15, 20:11, Bartlomiej Zolnierkiewicz wrote: > Add suspend frequency support and if needed set it to > the frequency obtained from the suspend opp (can be defined > using opp-v2 bindings and is optional). Also implement > custom suspend method (needed to not error out on platforms > which don't require suspend frequency). > > Cc: Viresh Kumar > Cc: Thomas Abraham > Cc: Javier Martinez Canillas > Cc: Krzysztof Kozlowski > Cc: Marek Szyprowski > Cc: Tobias Jakobi > Signed-off-by: Bartlomiej Zolnierkiewicz > --- > drivers/cpufreq/cpufreq-dt.c | 32 ++++++++++++++++++++++++++++++++ > 1 file changed, 32 insertions(+) > > diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c > +#ifdef CONFIG_PM > +static int cpufreq_dt_suspend(struct cpufreq_policy *policy) > +{ > + int ret; > + > + if (!policy->suspend_freq) { > + pr_debug("%s: suspend_freq not defined\n", __func__); > + return 0; > + } > + > + pr_debug("%s: Setting suspend-freq: %u\n", __func__, > + policy->suspend_freq); > + > + ret = __cpufreq_driver_target(policy, policy->suspend_freq, > + CPUFREQ_RELATION_H); > + if (ret) > + pr_err("%s: unable to set suspend-freq: %u. err: %d\n", > + __func__, policy->suspend_freq, ret); > + > + return ret; > +} > +#else > +#define cpufreq_dt_suspend NULL > +#endif No, there is no point replicating the exactly same routine again. Rather modify cpufreq_generic_suspend() to not print error and instead do pr_debug(), on !policy->suspend_freq. -- viresh