From patchwork Tue Aug 13 13:32:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19067 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f71.google.com (mail-yh0-f71.google.com [209.85.213.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9E29D246B8 for ; Tue, 13 Aug 2013 13:34:39 +0000 (UTC) Received: by mail-yh0-f71.google.com with SMTP id f64sf9474972yha.10 for ; Tue, 13 Aug 2013 06:34:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-gm-message-state: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=Ui+djp1jQRKYS3hN8l6p1GXiwNYaZDYFxp/jKSZQqZQ=; b=Z3FEfNsyJ6N2ElHgCMcSqJxBRrvIZNYabziIPukDD8H5vFFPtzdLwClkjPeazDcQV9 r+t98rZzzOan3X3N5azJORPKF3HN9SABV+FrU9FbHZG3zbAgV3qSW8WI3mLcTm12zuQA VhSxNZhkLgREj73e8f6wfOekzoKq/woClS7VsC0tQ8x1ikVlk90DzQ0dT0Qd7tMnRo0K de6aZlHFha9qY8jF4mB36GOqvp4Puzo596feYCGCw9sruRZ2YfCRBPOTrGHXHMlL4E1C p6wwXnuoZjMuP+RZz9UzfYfSwcxdS+xw5SB1o3J4TQ3/lmElGTiVDMP4aF4fL4J1cp73 lucw== X-Received: by 10.236.54.8 with SMTP id h8mr1661776yhc.11.1376400879368; Tue, 13 Aug 2013 06:34:39 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.51.66 with SMTP id i2ls2771361qeo.87.gmail; Tue, 13 Aug 2013 06:34:39 -0700 (PDT) X-Received: by 10.52.103.35 with SMTP id ft3mr3796113vdb.5.1376400879260; Tue, 13 Aug 2013 06:34:39 -0700 (PDT) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by mx.google.com with ESMTPS id s7si9744401vcr.99.2013.08.13.06.34.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:34:39 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.170; Received: by mail-vc0-f170.google.com with SMTP id kw10so3866284vcb.15 for ; Tue, 13 Aug 2013 06:34:39 -0700 (PDT) X-Gm-Message-State: ALoCoQl4z1Kx8QrgBH86NsM946RXQnZrnOPwJqLfIrm9XpYJnIZP+nyuQWFx/2ztRd2534FoBZmh X-Received: by 10.220.91.16 with SMTP id k16mr4551200vcm.21.1376400879183; Tue, 13 Aug 2013 06:34:39 -0700 (PDT) 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 u4csp154185vcz; Tue, 13 Aug 2013 06:34:38 -0700 (PDT) X-Received: by 10.68.216.33 with SMTP id on1mr4652958pbc.107.1376400878222; Tue, 13 Aug 2013 06:34:38 -0700 (PDT) Received: from mail-pa0-f52.google.com (mail-pa0-f52.google.com [209.85.220.52]) by mx.google.com with ESMTPS id c10si26261239pav.84.2013.08.13.06.34.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:34:38 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.52 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.220.52; Received: by mail-pa0-f52.google.com with SMTP id kq13so8858699pab.11 for ; Tue, 13 Aug 2013 06:34:37 -0700 (PDT) X-Received: by 10.66.241.34 with SMTP id wf2mr4541863pac.111.1376400877101; Tue, 13 Aug 2013 06:34:37 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id zv11sm46880917pab.3.2013.08.13.06.34.33 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:34:36 -0700 (PDT) From: Viresh Kumar To: rjw@sisk.pl Cc: linaro-kernel@lists.linaro.org, patches@linaro.org, cpufreq@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Viresh Kumar Subject: [PATCH V2 12/35] cpufreq: elanfreq: Covert to light weight ->target_index() routine Date: Tue, 13 Aug 2013 19:02:25 +0530 Message-Id: <0a825b2230fe4609d1d50b9e18515ab983867232.1376392602.git.viresh.kumar@linaro.org> 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.220.170 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: , This patch converts existing .target() to newly defined light weight .target_index() routine for this driver. CPUFreq core will call cpufreq_frequency_table_target() before calling this routine and will pass index to it. Signed-off-by: Viresh Kumar --- drivers/cpufreq/elanfreq.c | 34 +++------------------------------- 1 file changed, 3 insertions(+), 31 deletions(-) diff --git a/drivers/cpufreq/elanfreq.c b/drivers/cpufreq/elanfreq.c index fe7053c..0d133a7 100644 --- a/drivers/cpufreq/elanfreq.c +++ b/drivers/cpufreq/elanfreq.c @@ -105,20 +105,8 @@ static unsigned int elanfreq_get_cpu_frequency(unsigned int cpu) } -/** - * elanfreq_set_cpu_frequency: Change the CPU core frequency - * @cpu: cpu number - * @freq: frequency in kHz - * - * This function takes a frequency value and changes the CPU frequency - * according to this. Note that the frequency has to be checked by - * elanfreq_validatespeed() for correctness! - * - * There is no return value. - */ - -static void elanfreq_set_cpu_state(struct cpufreq_policy *policy, - unsigned int state) +static int elanfreq_target(struct cpufreq_policy *policy, + unsigned int state) { struct cpufreq_freqs freqs; @@ -162,25 +150,9 @@ static void elanfreq_set_cpu_state(struct cpufreq_policy *policy, local_irq_enable(); cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); -}; - - -static int elanfreq_target(struct cpufreq_policy *policy, - unsigned int target_freq, - unsigned int relation) -{ - unsigned int newstate = 0; - - if (cpufreq_frequency_table_target(policy, &elanfreq_table[0], - target_freq, relation, &newstate)) - return -EINVAL; - - elanfreq_set_cpu_state(policy, newstate); return 0; } - - /* * Module init and exit code */ @@ -238,7 +210,7 @@ __setup("elanfreq=", elanfreq_setup); static struct cpufreq_driver elanfreq_driver = { .get = elanfreq_get_cpu_frequency, .verify = cpufreq_generic_frequency_table_verify, - .target = elanfreq_target, + .target_index = elanfreq_target, .init = elanfreq_cpu_init, .exit = cpufreq_generic_exit, .name = "elanfreq",