From patchwork Tue Aug 10 07:36:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 494323 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:396:0:0:0:0 with SMTP id y22csp3683002jap; Tue, 10 Aug 2021 00:37:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzmt/tD4bhqt3iH8m28TOaGPtkbClGh/sMBG8tPuZ3O6dgblYaxAyLJS7MBTzpGtaUMqi9T X-Received: by 2002:a05:6602:14a:: with SMTP id v10mr11551iot.36.1628581045378; Tue, 10 Aug 2021 00:37:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628581045; cv=none; d=google.com; s=arc-20160816; b=qPEppBOxbJ/xQrwdvPOtH8SmoAP0gH6ps6AUdBL83kPnzv1lKpNV5DnwULdQ17zUon WYt2O6MhfxtsxPUEi8ix2+Sa9ufi3Aw/z0FemhXioGhqeF0V31aS4tnGUo6N6QaajwR1 09ZGXlWKlVaD4Kcxi38enlDgTj/i+NFyAKCpRpOS5548kmEdiECensvi1K5UsuUv9zW8 BwWq8vh3MUf/fDDLj0Z0OoVpENqM2xXrpsL5aO8siM7PiGbKlq5cGjem+vsK98e6+zjK nxYRo4pA1wnn+rP48J/5v8D+wgoLIdaWr43s7gdB+eyskquZK7NswaRbZAGlRuPNa1FU eRoQ== 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=iNVi1PJwomW2Lv5qQiFKSFJ6/Vv2aKjQw2zcbRmrKys=; b=nQpLHGIG1+7zkgTqqmv6n8HryHFsrowoZepL8qmO0KKMu6/YIPK8BwrpD43xX4cWV4 7oUXbH/uyqtEhiLWU+Um7E2HZ3VzaVSwElruRRTSH25CY+EtVWpS2/KVaYWXxPuIiNBI U6XdKlML9b4XNcgoAXKpiOY8Li8W8bXo2b1i4CKIjSV89Zv9fS3+8bPOmL3BiuAL9gxR y7txKNNfzRj1k2pOI1fiQV2PSYTfyu7ZAcXhunc0A57aLn+8c+W9EzJ6V9bdEsCU93Df jn+NV6+7pgyzeKmy988DhplaciXFp2DeC9XU1gAYMsTLMPkRlHvP9Ij+zDWdRCgjrXYh W23Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GwAvGJKy; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-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 i1si21482622ils.142.2021.08.10.00.37.25; Tue, 10 Aug 2021 00:37:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-pm-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=GwAvGJKy; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-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 S235234AbhHJHhp (ORCPT + 7 others); Tue, 10 Aug 2021 03:37:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235623AbhHJHhm (ORCPT ); Tue, 10 Aug 2021 03:37:42 -0400 Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7626C06179A for ; Tue, 10 Aug 2021 00:37:20 -0700 (PDT) Received: by mail-pl1-x62c.google.com with SMTP id k2so19768088plk.13 for ; Tue, 10 Aug 2021 00:37:20 -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=iNVi1PJwomW2Lv5qQiFKSFJ6/Vv2aKjQw2zcbRmrKys=; b=GwAvGJKypx7dO1I0Quh1Zo3hfRBIgOhUAweuXo0i6JjHUCpYGk5+qJLXFbe9sLri1G P+WOkghCyhFndfyOID+H35Uf+VciyHQHnKrB9mVN4nbGeKfyEdpY8BXDBitOqCwCT+vx 6CPzpG4vziCrjzO+Eztlu7jvoOMBI3oJjZKJILfLpxpIti5cJDfztxNKCtRnIZPuCD5q /BXgfXm5gexBx65NWelA9VY40xpGcO1xQU0MUlbeavFYL4HzuseUcuPG1z8uX5Lan4mN nj/5Gd33SFntKjuHOTGtTXO+SXADQdhJczErFnA8sHspqZ4y92OoOV7Wq/gcjxhEIm1W RnCw== 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=iNVi1PJwomW2Lv5qQiFKSFJ6/Vv2aKjQw2zcbRmrKys=; b=OO1YmWxKKs1xzNCy8AWAy97HuJLtJWlsbyckVQ5Y3SotC2lf5T0mglXE7LRIw+hFUj bjXHBGSTwCLtxN+8Fd2E3y8y3ATKIwzIjvIVNsTawJvubyWYD/aHvKNE6wrFB6xEU++e 06HVk7n35a4pYTlaUH4fil2iE57dEbHTZaofasvRbLXr78uFrYtACqMceegGVXAo0PSs rWrsaUoF3F45A1wnuD+6Og6ZRwDJDBkdPkwEdwc9c2BmHLlpslr6ePX2zenCgTummYz9 L8BxQt3FxWkDNI5XyFvYB5ZhaOkebwRush3ehM443hGMhG9n6oIk0x++JFXOlkqjC7eu rkHQ== X-Gm-Message-State: AOAM53289Nz+s3J7pxwlHNTylQGmvVAfgGblaJhSM0ZfhKarEgH7EnkI d8NMSUZEhcycced0s/VdOGQEyg== X-Received: by 2002:a17:902:7144:b029:12b:24ce:a83c with SMTP id u4-20020a1709027144b029012b24cea83cmr5859162plm.54.1628581040292; Tue, 10 Aug 2021 00:37:20 -0700 (PDT) Received: from localhost ([122.172.201.85]) by smtp.gmail.com with ESMTPSA id 20sm28187764pgg.36.2021.08.10.00.37.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Aug 2021 00:37:19 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Vincent Donnefort , lukasz.luba@arm.com, Viresh Kumar , Matthias Brugger Cc: linux-pm@vger.kernel.org, Vincent Guittot , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 4/8] cpufreq: mediatek: Use auto-registration for energy model Date: Tue, 10 Aug 2021 13:06:51 +0530 Message-Id: X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@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/mediatek-cpufreq.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 2.31.1.272.g89b43f80a514 Reviewed-by: Lukasz Luba diff --git a/drivers/cpufreq/mediatek-cpufreq.c b/drivers/cpufreq/mediatek-cpufreq.c index 87019d5a9547..4743f2e58b97 100644 --- a/drivers/cpufreq/mediatek-cpufreq.c +++ b/drivers/cpufreq/mediatek-cpufreq.c @@ -448,8 +448,6 @@ static int mtk_cpufreq_init(struct cpufreq_policy *policy) policy->driver_data = info; policy->clk = info->cpu_clk; - dev_pm_opp_of_register_em(info->cpu_dev, policy->cpus); - return 0; } @@ -465,7 +463,8 @@ static int mtk_cpufreq_exit(struct cpufreq_policy *policy) static struct cpufreq_driver mtk_cpufreq_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 = mtk_cpufreq_set_target, .get = cpufreq_generic_get,