From patchwork Mon Nov 25 14:11:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 3231861 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0314E9F3AE for ; Mon, 25 Nov 2013 14:13:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3AAF420171 for ; Mon, 25 Nov 2013 14:13:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7036020221 for ; Mon, 25 Nov 2013 14:13:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757673Ab3KYONT (ORCPT ); Mon, 25 Nov 2013 09:13:19 -0500 Received: from mail-pd0-f180.google.com ([209.85.192.180]:48211 "EHLO mail-pd0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757119Ab3KYOMm (ORCPT ); Mon, 25 Nov 2013 09:12:42 -0500 Received: by mail-pd0-f180.google.com with SMTP id q10so5556055pdj.11 for ; Mon, 25 Nov 2013 06:12:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=oizR2h8tmugrDGVvmICy0LILwAr7kMkpTmYzbuQTKxQ=; b=Fr+4TD3ZTaAchXFBtdFkKcj9b8+PFOuPp9V6ez3H0PDr90L5Ezb4mZ9vcVeCkGeVPl eP0e9XacgDpcaBqR+H2UvH98qZiPhlvHZdfSM3zHoyWxV0Qf5tY8ioMaBMg/JIjbl5hI aD6T9nXyBW3MHT97RJZf9R4grzgKcFif1mBYi5vloktInKIu12GuAHl/RIQZfuX2JFFh dzsDDLOyY0rtMojarDR68PgiPLwTd01FXTxtJd5criUMKj9AJeyUIw46nl9txR9Wh5IT 6Gz7R0t0d9Danb3DH0iR7p6OHg4PHb6Rfz9lPwB1wiqm+jNrk//b3k/L/5T7iwIkINYc F8tg== X-Gm-Message-State: ALoCoQm9InoHJ2LvxXZE03MjLDBksvUn6sD/F3NapwFkfpGelcpzkcBxn7fBndYR2ZjF+xLm5pC4 X-Received: by 10.68.170.66 with SMTP id ak2mr27462189pbc.5.1385388762189; Mon, 25 Nov 2013 06:12:42 -0800 (PST) Received: from localhost ([122.167.133.207]) by mx.google.com with ESMTPSA id gf5sm73584169pbc.22.2013.11.25.06.12.37 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 25 Nov 2013 06:12:41 -0800 (PST) From: Viresh Kumar To: rjw@rjwysocki.net Cc: linaro-kernel@lists.linaro.org, patches@linaro.org, cpufreq@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, nm@ti.com, swarren@wwwdotorg.org, kgene.kim@samsung.com, linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org, jinchoi@broadcom.com, tianyu.lan@intel.com, sebastian.capella@linaro.org, jhbird.choi@samsung.com, Viresh Kumar Subject: [PATCH V3 5/6] cpufreq: s5pv210: Use cpufreq_generic_suspend() Date: Mon, 25 Nov 2013 19:41:45 +0530 Message-Id: <1147f4293a630d460daeb4ac4042aadb57221df5.1385374822.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e In-Reply-To: References: In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently we have implemented PM notifiers to disable/enable ->target() routines functionality during suspend/resume. Now we have support present in cpufreq core, lets use it. Signed-off-by: Viresh Kumar --- drivers/cpufreq/s5pv210-cpufreq.c | 49 +++------------------------------------ 1 file changed, 3 insertions(+), 46 deletions(-) diff --git a/drivers/cpufreq/s5pv210-cpufreq.c b/drivers/cpufreq/s5pv210-cpufreq.c index e3973da..89c052e 100644 --- a/drivers/cpufreq/s5pv210-cpufreq.c +++ b/drivers/cpufreq/s5pv210-cpufreq.c @@ -18,7 +18,6 @@ #include #include #include -#include #include #include @@ -444,18 +443,6 @@ exit: return ret; } -#ifdef CONFIG_PM -static int s5pv210_cpufreq_suspend(struct cpufreq_policy *policy) -{ - return 0; -} - -static int s5pv210_cpufreq_resume(struct cpufreq_policy *policy) -{ - return 0; -} -#endif - static int check_mem_type(void __iomem *dmc_reg) { unsigned long val; @@ -511,6 +498,7 @@ static int __init s5pv210_cpu_init(struct cpufreq_policy *policy) s5pv210_dram_conf[1].refresh = (__raw_readl(S5P_VA_DMC1 + 0x30) * 1000); s5pv210_dram_conf[1].freq = clk_get_rate(dmc1_clk); + policy->suspend_freq = SLEEP_FREQ; return cpufreq_generic_init(policy, s5pv210_freq_table, 40000); out_dmc1: @@ -520,32 +508,6 @@ out_dmc0: return ret; } -static int s5pv210_cpufreq_notifier_event(struct notifier_block *this, - unsigned long event, void *ptr) -{ - int ret; - - switch (event) { - case PM_SUSPEND_PREPARE: - ret = cpufreq_driver_target(cpufreq_cpu_get(0), SLEEP_FREQ, 0); - if (ret < 0) - return NOTIFY_BAD; - - /* Disable updation of cpu frequency */ - no_cpufreq_access = true; - return NOTIFY_OK; - case PM_POST_RESTORE: - case PM_POST_SUSPEND: - /* Enable updation of cpu frequency */ - no_cpufreq_access = false; - cpufreq_driver_target(cpufreq_cpu_get(0), SLEEP_FREQ, 0); - - return NOTIFY_OK; - } - - return NOTIFY_DONE; -} - static int s5pv210_cpufreq_reboot_notifier_event(struct notifier_block *this, unsigned long event, void *ptr) { @@ -567,15 +529,11 @@ static struct cpufreq_driver s5pv210_driver = { .init = s5pv210_cpu_init, .name = "s5pv210", #ifdef CONFIG_PM - .suspend = s5pv210_cpufreq_suspend, - .resume = s5pv210_cpufreq_resume, + .suspend = cpufreq_generic_suspend, + .resume = cpufreq_generic_suspend, /* We need to set SLEEP FREQ again */ #endif }; -static struct notifier_block s5pv210_cpufreq_notifier = { - .notifier_call = s5pv210_cpufreq_notifier_event, -}; - static struct notifier_block s5pv210_cpufreq_reboot_notifier = { .notifier_call = s5pv210_cpufreq_reboot_notifier_event, }; @@ -595,7 +553,6 @@ static int __init s5pv210_cpufreq_init(void) return PTR_ERR(int_regulator); } - register_pm_notifier(&s5pv210_cpufreq_notifier); register_reboot_notifier(&s5pv210_cpufreq_reboot_notifier); return cpufreq_register_driver(&s5pv210_driver);