From patchwork Fri Jan 25 07:02:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 156546 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp18304jaa; Thu, 24 Jan 2019 23:03:22 -0800 (PST) X-Google-Smtp-Source: ALg8bN72v+iKU3QrUvG+modUbgAKUDOL6V1Vt8+yJpuTfYCkw7uujNxgvn3FqVtm8PxzN8m5wjs8 X-Received: by 2002:a62:6f49:: with SMTP id k70mr9676613pfc.7.1548399802464; Thu, 24 Jan 2019 23:03:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548399802; cv=none; d=google.com; s=arc-20160816; b=r+qpNvJNLu7DKa5Z207v0fi0WdX7wRbGFI/grStpBeFGYZG1rn8dIDB2x/aR254lwc Tg4lvIpvWATt0ixBBNukSE0U9qaTy6cZ9JqFAEN95Sd9I5I8/vQz4oZJ/LVFuWqF10PL wJ1EJNZfbx67iQN3wM+UKi679/LnRLGFutoaPyWTpAipSd5G5xNKS9DIrc0AF80UTyQX ttRZldlBCcA4PdXQqNlfZsyU2zB1LuEud+vP+zY7Azia6FoGgZduBsqfWuW1AqsQby1T 8JrB/cSwI5ZoeKp2fdsOCj0GplVLAvtxr3Lk7srix6KWKvLpV3jEP6KEE/Lr/geidZHZ Kl/w== 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; bh=7flkZLLLMPKnUBob6lG91eyXS2wXjEuVdEl94VSGgUQ=; b=vvKU/vni5tiJQMfKN1lI3GLEVjFx0rHFgSlpmwbDnlzmV9ifU+YkgWov7hK+05FUjx hgrLwQXlNalXbRdEjZQGdmaoVz9en5VYoHaEeZ+Z7gCXofHcC+og+5Joc8stkIaszR8z vfS1QzLnj9/Lq7szV9URd+R1bhQ+r+aZXwFmo0czl3KnjZjNGWz0OZcCcRIoL56OisyH PfeDVe5NtyvREdLogorXiJbylYSf1+TYGiMG/krrJAr4UG6W7WeDzsCbmuftJ7hDsGjL ICV6rx9CDUs7XqwtI3f9FhXFc331OVQAycluQdVyS7GMlJMtHa/UicrHNhXTkzGuAXIH VhDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GBHMSNqA; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-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 v2si25255863pgn.451.2019.01.24.23.03.22; Thu, 24 Jan 2019 23:03:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-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=GBHMSNqA; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-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 S1728362AbfAYHDV (ORCPT + 15 others); Fri, 25 Jan 2019 02:03:21 -0500 Received: from mail-yb1-f196.google.com ([209.85.219.196]:33084 "EHLO mail-yb1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728288AbfAYHDV (ORCPT ); Fri, 25 Jan 2019 02:03:21 -0500 Received: by mail-yb1-f196.google.com with SMTP id m132so1724033ybf.0 for ; Thu, 24 Jan 2019 23:03:20 -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=7flkZLLLMPKnUBob6lG91eyXS2wXjEuVdEl94VSGgUQ=; b=GBHMSNqA6ShHtjwmgPgitPzf3OS+onfrjvdFO2ocI8NldpG5NHv7o7TsP0RMdkA1mw 0M5HfBlXeVCCP38rpGx92Snjzug5Xc1Org8gvRrfsICCbg8pTG5GaU6A1mT8gmJG1GRF ItEe9bb6dImdTacqjh5d1XyxEy7BWoe+qRgHQ= 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=7flkZLLLMPKnUBob6lG91eyXS2wXjEuVdEl94VSGgUQ=; b=grOjk+vfVmSpa4ns7QFIJ8boluwxWVXLqMpHNfrX9748HjMXo2ETXd5W3aF+V2+Svz vJxsEH/KNsKHSrN1E9Y0HjPWx5E5WHaOPcKQzz+FKZKJ3ZzyMX5MaCBTvKVs+cKMtwQ8 ibVd9OXrpS7O+nJOf9ZsZ6aKh3D3eVFpvnBPBj8nzlHr0dGq5BcGWUpfQtrQQI9VP+9u /hXQMVvu0NruAiNWPnj1KgGR7HqIEqYdLMUrRoN+iRITX+YljxIoGwaxuLcHWnd4CEIn 8d41CEIsDakO+d7JK8iBGx7QrAwEr7bFSGAzcM/vsRhPTvnTEI+JlNL3FHLvx2grpPFB 6oTw== X-Gm-Message-State: AJcUukc+lx3qqAeJ3G5bIX1kgbExCUHk4pUU61HNl8nwT6QZaivd26t+ tcU1HYMAPSewscOw4wOiQ36yvQ== X-Received: by 2002:a25:37ce:: with SMTP id e197mr9589228yba.63.1548399799997; Thu, 24 Jan 2019 23:03:19 -0800 (PST) Received: from localhost ([49.248.181.51]) by smtp.gmail.com with ESMTPSA id y187sm8940007ywf.50.2019.01.24.23.03.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Jan 2019 23:03:19 -0800 (PST) From: Amit Kucheria To: linux-kernel@vger.kernel.org Cc: linux-arm-msm@vger.kernel.org, viresh.kumar@linaro.org, edubezval@gmail.com, swboyd@chromium.org, dianders@chromium.org, mka@chromium.org, "Rafael J. Wysocki" , linux-pm@vger.kernel.org (open list:CPU FREQUENCY SCALING FRAMEWORK) Subject: [PATCHv3 5/9] cpufreq: cpufreq-dt: Use auto-registration of thermal cooling device Date: Fri, 25 Jan 2019 12:32:25 +0530 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Use the CPUFREQ_AUTO_REGISTER_COOLING_DEV flag to allow cpufreq core to automatically register as a thermal cooling device. This allows removal of boiler plate code from the driver. Signed-off-by: Amit Kucheria --- drivers/cpufreq/cpufreq-dt.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) -- 2.17.1 diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c index e58bfcb1169e..2a4c4ea7980b 100644 --- a/drivers/cpufreq/cpufreq-dt.c +++ b/drivers/cpufreq/cpufreq-dt.c @@ -13,7 +13,6 @@ #include #include -#include #include #include #include @@ -30,7 +29,6 @@ struct private_data { struct opp_table *opp_table; struct device *cpu_dev; - struct thermal_cooling_device *cdev; const char *reg_name; bool have_static_opps; }; @@ -301,7 +299,6 @@ static int cpufreq_exit(struct cpufreq_policy *policy) { struct private_data *priv = policy->driver_data; - cpufreq_cooling_unregister(priv->cdev); dev_pm_opp_free_cpufreq_table(priv->cpu_dev, &policy->freq_table); if (priv->have_static_opps) dev_pm_opp_of_cpumask_remove_table(policy->related_cpus); @@ -314,21 +311,14 @@ static int cpufreq_exit(struct cpufreq_policy *policy) return 0; } -static void cpufreq_ready(struct cpufreq_policy *policy) -{ - struct private_data *priv = policy->driver_data; - - priv->cdev = of_cpufreq_cooling_register(policy); -} - static struct cpufreq_driver dt_cpufreq_driver = { - .flags = CPUFREQ_STICKY | CPUFREQ_NEED_INITIAL_FREQ_CHECK, + .flags = CPUFREQ_STICKY | CPUFREQ_NEED_INITIAL_FREQ_CHECK | + CPUFREQ_AUTO_REGISTER_COOLING_DEV, .verify = cpufreq_generic_frequency_table_verify, .target_index = set_target, .get = cpufreq_generic_get, .init = cpufreq_init, .exit = cpufreq_exit, - .ready = cpufreq_ready, .name = "cpufreq-dt", .attr = cpufreq_dt_attr, .suspend = cpufreq_generic_suspend,