From patchwork Wed Nov 15 09:19:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 118924 Delivered-To: patch@linaro.org Received: by 10.80.225.132 with SMTP id k4csp3270918edl; Wed, 15 Nov 2017 01:21:37 -0800 (PST) X-Google-Smtp-Source: AGs4zMYnEHY53/iBWNwA7MmV47v1bUtTRikDmuXqRlJmwH8i3My4xT/bA2QlxgB7zxX5q/wo5LbU X-Received: by 10.98.153.74 with SMTP id d71mr16900506pfe.145.1510737697529; Wed, 15 Nov 2017 01:21:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510737697; cv=none; d=google.com; s=arc-20160816; b=qrC7oiZyB/9VlOU689wkaoIHct9R5jVC6jnq+brb0T6eVsN9Gx/ISTbEtkcw8sTqlm HSxzGN+c2+rFkO865IygqbsRgL0dJyHE+XnMvLGmS8uVI0/Jy2mQyoMsMtQeuejcZ+Y8 KM5FtPB7Y646BlcS0SJMjiAoXVbDvHYNGIkAetuMQ9ptWI5VOUUiM9IdLvYsp7i/pfkk hdrkmzQAngIoQrfPkzbAus3VfiQkvQrMjXavaPfdk1NYMPVxIJQ+DV64LkwmgKSUZFLp 9PtKp6BoBv/oi8gicozFDs4yVGNyEcDEF3zQYKdMWtEvu715hbPZd3M3+3kVFEw648pP h7/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=00jhrMsXYROOvfOXIH6zkPKcNIfw5UmUWuWYaaQ8ikk=; b=dJXF/UdFui1AblSh75TsYB3H+pQna4HrdT/WFt6KR6GJwGbDJ2cy5yN14UNpP8jtK3 jnhLXpTlvJhafJKyLthfI+81za3YQKdamK9G/6SD7D4oDKyRoAIwSZKort135CywL2Yk vReosd1pWrGHsn+mNM7GuudRmReAGaXLVpzrdjDP2cvAMX2oc4SvKQqX9bSn8LcgbNcU gOENMF3sKCnQRhudbcv++7L94qI5zrV+lEvRHBW6Xs6dWvq+4LZQz4nuIO3hT5ZI01Xj iCdq5YRltSj3iU2jrJnMSu9kLl7zKSbO4FEe42lBUvG6p7NWnHGAufyC65n1g2HjWdQy DXvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bG4z8hS8; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s188si16781031pgb.646.2017.11.15.01.21.37; Wed, 15 Nov 2017 01:21:37 -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; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bG4z8hS8; 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 S1757121AbdKOJVe (ORCPT + 28 others); Wed, 15 Nov 2017 04:21:34 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:48691 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756718AbdKOJVA (ORCPT ); Wed, 15 Nov 2017 04:21:00 -0500 Received: by mail-pg0-f68.google.com with SMTP id s11so12126769pgc.5 for ; Wed, 15 Nov 2017 01:21:00 -0800 (PST) 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=00jhrMsXYROOvfOXIH6zkPKcNIfw5UmUWuWYaaQ8ikk=; b=bG4z8hS8/SouF+o6WvJek+gtYsCh+StfQmGUPArAv1O4I8lCpTF3v3fbX2iJmo2UeJ CrwjDEc1Yvvq2fioN9J6UVU6eA1gPckOWof3vsfiwanOT9tJGL/wgpE3QS6AZpOE9vAS /niYklDF5CbOYurmKYqK0w63YeKjBNvDciygY= 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=00jhrMsXYROOvfOXIH6zkPKcNIfw5UmUWuWYaaQ8ikk=; b=iAPKqdBLEkwnmp4TcqJKTedKJssxDlH79StmwiIRRuKuFoOo0+seNmznevLomiAALK CN2MH2QntQR2fLvPom4S7uZi1EjR6q5HokVz6BMHD08QotHdHS/Dxqp0WVcV+uX6LHWF 7f6UnAluq8C8rGyVS7Cto3kWlET+tCTNsB83ZQOXKc88hrXRUALHiIXupELeMS/fNx4L Qk9Xb3bbC4jMEPMbfsVtc2y20dKc9bYeH2yCe89ICzgKGzZejFCRSBpGQml7uiJY7/Sp xb+3k2AQ++iZb/xhtk79jlks8R9XJ+MCEWQqN5LXJytNeAP2YljcWEi2RbACIycbldcQ 5A5A== X-Gm-Message-State: AJaThX7MQfW2dxuMqOaY1ubj91Oyvk1jret77jd1Wz0gQGiNM8gdJ8Xe b9OyvZ6IjwxkRj96FZ4+r/RUVA== X-Received: by 10.98.127.149 with SMTP id a143mr13676665pfd.65.1510737660052; Wed, 15 Nov 2017 01:21:00 -0800 (PST) Received: from localhost ([122.171.67.221]) by smtp.gmail.com with ESMTPSA id d2sm14576000pfe.164.2017.11.15.01.20.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Nov 2017 01:20:59 -0800 (PST) From: Viresh Kumar To: Rafael Wysocki , edubezval@gmail.com, Amit Daniel Kachhap , Javi Merino , Jonathan Corbet , Zhang Rui Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , lukasz.luba@arm.com, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Subject: [PATCH 2/4] cpu_cooling: Remove unused cpufreq_power_cooling_register() Date: Wed, 15 Nov 2017 14:49:46 +0530 Message-Id: <813c6ba9a48a6e092d0e78bdbdc2d6fa069e5fed.1510735482.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.15.0.194.g9af6a3dea062 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 It isn't used by anyone, drop it. Signed-off-by: Viresh Kumar --- Documentation/thermal/cpu-cooling-api.txt | 24 +++--------------------- drivers/thermal/cpu_cooling.c | 30 ------------------------------ include/linux/cpu_cooling.h | 10 ---------- 3 files changed, 3 insertions(+), 61 deletions(-) -- 2.15.0.194.g9af6a3dea062 diff --git a/Documentation/thermal/cpu-cooling-api.txt b/Documentation/thermal/cpu-cooling-api.txt index 4f6f5e9bb4d6..ea61e8bf7e2b 100644 --- a/Documentation/thermal/cpu-cooling-api.txt +++ b/Documentation/thermal/cpu-cooling-api.txt @@ -36,28 +36,14 @@ the user. The registration APIs returns the cooling device pointer. np: pointer to the cooling device device tree node clip_cpus: cpumask of cpus where the frequency constraints will happen. -1.1.3 struct thermal_cooling_device *cpufreq_power_cooling_register( - const struct cpumask *clip_cpus, u32 capacitance, - get_static_t plat_static_func) - -Similar to cpufreq_cooling_register, this function registers a cpufreq -cooling device. Using this function, the cooling device will -implement the power extensions by using a simple cpu power model. The -cpus must have registered their OPPs using the OPP library. - -The additional parameters are needed for the power model (See 2. Power -models). "capacitance" is the dynamic power coefficient (See 2.1 -Dynamic power). "plat_static_func" is a function to calculate the -static power consumed by these cpus (See 2.2 Static power). - -1.1.4 struct thermal_cooling_device *of_cpufreq_power_cooling_register( +1.1.3 struct thermal_cooling_device *of_cpufreq_power_cooling_register( struct cpufreq_policy *policy) -Similar to cpufreq_power_cooling_register, this function register a +Similar to cpufreq_cooling_register, this function register a cpufreq cooling device with power extensions using the device tree information supplied by the np parameter. -1.1.5 void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev) +1.1.4 void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev) This interface function unregisters the "thermal-cpufreq-%x" cooling device. @@ -74,10 +60,6 @@ cpu. If you are using CONFIG_CPUFREQ_DT then the `cpufreq_frequency_table` should already be assigned to the cpu device. -The `plat_static_func` parameter of `cpufreq_power_cooling_register()` -is optional. If you don't provide it, only dynamic power will be -considered. - 2.1 Dynamic power The dynamic power consumption of a processor depends on many factors. diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c index 5740b49fee68..94ffb4463e22 100644 --- a/drivers/thermal/cpu_cooling.c +++ b/drivers/thermal/cpu_cooling.c @@ -841,36 +841,6 @@ of_cpufreq_cooling_register(struct device_node *np, } EXPORT_SYMBOL_GPL(of_cpufreq_cooling_register); -/** - * cpufreq_power_cooling_register() - create cpufreq cooling device with power extensions - * @policy: cpufreq policy - * @capacitance: dynamic power coefficient for these cpus - * @plat_static_func: function to calculate the static power consumed by these - * cpus (optional) - * - * This interface function registers the cpufreq cooling device with - * the name "thermal-cpufreq-%x". This api can support multiple - * instances of cpufreq cooling devices. Using this function, the - * cooling device will implement the power extensions by using a - * simple cpu power model. The cpus must have registered their OPPs - * using the OPP library. - * - * An optional @plat_static_func may be provided to calculate the - * static power consumed by these cpus. If the platform's static - * power consumption is unknown or negligible, make it NULL. - * - * Return: a valid struct thermal_cooling_device pointer on success, - * on failure, it returns a corresponding ERR_PTR(). - */ -struct thermal_cooling_device * -cpufreq_power_cooling_register(struct cpufreq_policy *policy, u32 capacitance, - get_static_t plat_static_func) -{ - return __cpufreq_cooling_register(NULL, policy, capacitance, - plat_static_func); -} -EXPORT_SYMBOL(cpufreq_power_cooling_register); - /** * of_cpufreq_power_cooling_register() - create cpufreq cooling device with power extensions * @policy: CPUFreq policy. diff --git a/include/linux/cpu_cooling.h b/include/linux/cpu_cooling.h index f09d4feb34f4..c35778960a9c 100644 --- a/include/linux/cpu_cooling.h +++ b/include/linux/cpu_cooling.h @@ -41,10 +41,6 @@ typedef int (*get_static_t)(cpumask_t *cpumask, int interval, struct thermal_cooling_device * cpufreq_cooling_register(struct cpufreq_policy *policy); -struct thermal_cooling_device * -cpufreq_power_cooling_register(struct cpufreq_policy *policy, - u32 capacitance, get_static_t plat_static_func); - /** * of_cpufreq_cooling_register - create cpufreq cooling device based on DT. * @np: a valid struct device_node to the cooling device device tree node. @@ -84,12 +80,6 @@ cpufreq_cooling_register(struct cpufreq_policy *policy) { return ERR_PTR(-ENOSYS); } -static inline struct thermal_cooling_device * -cpufreq_power_cooling_register(struct cpufreq_policy *policy, - u32 capacitance, get_static_t plat_static_func) -{ - return NULL; -} static inline struct thermal_cooling_device * of_cpufreq_cooling_register(struct device_node *np, From patchwork Wed Nov 15 09:19:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 118923 Delivered-To: patch@linaro.org Received: by 10.80.225.132 with SMTP id k4csp3270807edl; Wed, 15 Nov 2017 01:21:28 -0800 (PST) X-Google-Smtp-Source: AGs4zMZytQt0bh3TJnWfHfmHot/JAGZESLJ71jXPCecfD4lf0ZpmHQR+s1ZKG6yJ85gCUK66aO2G X-Received: by 10.159.204.146 with SMTP id t18mr14902145plo.83.1510737687920; Wed, 15 Nov 2017 01:21:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510737687; cv=none; d=google.com; s=arc-20160816; b=IAWJUH5cIrErdyCk3ADJHOrk24AMe1+M3PfP8tn9CNmPtyfaCsaE7OWlMQZiB31ufN NQAlzAzVsk5uYiinsZchml5kUBrOjjV/5XllE8BEvcT9ZQRa4uFAti5B5t4O4eWyT5uL 83BEiPHGCnn0HT3ef7+roxr/X0i1s7lNbulJlQdCcWLqQpeH3WoF/tca1lnJG5BkIPI0 UQLE8ta9MfF8YkwEYPQwdqnrw2fyCYht01/DToAUTRsdb5KpIhBJ2ILlDjTCJVtCDdi+ 5du1YHIdlP/hb0m+1686mf4FfpfCmfx/JQlTYK5MlJddHVsubLq5X4ntA5iJMP9A5mgF oLug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=TFZZ1OqVHRDq5l6FNamoCRnVsdg74IPZwLAW/n9Mgs8=; b=UEtbLnsBjKUgDG9+K+ZUmVaDvB1xGcnxTMHFrtfmXHzKpirbcNKi+kUEnt8YZSl/Q8 WDX8y7zAuuwXOSSz40v/Hin0e6uYWv5XZgZg6SzlLq1FLwvQqHH9oQaRmZ8KJv42CNIn lZuWdjdW+3MxohQnp1pAJzPghdjBNmPCmaPUDlxu/9yGAMEnt43LmgeNEtQUYHhAOGvX jSbncfz53dIJ8mVqVqztoH6mF/lxIDM3zfjddGbiD3MBvm7f2x6beMvrpVtvqKaMC1wE zljEURncmzz6y82zW/gI4MLMTR3WWRlbM73Yvyd+T/bWmI9fp2itkaPW4VMAVtTKELbw OCnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KzprtDp8; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i35si17194055plg.516.2017.11.15.01.21.27; Wed, 15 Nov 2017 01:21:27 -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; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KzprtDp8; 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 S1757326AbdKOJVZ (ORCPT + 28 others); Wed, 15 Nov 2017 04:21:25 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:48696 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756892AbdKOJVE (ORCPT ); Wed, 15 Nov 2017 04:21:04 -0500 Received: by mail-pg0-f68.google.com with SMTP id s11so12126871pgc.5 for ; Wed, 15 Nov 2017 01:21:03 -0800 (PST) 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=TFZZ1OqVHRDq5l6FNamoCRnVsdg74IPZwLAW/n9Mgs8=; b=KzprtDp8HexgCg82xJ5HQh+agtjGx4xv9yjj/z74sLXjGUfer0R5NN7mceYYnSMrSR VaKJLWA/17Khmcz1a4xsRcLAPhc3SI2wAiRSoj/zyBm4XARgrMtEWMnaiI0W5z0VTo+A 2Sx4kHWoTP3Lvm75nBhNT4XHV9fWm1VvE5G2k= 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=TFZZ1OqVHRDq5l6FNamoCRnVsdg74IPZwLAW/n9Mgs8=; b=o7dlQSLuSUxEBxZKj2NVEcryJ80mxCHuOBUGQSmFgnTjXEfeSCN8fJtCZfwp3DXB3t 1TYcH+zTnb53vind7vU53PRAHW+w+SEF7h/NrL8Jnuzk594ydoJKpt1u0XjCVKl6G4EW +Oq9ysTna1mKI3WtitKwQPF3UUfsbirJ6cA2eHA6QTxnKZelDieU/QLr4iL1S2SKxMPt u16DPmUS+ShWv9bFrIaIKD3UPMcNiPLbEDZVM+aJTg3QUky3aRwWQDV1NiT5OXyOe5Kh uoH8T8I5VeVaVZ3rixKkSOs7bEKhqMLBqFED0qdtitD7Wz7B+emquFNZrGfPbXjoI0wN /KFQ== X-Gm-Message-State: AJaThX6Q7zaxnciiyARHldCD6fpwQb71x1HCecxiMaMi/szvUrQUWbd7 eORzjgcbuAO5+reYihRBEZWtbg== X-Received: by 10.98.21.17 with SMTP id 17mr17062987pfv.120.1510737663159; Wed, 15 Nov 2017 01:21:03 -0800 (PST) Received: from localhost ([122.171.67.221]) by smtp.gmail.com with ESMTPSA id j8sm41143407pff.131.2017.11.15.01.21.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Nov 2017 01:21:02 -0800 (PST) From: Viresh Kumar To: Rafael Wysocki , edubezval@gmail.com, Amit Daniel Kachhap , Javi Merino , Jonathan Corbet , Sudeep Holla , Zhang Rui , Matthias Brugger Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , lukasz.luba@arm.com, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 3/4] cpu_cooling: Keep only one of_cpufreq*cooling_register() helper Date: Wed, 15 Nov 2017 14:49:47 +0530 Message-Id: <5b7403fc7c511c12e8f81a5a2dc47dca1cb9663c.1510735482.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.15.0.194.g9af6a3dea062 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 of_cpufreq_cooling_register() isn't used by anyone and so can be removed, but then we would be left with two routines: cpufreq_cooling_register() and of_cpufreq_power_cooling_register() that would look odd because of strange names. Remove current implementation of of_cpufreq_cooling_register() and rename of_cpufreq_power_cooling_register() as of_cpufreq_cooling_register(). This simplifies lots of stuff. Signed-off-by: Viresh Kumar --- Documentation/thermal/cpu-cooling-api.txt | 14 ++------ drivers/cpufreq/arm_big_little.c | 2 +- drivers/cpufreq/cpufreq-dt.c | 2 +- drivers/cpufreq/mediatek-cpufreq.c | 2 +- drivers/cpufreq/qoriq-cpufreq.c | 2 +- drivers/thermal/cpu_cooling.c | 28 ++-------------- include/linux/cpu_cooling.h | 53 ++++++++----------------------- 7 files changed, 23 insertions(+), 80 deletions(-) -- 2.15.0.194.g9af6a3dea062 diff --git a/Documentation/thermal/cpu-cooling-api.txt b/Documentation/thermal/cpu-cooling-api.txt index ea61e8bf7e2b..7a1c89db0419 100644 --- a/Documentation/thermal/cpu-cooling-api.txt +++ b/Documentation/thermal/cpu-cooling-api.txt @@ -26,24 +26,16 @@ the user. The registration APIs returns the cooling device pointer. clip_cpus: cpumask of cpus where the frequency constraints will happen. 1.1.2 struct thermal_cooling_device *of_cpufreq_cooling_register( - struct device_node *np, const struct cpumask *clip_cpus) + struct cpufreq_policy *policy) This interface function registers the cpufreq cooling device with the name "thermal-cpufreq-%x" linking it with a device tree node, in order to bind it via the thermal DT code. This api can support multiple instances of cpufreq cooling devices. - np: pointer to the cooling device device tree node - clip_cpus: cpumask of cpus where the frequency constraints will happen. - -1.1.3 struct thermal_cooling_device *of_cpufreq_power_cooling_register( - struct cpufreq_policy *policy) - -Similar to cpufreq_cooling_register, this function register a -cpufreq cooling device with power extensions using the device tree -information supplied by the np parameter. + policy: CPUFreq policy. -1.1.4 void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev) +1.1.3 void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev) This interface function unregisters the "thermal-cpufreq-%x" cooling device. diff --git a/drivers/cpufreq/arm_big_little.c b/drivers/cpufreq/arm_big_little.c index 3d5ed4ef3927..c56b57dcfda5 100644 --- a/drivers/cpufreq/arm_big_little.c +++ b/drivers/cpufreq/arm_big_little.c @@ -532,7 +532,7 @@ static void bL_cpufreq_ready(struct cpufreq_policy *policy) if (cur_cluster >= MAX_CLUSTERS) return; - cdev[cur_cluster] = of_cpufreq_power_cooling_register(policy); + cdev[cur_cluster] = of_cpufreq_cooling_register(policy); } static struct cpufreq_driver bL_cpufreq_driver = { diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c index 1e7bec7694ab..de3d104c25d7 100644 --- a/drivers/cpufreq/cpufreq-dt.c +++ b/drivers/cpufreq/cpufreq-dt.c @@ -320,7 +320,7 @@ static void cpufreq_ready(struct cpufreq_policy *policy) { struct private_data *priv = policy->driver_data; - priv->cdev = of_cpufreq_power_cooling_register(policy); + priv->cdev = of_cpufreq_cooling_register(policy); } static struct cpufreq_driver dt_cpufreq_driver = { diff --git a/drivers/cpufreq/mediatek-cpufreq.c b/drivers/cpufreq/mediatek-cpufreq.c index dd0bc783cb8b..1aa79486a033 100644 --- a/drivers/cpufreq/mediatek-cpufreq.c +++ b/drivers/cpufreq/mediatek-cpufreq.c @@ -311,7 +311,7 @@ static void mtk_cpufreq_ready(struct cpufreq_policy *policy) { struct mtk_cpu_dvfs_info *info = policy->driver_data; - info->cdev = of_cpufreq_power_cooling_register(policy); + info->cdev = of_cpufreq_cooling_register(policy); } static int mtk_cpu_dvfs_info_init(struct mtk_cpu_dvfs_info *info, int cpu) diff --git a/drivers/cpufreq/qoriq-cpufreq.c b/drivers/cpufreq/qoriq-cpufreq.c index 3a665c18e14e..0562761a3dec 100644 --- a/drivers/cpufreq/qoriq-cpufreq.c +++ b/drivers/cpufreq/qoriq-cpufreq.c @@ -276,7 +276,7 @@ static void qoriq_cpufreq_ready(struct cpufreq_policy *policy) { struct cpu_data *cpud = policy->driver_data; - cpud->cdev = of_cpufreq_power_cooling_register(policy); + cpud->cdev = of_cpufreq_cooling_register(policy); } static struct cpufreq_driver qoriq_cpufreq_driver = { diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c index 94ffb4463e22..55d6b9fb909d 100644 --- a/drivers/thermal/cpu_cooling.c +++ b/drivers/thermal/cpu_cooling.c @@ -819,7 +819,6 @@ EXPORT_SYMBOL_GPL(cpufreq_cooling_register); /** * of_cpufreq_cooling_register - function to create cpufreq cooling device. - * @np: a valid struct device_node to the cooling device device tree node * @policy: cpufreq policy * * This interface function registers the cpufreq cooling device with the name @@ -827,29 +826,6 @@ EXPORT_SYMBOL_GPL(cpufreq_cooling_register); * cooling devices. Using this API, the cpufreq cooling device will be * linked to the device tree node provided. * - * Return: a valid struct thermal_cooling_device pointer on success, - * on failure, it returns a corresponding ERR_PTR(). - */ -struct thermal_cooling_device * -of_cpufreq_cooling_register(struct device_node *np, - struct cpufreq_policy *policy) -{ - if (!np) - return ERR_PTR(-EINVAL); - - return __cpufreq_cooling_register(np, policy, 0, NULL); -} -EXPORT_SYMBOL_GPL(of_cpufreq_cooling_register); - -/** - * of_cpufreq_power_cooling_register() - create cpufreq cooling device with power extensions - * @policy: CPUFreq policy. - * - * This interface function registers the cpufreq cooling device with - * the name "thermal-cpufreq-%x". This api can support multiple - * instances of cpufreq cooling devices. Using this API, the cpufreq - * cooling device will be linked to the device tree node of the provided - * policy's CPU. * Using this function, the cooling device will implement the power * extensions by using a simple cpu power model. The cpus must have * registered their OPPs using the OPP library. @@ -861,7 +837,7 @@ EXPORT_SYMBOL_GPL(of_cpufreq_cooling_register); * and NULL on failure. */ struct thermal_cooling_device * -of_cpufreq_power_cooling_register(struct cpufreq_policy *policy) +of_cpufreq_cooling_register(struct cpufreq_policy *policy) { struct device_node *np = of_get_cpu_node(policy->cpu, NULL); struct thermal_cooling_device *cdev = NULL; @@ -889,7 +865,7 @@ of_cpufreq_power_cooling_register(struct cpufreq_policy *policy) of_node_put(np); return cdev; } -EXPORT_SYMBOL(of_cpufreq_power_cooling_register); +EXPORT_SYMBOL_GPL(of_cpufreq_cooling_register); /** * cpufreq_cooling_unregister - function to remove cpufreq cooling device. diff --git a/include/linux/cpu_cooling.h b/include/linux/cpu_cooling.h index c35778960a9c..a0204c58d269 100644 --- a/include/linux/cpu_cooling.h +++ b/include/linux/cpu_cooling.h @@ -41,33 +41,6 @@ typedef int (*get_static_t)(cpumask_t *cpumask, int interval, struct thermal_cooling_device * cpufreq_cooling_register(struct cpufreq_policy *policy); -/** - * of_cpufreq_cooling_register - create cpufreq cooling device based on DT. - * @np: a valid struct device_node to the cooling device device tree node. - * @policy: cpufreq policy. - */ -#ifdef CONFIG_THERMAL_OF -struct thermal_cooling_device * -of_cpufreq_cooling_register(struct device_node *np, - struct cpufreq_policy *policy); - -struct thermal_cooling_device * -of_cpufreq_power_cooling_register(struct cpufreq_policy *policy); -#else -static inline struct thermal_cooling_device * -of_cpufreq_cooling_register(struct device_node *np, - struct cpufreq_policy *policy) -{ - return ERR_PTR(-ENOSYS); -} - -static inline struct thermal_cooling_device * -of_cpufreq_power_cooling_register(struct cpufreq_policy *policy) -{ - return NULL; -} -#endif - /** * cpufreq_cooling_unregister - function to remove cpufreq cooling device. * @cdev: thermal cooling device pointer. @@ -81,24 +54,26 @@ cpufreq_cooling_register(struct cpufreq_policy *policy) return ERR_PTR(-ENOSYS); } -static inline struct thermal_cooling_device * -of_cpufreq_cooling_register(struct device_node *np, - struct cpufreq_policy *policy) +static inline +void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev) { - return ERR_PTR(-ENOSYS); + return; } +#endif /* CONFIG_CPU_THERMAL */ +#if defined(CONFIG_THERMAL_OF) && defined(CONFIG_CPU_THERMAL) +/** + * of_cpufreq_cooling_register - create cpufreq cooling device based on DT. + * @policy: cpufreq policy. + */ +struct thermal_cooling_device * +of_cpufreq_cooling_register(struct cpufreq_policy *policy); +#else static inline struct thermal_cooling_device * -of_cpufreq_power_cooling_register(struct cpufreq_policy *policy) +of_cpufreq_cooling_register(struct cpufreq_policy *policy); { return NULL; } - -static inline -void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev) -{ - return; -} -#endif /* CONFIG_CPU_THERMAL */ +#endif /* defined(CONFIG_THERMAL_OF) && defined(CONFIG_CPU_THERMAL) */ #endif /* __CPU_COOLING_H__ */