From patchwork Mon Dec 2 05:52:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 21916 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f71.google.com (mail-qe0-f71.google.com [209.85.128.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5C92320DB9 for ; Mon, 2 Dec 2013 05:53:02 +0000 (UTC) Received: by mail-qe0-f71.google.com with SMTP id b10sf22241217qen.2 for ; Sun, 01 Dec 2013 21:53:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:in-reply-to:references :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=ENgbFlbpqq7PncwXqSJ9fRDY1fbrFIfILlIfChchpyk=; b=m9t+p++IYYQ4FO5sqTv6wJfFK6H2lfyCn0cqwxgt9zWLYqMg0r65yJBzGYZqyrGatX xrRIu3Ssk3e7/V1jvmoTIN98GPA7l09AXP8RYwdKyjY6yvpKXakdP3yK3XWl21Tl5eQj sKTUb2+rwN4xr4Du7x55e0QjFapPi+HuhTsyEuJ61OQ9Jb8IgEwRn+rr6PhECyD3gnQV lDH0Xm00qH4PPhogG+AKfzWO8PuTEHKVmb/pxRtgBNrJFuRYZzwSzPg1pw4iBU/Q81mA ON9L8U4xda104YqLT0HSo6wxcsaq5Gy63XKqlpD9FDcnlx9vUacarivpNh06djKL7na8 Sb6Q== X-Gm-Message-State: ALoCoQmON5aKbiAw0quep9yoPM6zVASt/p3jLjPlZ5onMluw3YZ/xeMpVEQ/uCYBMcmleT5jnecJ X-Received: by 10.52.248.195 with SMTP id yo3mr18012091vdc.1.1385963581835; Sun, 01 Dec 2013 21:53:01 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.64.231 with SMTP id r7ls2663389qes.78.gmail; Sun, 01 Dec 2013 21:53:01 -0800 (PST) X-Received: by 10.220.199.5 with SMTP id eq5mr51549542vcb.16.1385963581742; Sun, 01 Dec 2013 21:53:01 -0800 (PST) Received: from mail-vb0-f48.google.com (mail-vb0-f48.google.com [209.85.212.48]) by mx.google.com with ESMTPS id xt2si29019104vcb.108.2013.12.01.21.53.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 01 Dec 2013 21:53:01 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.48 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.48; Received: by mail-vb0-f48.google.com with SMTP id x16so7980437vbf.7 for ; Sun, 01 Dec 2013 21:53:01 -0800 (PST) X-Received: by 10.52.233.197 with SMTP id ty5mr157375vdc.48.1385963581673; Sun, 01 Dec 2013 21:53:01 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp92661vcz; Sun, 1 Dec 2013 21:53:01 -0800 (PST) X-Received: by 10.229.5.4 with SMTP id 4mr109960106qct.2.1385963581267; Sun, 01 Dec 2013 21:53:01 -0800 (PST) Received: from mail-qe0-f50.google.com (mail-qe0-f50.google.com [209.85.128.50]) by mx.google.com with ESMTPS id e16si48432867qej.15.2013.12.01.21.53.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 01 Dec 2013 21:53:01 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.50 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.128.50; Received: by mail-qe0-f50.google.com with SMTP id 1so10912313qec.9 for ; Sun, 01 Dec 2013 21:53:01 -0800 (PST) X-Received: by 10.49.131.5 with SMTP id oi5mr69023141qeb.38.1385963581115; Sun, 01 Dec 2013 21:53:01 -0800 (PST) Received: from localhost (git.linaro.org. [54.235.93.228]) by mx.google.com with ESMTPSA id hb2sm20856502qeb.6.2013.12.01.21.52.59 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 01 Dec 2013 21:53:00 -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, tianyu.lan@intel.com, jhbird.choi@samsung.com, Viresh Kumar Subject: [PATCH V4 5/6] cpufreq: s5pv210: Use cpufreq_generic_suspend() Date: Mon, 2 Dec 2013 11:22:35 +0530 Message-Id: X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e In-Reply-To: References: In-Reply-To: References: X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.48 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 da0e291..72e77eb 100644 --- a/drivers/cpufreq/s5pv210-cpufreq.c +++ b/drivers/cpufreq/s5pv210-cpufreq.c @@ -18,7 +18,6 @@ #include #include #include -#include #include #include @@ -435,18 +434,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; @@ -502,6 +489,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: @@ -511,32 +499,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) { @@ -558,15 +520,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, }; @@ -586,7 +544,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);