Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3222175imu; Mon, 28 Jan 2019 00:38:11 -0800 (PST) X-Google-Smtp-Source: ALg8bN5B2sbez4BGCxDGz09TPIl0+vkQBpNCGA5sEaIhDgwnP/e5/BfTbwg5zoJJVVpeijZKVC6z X-Received: by 2002:a63:451a:: with SMTP id s26mr19286106pga.150.1548664691519; Mon, 28 Jan 2019 00:38:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548664691; cv=none; d=google.com; s=arc-20160816; b=Nha4GuZFbVaPntjN9LRnyImBQ4b/wPHviPOTE9EhzU/qck5BNB896TGYM++8w1kww8 A8QGj9D+EWQFG8IMLMUypcc9AHkVfVj4JEKYvPwzmjUdU9LpxOT4Acgof5ZqJj39Gh5M H6I5EPIl/Ic5gp1Wdy08HxxCQFWpUjjjEyKVSs+N1trCF8/vJat/o3KdQc5inR0vbeRi yuZ54NdvzkK8KJVfgtegnNXjnln7r9UdD9gE5GG76Bu/T5Tho4cytvu628Kg8+BIaahV u5LtBpcX4hYEAERrIdOTrk8+i21nmWFxGC6yI3oAYdNklsfQ72YsiYScyMEBtj/ko9wU gnSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=k1lcqYBnFAgxOzBCUuFKwVUkEDF/OrdjAUhRMXm0UH0=; b=0100nTt7sNpHDzyYUAq+ohKoRjKkTLe+aOb3JgolsV8ASqv0n0s08KLfbmHKfQzQL5 KDiI3wJfUi7knpGAfbrkN26wEORbL7FCtJlJ6lwcwaWZ44z7TfzuZdpjM/m1qJz3i3lk 9B0vZCuduXKQiPexZNSBdII5IVQT25u4CMkdpjkuhFg2XOxKOzi7fl9SrdxOkfq/eSSf FWefPS/w12bnjk4kpIzFnAKEqYfVZoAW0S6LXoZAqfLLtB+Cx5PHdH7xSXmiJvtdLcR4 8xNtXu1368VZHG+golT3Tc1GVaEC0KL8Wh616u4ugt8DzgHSDaJPQbFZMI2Js1Xf3ZSz UBFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=To047cwB; 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 1si33461995plb.103.2019.01.28.00.37.56; Mon, 28 Jan 2019 00:38:11 -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=To047cwB; 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 S1726971AbfA1IhE (ORCPT + 99 others); Mon, 28 Jan 2019 03:37:04 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:38290 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726879AbfA1IhD (ORCPT ); Mon, 28 Jan 2019 03:37:03 -0500 Received: by mail-wm1-f68.google.com with SMTP id m22so12920982wml.3 for ; Mon, 28 Jan 2019 00:37:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=k1lcqYBnFAgxOzBCUuFKwVUkEDF/OrdjAUhRMXm0UH0=; b=To047cwBW40bx/zOhcj3gnlH+6vyHNeuNlIRzIvwR1Z/OVgTLgPinSwLdd/UdMLhUK WJ3D6O+1+R6WczuPc6afEhOYe+R4q9cXq5OpfIcVUOazqh3Eh5OG1p9vR+AAAnKkKQEH 7/5qJSakePYQqLubgQjdP1ZxBOVLru8d/BRPw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=k1lcqYBnFAgxOzBCUuFKwVUkEDF/OrdjAUhRMXm0UH0=; b=JqWosSGUaf9LsCe31OqwOb1vU/fclqOVADIqJ3obxulgvdfJug8m5amh+KPmqxibkA Waz5sDWatxWGvWlgHaGb60U9UwzKrLOepPaqUsb2Dx+mJk9mX5+IpEtICAnRj8/+9xwF nbb57NZssfm/NIUX+zwhbl84Zjp+OwsNWAPPHanwETgFE1O2hpzZgkvKICc9GTEiMrK1 m9FCM+6wRfPfjc8Q+XQq8S+nMoIu/47Biwv7duivGz8xdnduloYRNyta4AXhLAwurw42 m4x84xdED1pon7FYsphmrvvHvrehqtIG1uyN6bUZvK69UZ0ngHcfFRRbZYujsWlgI/NS Qm6g== X-Gm-Message-State: AJcUuke7mQDw4UYZlH0QQZ+XVTIAUdEqxFII+2UVeW23ebbK9+VvRfon QKP7iceJHbzsFzCCkFe6Qx5uAw== X-Received: by 2002:a1c:400b:: with SMTP id n11mr16554013wma.85.1548664620978; Mon, 28 Jan 2019 00:37:00 -0800 (PST) Received: from [192.168.0.41] (20.36.129.77.rev.sfr.net. [77.129.36.20]) by smtp.googlemail.com with ESMTPSA id a12sm125686093wro.18.2019.01.28.00.36.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Jan 2019 00:37:00 -0800 (PST) Subject: Re: [PATCH v4 6/9] cpufreq: mediatek: Use auto-registration of thermal cooling device To: Amit Kucheria , 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" , Matthias Brugger , Sean Wang , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org References: From: Daniel Lezcano Message-ID: <11c4bde4-a113-6588-be6a-0904be1974d5@linaro.org> Date: Mon, 28 Jan 2019 09:36:58 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28/01/2019 07:41, Amit Kucheria wrote: > 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 Reviewed-by: Daniel Lezcano > --- > drivers/cpufreq/mediatek-cpufreq.c | 14 ++------------ > 1 file changed, 2 insertions(+), 12 deletions(-) > > diff --git a/drivers/cpufreq/mediatek-cpufreq.c b/drivers/cpufreq/mediatek-cpufreq.c > index eb8920d39818..9a937f4c63e7 100644 > --- a/drivers/cpufreq/mediatek-cpufreq.c > +++ b/drivers/cpufreq/mediatek-cpufreq.c > @@ -14,7 +14,6 @@ > > #include > #include > -#include > #include > #include > #include > @@ -48,7 +47,6 @@ struct mtk_cpu_dvfs_info { > struct regulator *sram_reg; > struct clk *cpu_clk; > struct clk *inter_clk; > - struct thermal_cooling_device *cdev; > struct list_head list_head; > int intermediate_voltage; > bool need_voltage_tracking; > @@ -307,13 +305,6 @@ static int mtk_cpufreq_set_target(struct cpufreq_policy *policy, > > #define DYNAMIC_POWER "dynamic-power-coefficient" > > -static void mtk_cpufreq_ready(struct cpufreq_policy *policy) > -{ > - struct mtk_cpu_dvfs_info *info = policy->driver_data; > - > - info->cdev = of_cpufreq_cooling_register(policy); > -} > - > static int mtk_cpu_dvfs_info_init(struct mtk_cpu_dvfs_info *info, int cpu) > { > struct device *cpu_dev; > @@ -472,7 +463,6 @@ static int mtk_cpufreq_exit(struct cpufreq_policy *policy) > { > struct mtk_cpu_dvfs_info *info = policy->driver_data; > > - cpufreq_cooling_unregister(info->cdev); > dev_pm_opp_free_cpufreq_table(info->cpu_dev, &policy->freq_table); > > return 0; > @@ -480,13 +470,13 @@ static int mtk_cpufreq_exit(struct cpufreq_policy *policy) > > static struct cpufreq_driver mtk_cpufreq_driver = { > .flags = CPUFREQ_STICKY | CPUFREQ_NEED_INITIAL_FREQ_CHECK | > - CPUFREQ_HAVE_GOVERNOR_PER_POLICY, > + CPUFREQ_HAVE_GOVERNOR_PER_POLICY | > + CPUFREQ_AUTO_REGISTER_COOLING_DEV, > .verify = cpufreq_generic_frequency_table_verify, > .target_index = mtk_cpufreq_set_target, > .get = cpufreq_generic_get, > .init = mtk_cpufreq_init, > .exit = mtk_cpufreq_exit, > - .ready = mtk_cpufreq_ready, > .name = "mtk-cpufreq", > .attr = cpufreq_generic_attr, > }; > -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog