Message ID | 1412754534-14068-3-git-send-email-mturquette@linaro.org |
---|---|
State | New |
Headers | show
Return-Path: <patchwork-forward+bncBDO333VC4INBBDWZ2OQQKGQEXS6PW2Q@linaro.org> X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9C78620447 for <linaro@patches.linaro.org>; Wed, 8 Oct 2014 07:49:35 +0000 (UTC) Received: by mail-lb0-f198.google.com with SMTP id 10sf4925279lbg.9 for <linaro@patches.linaro.org>; Wed, 08 Oct 2014 00:49:34 -0700 (PDT) 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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=UtC1SqJ+jD1P5VPDUdTrRPaGvyx3Fcdqv4SicNoQ72I=; b=VyslXgKM8FrI57ALA/aJzVL0CZ3Ktlppowcm4QkuVW18rbrfSznN5Miq9ltQa8dKuv n4Xj/s6z4pvb/0rNyy9I8a9VmV3QiqbxzZPObIapmpzUvVrz0ajPh9xO0ZxkRqH9TMcy j//OY9lHRN6ofQWmCRtq8NptuCD/iV7rx/FWUv+8kF1/sZYMq1mQ1+prEMfVIBtS06yC LNG81uZDz+BimQ0/+u1pUUCyKSWgSO4JNv9Ve8v7TF6f+qHcQPP09vUZZt32B+SXKmgT 54eJzAzGe8DNub1EuwQ67eedcTkLkjSWRU9hxrEUQE9+hwhDbqEhroAsCF0WJLZguDE4 lZtw== X-Gm-Message-State: ALoCoQkJ/0gPgtKC+CyJ82aL9k7S+m46bQxZGNKgADGckmpHT8wR/sAGtdxkkIdb7sodGADtdaj8 X-Received: by 10.181.8.226 with SMTP id dn2mr1311570wid.4.1412754574503; Wed, 08 Oct 2014 00:49:34 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.38 with SMTP id p6ls27986lap.72.gmail; Wed, 08 Oct 2014 00:49:34 -0700 (PDT) X-Received: by 10.112.158.227 with SMTP id wx3mr9071583lbb.1.1412754574350; Wed, 08 Oct 2014 00:49:34 -0700 (PDT) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com [209.85.217.172]) by mx.google.com with ESMTPS id ln10si31794135lac.114.2014.10.08.00.49.33 for <patchwork-forward@linaro.org> (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 08 Oct 2014 00:49:34 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) client-ip=209.85.217.172; Received: by mail-lb0-f172.google.com with SMTP id b6so7628582lbj.31 for <patchwork-forward@linaro.org>; Wed, 08 Oct 2014 00:49:33 -0700 (PDT) X-Received: by 10.112.50.10 with SMTP id y10mr8923568lbn.0.1412754573947; Wed, 08 Oct 2014 00:49:33 -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.112.84.229 with SMTP id c5csp17994lbz; Wed, 8 Oct 2014 00:49:33 -0700 (PDT) X-Received: by 10.68.105.197 with SMTP id go5mr8620036pbb.73.1412754571448; Wed, 08 Oct 2014 00:49:31 -0700 (PDT) Received: from mail-pa0-f47.google.com (mail-pa0-f47.google.com [209.85.220.47]) by mx.google.com with ESMTPS id l13si14943290pdn.86.2014.10.08.00.49.30 for <patches@linaro.org> (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 08 Oct 2014 00:49:31 -0700 (PDT) Received-SPF: pass (google.com: domain of mturquette@linaro.org designates 209.85.220.47 as permitted sender) client-ip=209.85.220.47; Received: by mail-pa0-f47.google.com with SMTP id rd3so8673937pab.20 for <patches@linaro.org>; Wed, 08 Oct 2014 00:49:30 -0700 (PDT) X-Received: by 10.68.65.78 with SMTP id v14mr8509096pbs.75.1412754570788; Wed, 08 Oct 2014 00:49:30 -0700 (PDT) Received: from quantum.home (pool-108-47-66-231.lsanca.fios.verizon.net. [108.47.66.231]) by mx.google.com with ESMTPSA id on3sm15663577pdb.71.2014.10.08.00.49.28 for <multiple recipients> (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 08 Oct 2014 00:49:30 -0700 (PDT) From: Mike Turquette <mturquette@linaro.org> To: viresh.kumar@linaro.org Cc: thomas.petazzoni@free-electrons.com, rjw@rjwysocki.net, linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, shawn.guo@linaro.org, sboyd@codeaurora.org, linux-arm-msm@vger.kernel.org, spk.linux@gmail.com, pramod.gurav@smartplayin.com, rob.herring@linaro.org, ezequiel.garcia@free-electrons.com, tawfik@marvell.com, nadavh@marvell.com, alior@marvell.com, morten.rasmussen@arm.com, dietmar.eggemann@arm.com, vincent.guittot@linaro.org, nicolas.pitre@linaro.org, linux-kernel@vger.kernel.org, tuukka.tikkanen@linaro.org, Mike Turquette <mturquette@linaro.org> Subject: [PATCH 2/2] cpufreq: new function to query driver for flags Date: Wed, 8 Oct 2014 00:48:54 -0700 Message-Id: <1412754534-14068-3-git-send-email-mturquette@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1412754534-14068-1-git-send-email-mturquette@linaro.org> References: <CAKohpo=7q9bDcHRxLehNLX6A2idGxUy3jEWvQ+EGbKOQG-MH2g@mail.gmail.com> <1412754534-14068-1-git-send-email-mturquette@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: mturquette@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) 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: <patchwork-forward.linaro.org> X-Google-Group-Id: 836684582541 List-Post: <http://groups.google.com/a/linaro.org/group/patchwork-forward/post>, <mailto:patchwork-forward@linaro.org> List-Help: <http://support.google.com/a/linaro.org/bin/topic.py?topic=25838>, <mailto:patchwork-forward+help@linaro.org> List-Archive: <http://groups.google.com/a/linaro.org/group/patchwork-forward/> List-Unsubscribe: <mailto:googlegroups-manage+836684582541+unsubscribe@googlegroups.com>, <http://groups.google.com/a/linaro.org/group/patchwork-forward/subscribe> |
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 9b471b2..f3b9042 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -1980,6 +1980,15 @@ int cpufreq_driver_target(struct cpufreq_policy *policy, } EXPORT_SYMBOL_GPL(cpufreq_driver_target); +int cpufreq_driver_get_flags(void) +{ + if (!cpufreq_driver) + return -ENODEV; + + return cpufreq_driver->flags; +} +EXPORT_SYMBOL_GPL(cpufreq_driver_get_flags); + /* * when "event" is CPUFREQ_GOV_LIMITS */
There are cases for CPUfreq driver flags to be exposed outside of the CPUfreq core code. In particular the CPUFREQ_NO_SLEEP flag can be used by CPUfreq governors to optimize when and how they call that drivers .target callback. In fact this knowledge is a requirement for the on-going work to initiate cpu frequency transitions from the scheduler. This patch implements a simple function to return the CPUfreq driver flags. While currently the flags are a u8, that could grow at a future date and cpufreq_driver_get_flags returns an int. Additionally the function needs to return an error in case no driver is registered. Signed-off-by: Mike Turquette <mturquette@linaro.org> --- drivers/cpufreq/cpufreq.c | 9 +++++++++ 1 file changed, 9 insertions(+)