From patchwork Fri Sep 13 12:59:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 2891031 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 31A82BFF05 for ; Fri, 13 Sep 2013 16:48:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 409B0202A7 for ; Fri, 13 Sep 2013 16:48:02 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EAF6620299 for ; Fri, 13 Sep 2013 16:48:00 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VKT4s-0003c3-G6; Fri, 13 Sep 2013 13:06:27 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VKT3u-0005Si-JO; Fri, 13 Sep 2013 13:05:26 +0000 Received: from mail-pb0-f46.google.com ([209.85.160.46]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VKT32-0005GE-M8 for linux-arm-kernel@lists.infradead.org; Fri, 13 Sep 2013 13:04:36 +0000 Received: by mail-pb0-f46.google.com with SMTP id rq2so1210655pbb.33 for ; Fri, 13 Sep 2013 06:04:11 -0700 (PDT) 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=WFK4IrZt7xF4fhWWfjoAioUNKzMx5dN1Fz3Ukv6S158=; b=gxNms64v6HY3Yim7fWULbHCDJFlPY9h1gY/EmlCM7oT1fkMMmpiVgONuVBNEQngL3B uGaKt/qT2ohiU3Zq4Ix1m9x8xTvxbUqDyrRbAavMQLekBAe4C+ozIoinjgtPmcFsjAL+ QsJdBOTJm/68vnYeFq9I9qNGjnwLmMGHcHPt456H6LTWYOGA/3+g+IMkmxZ/FgR4VbGP g+YSpZX75eZzxCsyrTlUdRWjOoxG1kVibOQaAJIry3yVNidMSaiz4sYWHdv67U0kIzbk pajv7dwzFafuTmv4IoPHTMOpUZOztNSaPnweQeojGNFmv9ciguxjksgry9AKn1Pxw6Zo PcMw== X-Gm-Message-State: ALoCoQmUMdcG1XTmBOsZzahS7pFJlj2OccLOWxup9c2UnETedZrAQc6s792fFCbG6dT/Aq5+UAWs X-Received: by 10.66.139.166 with SMTP id qz6mr15415672pab.88.1379077451097; Fri, 13 Sep 2013 06:04:11 -0700 (PDT) Received: from localhost ([122.167.78.148]) by mx.google.com with ESMTPSA id tz3sm11647817pbc.20.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:04:10 -0700 (PDT) From: Viresh Kumar To: rjw@sisk.pl Subject: [PATCH 010/228] cpufreq: pxa: call cpufreq_frequency_table_get_attr() Date: Fri, 13 Sep 2013 18:29:16 +0530 Message-Id: <44ca549f392bb5fbf3536918cfa0cc4f7a09f891.1379063063.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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130913_090432_887704_E16E8C32 X-CRM114-Status: GOOD ( 12.54 ) X-Spam-Score: -2.6 (--) Cc: linaro-kernel@lists.linaro.org, Eric Miao , linux-pm@vger.kernel.org, Viresh Kumar , patches@linaro.org, linux-kernel@vger.kernel.org, cpufreq@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 This exposes frequency table of driver to cpufreq core and is required for core to guess what the index for a target frequency is, when it calls cpufreq_frequency_table_target(). And so this driver needs to expose it. Cc: Eric Miao Signed-off-by: Viresh Kumar --- drivers/cpufreq/pxa2xx-cpufreq.c | 6 +++++- drivers/cpufreq/pxa3xx-cpufreq.c | 8 ++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/cpufreq/pxa2xx-cpufreq.c b/drivers/cpufreq/pxa2xx-cpufreq.c index 8749eaf18..5b8ce9a 100644 --- a/drivers/cpufreq/pxa2xx-cpufreq.c +++ b/drivers/cpufreq/pxa2xx-cpufreq.c @@ -453,10 +453,14 @@ static int pxa_cpufreq_init(struct cpufreq_policy *policy) find_freq_tables(&pxa255_freq_table, &pxa255_freqs); pr_info("PXA255 cpufreq using %s frequency table\n", pxa255_turbo_table ? "turbo" : "run"); + cpufreq_frequency_table_cpuinfo(policy, pxa255_freq_table); + cpufreq_frequency_table_get_attr(pxa255_freq_table, policy->cpu); } - else if (cpu_is_pxa27x()) + else if (cpu_is_pxa27x()) { cpufreq_frequency_table_cpuinfo(policy, pxa27x_freq_table); + cpufreq_frequency_table_get_attr(pxa27x_freq_table, policy->cpu); + } printk(KERN_INFO "PXA CPU frequency change support initialized\n"); diff --git a/drivers/cpufreq/pxa3xx-cpufreq.c b/drivers/cpufreq/pxa3xx-cpufreq.c index d26306f..8f14234 100644 --- a/drivers/cpufreq/pxa3xx-cpufreq.c +++ b/drivers/cpufreq/pxa3xx-cpufreq.c @@ -91,7 +91,7 @@ static int setup_freqs_table(struct cpufreq_policy *policy, struct pxa3xx_freq_info *freqs, int num) { struct cpufreq_frequency_table *table; - int i; + int i, ret; table = kzalloc((num + 1) * sizeof(*table), GFP_KERNEL); if (table == NULL) @@ -108,7 +108,11 @@ static int setup_freqs_table(struct cpufreq_policy *policy, pxa3xx_freqs_num = num; pxa3xx_freqs_table = table; - return cpufreq_frequency_table_cpuinfo(policy, table); + ret = cpufreq_frequency_table_cpuinfo(policy, table); + if (!ret) + cpufreq_frequency_table_get_attr(table, policy->cpu); + + return ret; } static void __update_core_freq(struct pxa3xx_freq_info *info)