Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3392344pxt; Tue, 10 Aug 2021 02:30:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlbbCsXDGGWqHS/t5KingcvyetSZAG1WsN1w8PJFNnE9bHZoSusOcamUgFU+6CPQ7dbjUt X-Received: by 2002:a05:6402:5210:: with SMTP id s16mr3843191edd.343.1628587847832; Tue, 10 Aug 2021 02:30:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628587847; cv=none; d=google.com; s=arc-20160816; b=x24+790RAAgv+MGAyjENEvv1m3t8slp/2OMlX/ulfjkhc5wga1aQp2TCIDWSvVrKQj 4btmiy/P7UR8LDHdk8afCS3RfCT5xsrfY9JueP0JstQ2iiH/ZR9X270eH8i6G4IWwQiW HzzkTUMO9+Gb6uehkPaciab3yLqvi20xQ4WdwzaD8dLhXjxjVdTlhRUhV/h+yWd5lh1W Vv3Q4CMcu8XxMaf8ee6/n0y+ZXlcVHT7j3GiqWvcCPfvaRx3xgnTF6iXz/r5Z5oo1kOw 5gQNrhW+9eYOqUWhwI4RIJf/Pz0pwAema6FKeftFZWR1aTY3e9Gs8/jHD69VA9od5Uz0 9nWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=L1wUGUmm+RM+WFeAm1m0YDv4o3hsF8ZYP495ftWlyX8=; b=kUPfb4QnG6sx4Ao8+H8u0NNn421yVEemDa4FKkutz3ptxGQ7ni3STBJvKQuZIw7zz2 BWE83cWMMR/p3ojN36+HGLWSmH+STvYUwoHWrnxqLMNpvDIp5rPtKY4gbf33y/ilOcfZ OrVbgbIi2r4W+dx093BUxxxaznZ9fNR7MKVfdS8CI5fYl8hjqNUMW+whWAK5EkMbr0tS 8HUrV6AgluutTfdwVApSqL+TKR8/N5MjemeGTjMirBOz/6tj83pkBODLcEyS+Sf8AgTs 3dbU/mlAmFzdAo7biu2VkJFWa7e5oM8/qBsLHjNeOECgzOZbVWHYP8bZosNyyDUBZVAD d3+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fk5tOWy2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id mq21si3267504ejc.409.2021.08.10.02.30.23; Tue, 10 Aug 2021 02:30:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fk5tOWy2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S236310AbhHJHhu (ORCPT + 99 others); Tue, 10 Aug 2021 03:37:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236162AbhHJHhs (ORCPT ); Tue, 10 Aug 2021 03:37:48 -0400 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C9E5C06179B for ; Tue, 10 Aug 2021 00:37:26 -0700 (PDT) Received: by mail-pl1-x62a.google.com with SMTP id u16so19832748ple.2 for ; Tue, 10 Aug 2021 00:37:26 -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 :mime-version:content-transfer-encoding; bh=L1wUGUmm+RM+WFeAm1m0YDv4o3hsF8ZYP495ftWlyX8=; b=fk5tOWy2yIUEWF2V3Hv2HPVQoMpXxyOfrZoZs5z9PCvwXNRxlF3y2dGoDt0fdKZps4 IbMw4UJUArG/kcdJj/hQW+gC6Fjc7Uy7Q7eXxGsHSKRS58gzOIq3mtjk+r1BP8frQ+hj XeJESYYtha+eG0XHEMuLWJVYKlLqw2C6DH3U0NEX8+CzlLWeqGbA89xPaGxK3NP6FPal VRk9tRzQSZNXBmH7YfJnPt25AUAe3B9Rnk41CoEwyyYTyz1QPVbLxvft0t1W/HyfLMMO 5SOEcRbNNj2U4+4IkR860KlCkU06v04ruyoOd6jqP7hmoIYdvDN1z6+rgLomaQPLmzGq SDBw== 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:mime-version:content-transfer-encoding; bh=L1wUGUmm+RM+WFeAm1m0YDv4o3hsF8ZYP495ftWlyX8=; b=LwG5+bgVGyAKCX14SLdMOMAXfl9LtBFUiGo287F8/4J8UqqPuvlE5HODkMP+Vl7YAZ 2PpKX2aE77jFOWhd6Vszee4r3C0Z2YmrTH1PvYfLWVOFxu+iMRirh2z5KfdjvXWCVZQI 1wBMLqI9g8PxN3vMoo4sYtL0TggWdl8wcti0yqYnv7hvqMwuSakqOtMwoJoRzWXQ38bu eWwv0RGcnfZ43KQOlHaUVXiVnG6ww44HaUmcJJ9DDGWS8GZuQbF8+ODNwES4ZRo8Vxi0 wSqguFSe1D/G9VeRw+rlgdFWOGLJdgLS8lSG2nc5Celm5WFx+6a3jPtLmaVlfkTBIU/5 py6Q== X-Gm-Message-State: AOAM5304iXW/6TZ4I+oHadU+AKoVKot4bAJCtdRZXnRA8vWUemUuw5Rv FpR2Mvc+m58ONh0nezRyTigGXQ== X-Received: by 2002:a17:902:e746:b029:12d:1cb0:9649 with SMTP id p6-20020a170902e746b029012d1cb09649mr9705017plf.21.1628581045913; Tue, 10 Aug 2021 00:37:25 -0700 (PDT) Received: from localhost ([122.172.201.85]) by smtp.gmail.com with ESMTPSA id fh19sm1879612pjb.27.2021.08.10.00.37.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Aug 2021 00:37:25 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Vincent Donnefort , lukasz.luba@arm.com, Andy Gross , Bjorn Andersson , Viresh Kumar Cc: linux-pm@vger.kernel.org, Vincent Guittot , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 6/8] cpufreq: qcom-cpufreq-hw: Use auto-registration for energy model Date: Tue, 10 Aug 2021 13:06:53 +0530 Message-Id: <0b0d533988c3a4318b9fdc5e10c857348e203132.1628579170.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use the CPUFREQ_REGISTER_WITH_EM flag to allow cpufreq core to automatically register with the energy model. This allows removal of boiler plate code from the driver and fixes the unregistration part as well. Signed-off-by: Viresh Kumar --- drivers/cpufreq/qcom-cpufreq-hw.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c index f86859bf76f1..221433c6dcb0 100644 --- a/drivers/cpufreq/qcom-cpufreq-hw.c +++ b/drivers/cpufreq/qcom-cpufreq-hw.c @@ -362,8 +362,6 @@ static int qcom_cpufreq_hw_cpu_init(struct cpufreq_policy *policy) goto error; } - dev_pm_opp_of_register_em(cpu_dev, policy->cpus); - if (policy_has_boost_freq(policy)) { ret = cpufreq_enable_boost_support(); if (ret) @@ -406,7 +404,8 @@ static struct freq_attr *qcom_cpufreq_hw_attr[] = { static struct cpufreq_driver cpufreq_qcom_hw_driver = { .flags = CPUFREQ_NEED_INITIAL_FREQ_CHECK | CPUFREQ_HAVE_GOVERNOR_PER_POLICY | - CPUFREQ_IS_COOLING_DEV, + CPUFREQ_IS_COOLING_DEV | + CPUFREQ_REGISTER_WITH_EM, .verify = cpufreq_generic_frequency_table_verify, .target_index = qcom_cpufreq_hw_target_index, .get = qcom_cpufreq_hw_get, -- 2.31.1.272.g89b43f80a514