From patchwork Mon Jan 14 16:34:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 155554 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3859589jaa; Mon, 14 Jan 2019 08:38:04 -0800 (PST) X-Google-Smtp-Source: ALg8bN6TAo06q41MaB10Bk55XSxHsAVRyUHWazE1QReqSYq6jN4/gUqeVLD8KjJO4KTJdvyNk0gM X-Received: by 2002:a63:5d55:: with SMTP id o21mr23150323pgm.92.1547483884389; Mon, 14 Jan 2019 08:38:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547483884; cv=none; d=google.com; s=arc-20160816; b=wwVk5llmM2t8/4IDcyijzMiwMFdrFxDcK1Af5I0INKtvTen1oYnbpTcEtwzIVT9cQH +wVSrkc3kvJlpn0byr0wbMrZmvzE+Y71LeWwVR2Qv/MxoRFdCqY9MCDg72broSexsmft +xewN+aN/Rjl3iMpche4T+/XCu9I61rfWgSbDMuDsnTpPdSXo1vh4EMpa3kdzRWerjCQ Wm+t2bG1UiBGNL87tcw0BTA8uZd+WSZUyN0cycA8ghXXF6aUE1jTLw7GnjHTfg1UYXTV 5vts4RE20DncMMjHbcvHMqWD2p9GN/lrEp3D8jpLdataRyIAFBtG4T2o9RAT01WYLhsJ BAoA== 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=7AsIbPWyaNVpnciz+rQGAz2HaZ4096BUiIF8+8SbLYU=; b=o8G7a3RKQhW/AJdHGHNOH9JgtcpZR2Q8hpdxyj14NVWt1rFhU015pnwxDDaM/LjkWT JcCWgp6axEier/aroJU7g5fTPfbC2pv6I7ClRxohFOxsVnQ/tKGEaeng8V+ibh/Qr5Jg ZBLI/rbd465eRH7D8pmG41ficuf0lHEt21slgcwwzfcLvvJNSvVBtPhls+edMtaldmxV wKSuYovr0PK2n5hGglTm05z1pMMY/ZUQr/zkuVDQzl96DsbzdMxZrV5dTBF8VN22ybI0 x9bxsOPyvatvGWg0OHaWajwATvvti212G3gRdPuvkH7etlieQuC3DYLriqpR80LEsSZK Lfog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="g+/TUjSI"; 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 n1si727308pfh.96.2019.01.14.08.38.03; Mon, 14 Jan 2019 08:38:04 -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="g+/TUjSI"; 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 S1727002AbfANQiC (ORCPT + 31 others); Mon, 14 Jan 2019 11:38:02 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:54121 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726920AbfANQiB (ORCPT ); Mon, 14 Jan 2019 11:38:01 -0500 Received: by mail-wm1-f65.google.com with SMTP id d15so218200wmb.3 for ; Mon, 14 Jan 2019 08:38: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=7AsIbPWyaNVpnciz+rQGAz2HaZ4096BUiIF8+8SbLYU=; b=g+/TUjSI97oiEjeIAmXF0JOOEHIisT++1kgUNslcEzl+MXsAQdUqxZKToZSh9xvLT+ iwBJdUjokPH/r7hq48KAtOiDzOwaPn5OaebqLJo/VGGED1wgBbNvOJDq3EaISIT5YGCZ mtgK3e6zdpjv0JzgJoAk//OZxJ+4rH7OVZ6Dw= 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=7AsIbPWyaNVpnciz+rQGAz2HaZ4096BUiIF8+8SbLYU=; b=WZyO9O16YU6EZ/+gA86Qi60arBtSzpqQq+D0ADbFnyxNAS0/25K06RlLjAa2Nw7EU1 bzz8n75XqT/58/DdYtbm/EviFbM+8UdrF6QB6m4aI3dVQF4EjYgLxqqP3Fznyqp4x0PL 7lAeafp4SZrz+/X92M5oK9VYkJ2QTx2idlIo4+LXDlYl0TBX/eT6act2NXiP0XdJe2bN d+eZGyoeRWdscHPHkQ+PNKCPfpSfa3GN/h5gtbDIFtZOtZMIW0LQuxTTFE6myQreSFLp Yo0XM2vyKQ/PfPJjFIW/WCse4tigQqfB+/XLwyKUx1EPx3Ch15+aV2rrBjATlYEeEPuW zdfg== X-Gm-Message-State: AJcUukdaK3AdWVC8LtXIikct9LQ3iFPZJuV1/0yNjxTVCk1KXu30wBEE BD+GeQsMTi3ovLQDm5xKItxDHbMrzJj4Hg== X-Received: by 2002:a7b:c397:: with SMTP id s23mr2889239wmj.127.1547483879688; Mon, 14 Jan 2019 08:37:59 -0800 (PST) Received: from localhost ([49.248.190.171]) by smtp.gmail.com with ESMTPSA id o82sm26171257wmo.29.2019.01.14.08.37.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 14 Jan 2019 08:37:59 -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 Subject: [PATCH v1 04/10] cpufreq: qcom-hw: Register as a cpufreq cooling device Date: Mon, 14 Jan 2019 22:04:56 +0530 Message-Id: X-Mailer: git-send-email 2.17.1 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 Add the CPUFREQ_AUTO_REGISTER_COOLING_DEV flag to allow the cpufreq core to auto-register the driver as a cooling device. Signed-off-by: Amit Kucheria --- drivers/cpufreq/qcom-cpufreq-hw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c index d83939a1b3d4..ed32849a3d40 100644 --- a/drivers/cpufreq/qcom-cpufreq-hw.c +++ b/drivers/cpufreq/qcom-cpufreq-hw.c @@ -231,7 +231,8 @@ static struct freq_attr *qcom_cpufreq_hw_attr[] = { static struct cpufreq_driver cpufreq_qcom_hw_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 = qcom_cpufreq_hw_target_index, .get = qcom_cpufreq_hw_get, From patchwork Mon Jan 14 16:34:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 155556 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3863099jaa; Mon, 14 Jan 2019 08:41:36 -0800 (PST) X-Google-Smtp-Source: ALg8bN4CBF/paP+oyt1sgD/ihe3vyr7imtto2xMIuxI39NJq2buuaRVlMjrpfeZPGxMg9FiwjgpG X-Received: by 2002:a17:902:108a:: with SMTP id c10mr26595587pla.131.1547484096143; Mon, 14 Jan 2019 08:41:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547484096; cv=none; d=google.com; s=arc-20160816; b=dTNtCfyoj+L5NlYjyIk6Nq0BR2ekQUFWlm58/SwklGjkY5OIC4MezoOOA4mtPt3ncx URcsVlXFOWCoLS9oB8Z/XwciJGrLt61ubHfhS2iKqjwY/SrkSI4PL8Dpyfwsc6E8h8A0 N3P0Z56OMb1T8KUMxba33bQ2IbR86mEkVQ6aNL/dISvlWU/yUNG0AnLA7uo4wpsi/rim 15+1usxtg6+bVvBGRhaz7cMK/mNehPLGBFKpW42JN4kBM7VY7sofI45tpX1fSecbYHdf zrXiwL9j1aK+zZwFcLQmEKS6pADi65WNh7unr24bTPM8KZ+SN5msW+D8gH7ljIoZIn/q nBSg== 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=eg30GQoBNKGznj9zcPKVwwsVyTx3PYpgKyQrV7Bu6i1gdp8wLdex8q9iSaAuKcPObh 3NtbJIq1v+VgZJTwKithvfItA2/JEAAeqa8V056vkb6xbaXgrjaXnsbm87jIhiqOa/xY xw6oPw/Jq3Up1Ggdf0uVCnx3ldh4jayxz5WuO3U0WzunvlPCOW0sW+pyglzJ9Gvxj55R SOcAbsL0bL0x0adhIEZUnrIXIXaG+SGFl/16ankWV31la/GBL4N5bIIi8CWy9MxXvoGK cqpJVqvJXlSm/NND4oUHZgiMc/OaXMjqXFpaOWUq+MwL9BrJsjlw70NroS7kdcHHUnXW bKkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GhCgDGmo; 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 o8si684715plk.28.2019.01.14.08.41.35; Mon, 14 Jan 2019 08:41:36 -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=GhCgDGmo; 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 S1726913AbfANQlf (ORCPT + 31 others); Mon, 14 Jan 2019 11:41:35 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:40344 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726757AbfANQld (ORCPT ); Mon, 14 Jan 2019 11:41:33 -0500 Received: by mail-wr1-f68.google.com with SMTP id p4so23664097wrt.7 for ; Mon, 14 Jan 2019 08:41:32 -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=GhCgDGmoxDg7HLCQuCUtdj6BGUGMiGm5sk3l9jWvy+y8Mc2yxEL+d+M3bBXCNa78zO luP05FxIo8xnoRlQJS+BkC2BXYKe2AA9O009LfOeUL7Is7DXlTqHb4WdG6v5KVeF2BZ8 m/+hefIMzreCIs8TcyXF96EszozO+1m1yRRow= 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=dGE9Jbkrz+NBvooKYlmn0JmaddVqv53Bq+a7ECdtiPfAxe/A52u6lJ/Vzg12POGiLu bHebSbs2YAQX2884urIcS9DCcezIHiLafk6zVzbEuP+IDRBE9OVMkvzfdCqiK6WledYm L0o2XmkNv84fT90n3FE2pvjK+/wPFjvMPMGv9+XXEYRRHNYrCRBnpk3xubd3bdJvGJHQ XTLLzjGaTmsj4sGWicTmAlO55KkUnHtEyLh5BiIU4HhvGenwo0EcEmi53Mzy9ZAmyrkR 1NOT8gj7z6v/rLj/dCC2DKiOmguu2hw9JTH1EB9ebWwoYSwevZboIFxVJWP+4dJW4XlV G8gA== X-Gm-Message-State: AJcUukeaoMR2nAnyRSVhycso/VIDztL1Tmi/NoMwnqE3RCRbXdgJh11b 2tSzWiCF7WjhdBoJOjw9/ylJVIWqTcOuJg== X-Received: by 2002:adf:e5c4:: with SMTP id a4mr24073413wrn.157.1547484091561; Mon, 14 Jan 2019 08:41:31 -0800 (PST) Received: from localhost ([49.248.190.171]) by smtp.gmail.com with ESMTPSA id 143sm56483488wml.14.2019.01.14.08.41.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 14 Jan 2019 08:41:30 -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" , Shawn Guo , linux-pm@vger.kernel.org Subject: [PATCH v1 06/10] cpufreq: cpufreq-dt: Use auto-registration of thermal cooling device Date: Mon, 14 Jan 2019 22:04:58 +0530 Message-Id: <9ff853ce75cc1f64f106a239891f55be96a28db4.1547481320.git.amit.kucheria@linaro.org> X-Mailer: git-send-email 2.17.1 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 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,