From patchwork Wed Apr 19 05:29:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 97605 Delivered-To: patch@linaro.org Received: by 10.140.109.52 with SMTP id k49csp159895qgf; Tue, 18 Apr 2017 22:33:47 -0700 (PDT) X-Received: by 10.84.229.7 with SMTP id b7mr1590591plk.72.1492580027884; Tue, 18 Apr 2017 22:33:47 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u4si1301953pgo.283.2017.04.18.22.33.47; Tue, 18 Apr 2017 22:33:47 -0700 (PDT) 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; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760039AbdDSFdn (ORCPT + 17 others); Wed, 19 Apr 2017 01:33:43 -0400 Received: from mail-pf0-f173.google.com ([209.85.192.173]:34865 "EHLO mail-pf0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759885AbdDSFbF (ORCPT ); Wed, 19 Apr 2017 01:31:05 -0400 Received: by mail-pf0-f173.google.com with SMTP id v14so3357162pfd.2 for ; Tue, 18 Apr 2017 22:31:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=962dFnpTkV5Ezk0cE/xseT2XrhtVFda/qpZ+2+FxAl8=; b=ZzdV7cqpX6nPuU/Iy2W5vLpOjybVGoCi093F8ubqwzzDc/PuqmOwqribn0adS+TJ6x f8PcDL1ep7GW6ZxbYBPHPHuiqs4QWx9pGXi5dYr3mCsqZuZPvKUY/nJPv5Vsa89Y5m5D SEmp6yaYob7W+rKPbMHgC1zv9ojXTAtWwJesA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=962dFnpTkV5Ezk0cE/xseT2XrhtVFda/qpZ+2+FxAl8=; b=EURNvgkdOHm7AKjRoTDf5JpN8sTlp1QW8vAwJSwwFBPV6WOe78QqSI4iKG5u14PIFY h68A1C7lW6ZaaYXYoIAQIMNn8b/GizxDSswCkC8FDrKfZ+uBVFR29R+ryrlYMRInN8jK VbRxGOLholuVp5m8785JEM8LItBqWRAkzsycKtnEBbgkfBpSWHf32HiUVojK1ZU9j5SF XTl6fiVNlRNl15jbwr3Bc8ExGKQEei3WH8wf+o01+v32Dkb5+PKqWvGmF9pmXMaWf4P6 kEHdqRCuYAlKTvAv/G9VvhEmx3EMNicmm84tOpYEuICRHuVupIlGYJnIuj/Tomac3jIN KUpw== X-Gm-Message-State: AN3rC/4aVrSEo0FxEBLWGjf1OwjxjRpq7YnkYJKZjd8oVSMtB/WGFenn JTiYO6qKIO2oE7j/ X-Received: by 10.84.225.129 with SMTP id u1mr1534617plj.123.1492579864796; Tue, 18 Apr 2017 22:31:04 -0700 (PDT) Received: from localhost ([122.172.121.5]) by smtp.gmail.com with ESMTPSA id y6sm1674400pgc.40.2017.04.18.22.31.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Apr 2017 22:31:04 -0700 (PDT) From: Viresh Kumar To: Javi Merino , Zhang Rui , Eduardo Valentin , Lukasz Luba , Amit Daniel Kachhap , Viresh Kumar Cc: linaro-kernel@lists.linaro.org, Rafael Wysocki , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Vincent Guittot , Punit Agrawal Subject: [PATCH V3 09/17] thermal: cpu_cooling: store cpufreq policy Date: Wed, 19 Apr 2017 10:59:04 +0530 Message-Id: X-Mailer: git-send-email 2.12.0.432.g71c3a4f4ba37 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The cpufreq policy can be used by the cpu_cooling driver, lets store it in the cpufreq_cooling_device structure. Signed-off-by: Viresh Kumar --- drivers/thermal/cpu_cooling.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.12.0.432.g71c3a4f4ba37 diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c index 55ff45c1e917..7dddc7443f5d 100644 --- a/drivers/thermal/cpu_cooling.c +++ b/drivers/thermal/cpu_cooling.c @@ -67,6 +67,7 @@ struct power_table { * registered. * @cdev: thermal_cooling_device pointer to keep track of the * registered cooling device. + * @policy: cpufreq policy. * @cpufreq_state: integer value representing the current state of cpufreq * cooling devices. * @clipped_freq: integer value representing the absolute value of the clipped @@ -91,6 +92,7 @@ struct power_table { struct cpufreq_cooling_device { int id; struct thermal_cooling_device *cdev; + struct cpufreq_policy *policy; unsigned int cpufreq_state; unsigned int clipped_freq; unsigned int max_level; @@ -760,6 +762,7 @@ __cpufreq_cooling_register(struct device_node *np, if (!cpufreq_cdev) return ERR_PTR(-ENOMEM); + cpufreq_cdev->policy = policy; num_cpus = cpumask_weight(policy->related_cpus); cpufreq_cdev->time_in_idle = kcalloc(num_cpus, sizeof(*cpufreq_cdev->time_in_idle),