From patchwork Tue Mar 4 03:00:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 25638 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f197.google.com (mail-pd0-f197.google.com [209.85.192.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 458F6206F3 for ; Tue, 4 Mar 2014 03:01:22 +0000 (UTC) Received: by mail-pd0-f197.google.com with SMTP id fp1sf6749723pdb.0 for ; Mon, 03 Mar 2014 19:01:21 -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 :sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=/cCseTYIn+vAIn5UX9XkeERhlvpWuDoRzsJlVzieHKY=; b=iUKdT2gLRKS8w9/4St/S8gUr6iNat3wL7VQDNA8LvM4e9SDa++jTEhS9uNCVEZ65bl F1Uw4dyK0tIqDgTuYxT1xRrM8D9oebb0MBa1S2dDNvlh5/gebCHVm+c0h8DcFMsvwZo2 5eZr8QiORcHZvNDVxgFx03azYYzFDp+SqZeO9TqIzQrAvTKXv202qxq7t3Gf8MLe5gZw urqQgMWfsW6T0bOHAnLHS5eKbpsAD2H3gKJK/rJ+JC0A5UMUFzaxudfh93PeQ48Z9Rwa gzVWSo5VNi8cXNp0IiY8pGVgJIbsQHx8Ok209KwEqfeNxUOqCl0/r0MttBsmcTn2F9U8 Qfyg== X-Gm-Message-State: ALoCoQmlG0hpE7i0+v4rFAVARzZwFyMt4PcaH7Clh+zmjyhWDAqJ2xT/LL7fYsxv3gTJOV6ziYVD X-Received: by 10.42.119.209 with SMTP id c17mr12617704icr.17.1393902081626; Mon, 03 Mar 2014 19:01:21 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.88.101 with SMTP id s92ls2471208qgd.82.gmail; Mon, 03 Mar 2014 19:01:21 -0800 (PST) X-Received: by 10.220.95.139 with SMTP id d11mr19972653vcn.21.1393902081427; Mon, 03 Mar 2014 19:01:21 -0800 (PST) Received: from mail-ve0-f173.google.com (mail-ve0-f173.google.com [209.85.128.173]) by mx.google.com with ESMTPS id i1si5452639vcl.6.2014.03.03.19.01.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 03 Mar 2014 19:01:21 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.173; Received: by mail-ve0-f173.google.com with SMTP id oy12so2641485veb.4 for ; Mon, 03 Mar 2014 19:01:21 -0800 (PST) X-Received: by 10.58.132.203 with SMTP id ow11mr20031371veb.1.1393902081346; Mon, 03 Mar 2014 19:01:21 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.130.193 with SMTP id u1csp97145vcs; Mon, 3 Mar 2014 19:01:20 -0800 (PST) X-Received: by 10.67.2.106 with SMTP id bn10mr3286612pad.38.1393902080526; Mon, 03 Mar 2014 19:01:20 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id tt8si12553146pbc.160.2014.03.03.19.01.19; Mon, 03 Mar 2014 19:01:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756199AbaCDDBD (ORCPT + 26 others); Mon, 3 Mar 2014 22:01:03 -0500 Received: from mail-pb0-f51.google.com ([209.85.160.51]:46317 "EHLO mail-pb0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756179AbaCDDBA (ORCPT ); Mon, 3 Mar 2014 22:01:00 -0500 Received: by mail-pb0-f51.google.com with SMTP id uo5so3898739pbc.38 for ; Mon, 03 Mar 2014 19:00:59 -0800 (PST) X-Received: by 10.68.143.196 with SMTP id sg4mr6890357pbb.155.1393902059602; Mon, 03 Mar 2014 19:00:59 -0800 (PST) Received: from localhost (z88l218.static.ctm.net. [202.175.88.218]) by mx.google.com with ESMTPSA id ix2sm41702839pbc.45.2014.03.03.19.00.55 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 03 Mar 2014 19:00:58 -0800 (PST) From: Viresh Kumar To: rjw@rjwysocki.net Cc: linaro-kernel@lists.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, jinchoi@broadcom.com, tianyu.lan@intel.com, sebastian.capella@linaro.org, jhbird.choi@samsung.com, Viresh Kumar Subject: [PATCH V6 Resend 4/5] cpufreq: s5pv210: Use cpufreq_generic_suspend() Date: Tue, 4 Mar 2014 11:00:29 +0800 Message-Id: X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.128.173 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 Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org 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 55a8e9f..7242153 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);