From patchwork Tue Aug 10 07:36:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 494321 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:396:0:0:0:0 with SMTP id y22csp3682921jap; Tue, 10 Aug 2021 00:37:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxP1C2DkJVHZJpFLie9Pe1XHL/8PCHANiwQ5y9yDi+soKCW4X1cfnfiiCzEaJ5yJjSCGDhY X-Received: by 2002:a5e:da04:: with SMTP id x4mr123719ioj.199.1628581038456; Tue, 10 Aug 2021 00:37:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628581038; cv=none; d=google.com; s=arc-20160816; b=JLyEm5z7+xbhrO/X5KuMIM+c2Fda4GxqJ94grtM+lj46kjxUwdWsqSGrl0ER9xjV5M HlZu4y4WR/MXr4nQ0S7tyLPU1GRhvI4kPY8UtfDdccHs66MIIhnuesVXglr3Y0zr+eVC 1vl2lTrm/RB679oP9hHI3ezMxFXhI9tuDL9Yq90LYujHdb1WmRz/RrPMsThrEEtZJrWl a/DWozf2UF4R4ju3KUFglacLHrjEfk0I+62QCgspDUEeyCk34bF2kzKZrWriyui0ZasO SuM0HW9GlEsm+mTQ0LWS4gaWmsjWV39OslcISSCIpaJj7E3+E0SbTwUWXGzANK8vfF7/ XcfQ== 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=XXQZ6ZCwiAFsxkwkNz7ph1BRlARXOF8YuCGygV0SpXs=; b=c0qeq4DAVtnTAW9Z1vLKy6rva/G+U2wJwVw1fPThrLaN186iBDc5fRA6MVg9hAa5in eqzmrtkNOfc8GEwBnCP2UrmPuMPzwn6HiuT4BvT+Zmh7bbuDh69ktRGFPy9+b75KRUuq j4yr6b/eDQrx2P1znPw+AoJKOie8v7sYYjvCfx6FcNaD3poQ9vTpYrhU0hnvsIetXt39 HLUr/rIUwxYUS4g0uaZSaGVgrZYvnLZ4vDEgeaI1HvUzS4xPNxJGBtvcP/vuG+eJa6bP g798p5e0pOkgPfuCrIdCKBPVNoQRZhBs/olsbZfziy1rI+utNz2yB3qoP+tQIwjYwe07 X6LA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Kn615fl5; 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.18; Tue, 10 Aug 2021 00:37:18 -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=Kn615fl5; 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 S233833AbhHJHhi (ORCPT + 7 others); Tue, 10 Aug 2021 03:37:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235235AbhHJHhh (ORCPT ); Tue, 10 Aug 2021 03:37:37 -0400 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B44EAC061796 for ; Tue, 10 Aug 2021 00:37:14 -0700 (PDT) Received: by mail-pl1-x636.google.com with SMTP id j3so19817563plx.4 for ; Tue, 10 Aug 2021 00:37:14 -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=XXQZ6ZCwiAFsxkwkNz7ph1BRlARXOF8YuCGygV0SpXs=; b=Kn615fl51FeOD52lrtpgeS7SnpliWdUH/DpbmWYGWHk30G/nLAaMrllwgIn5weKJJC e5Jhdl9JeKyqspRiJ1kyUWv0qr/RxWMdiFtZnq269arO0CiT7hLub8mqmgBolBUvGgbN UVVVrZuv7+NYF5577lZCH+2wcgxlgAatlSl9AJeJW79wwirigzP/D3w5NLswTE+GCSGk DxPhctc5QEbB64l6CsM+7WK82AJK+8f7d2W+Q7OtzOgVemxGd+ejqT33WeJ9pzP4G7z2 455pT63z/E0vj2VhGPMIBs9bR6GhK+90AqBXrhy67N6mk0KmD8QeAMGKmAlJcxatlxfc 8txw== 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=XXQZ6ZCwiAFsxkwkNz7ph1BRlARXOF8YuCGygV0SpXs=; b=Q3uvjf3OqkaJMy/KT2wwNaFmut3o1+5OCv/HOMgFuh18NBkDmXyD1w9AF53eac59Cz 3cMAWDwEFGKk6gHaPtf0bxMt1p+RKO24Ie7i2Bjgnkta/oW87TeWq9/VfuCpK4t1OBk1 hMR+u4GSmTutNf52gd71FQP7MJaQ8UG2mUbjqkweWthjooCPM+9EvAqJP0O6nua5QsWo f6GON3kNCU6HhOL4lnHcP88DUktaJmGFtyW5bve7YkJT6mwu16qCE9enGh0oUZDwy+QZ UA6e89rAsm4kpEgv2q4parm7VqExWQOEVaIVTJnfLpFZt6Buo/6YUNF2mht59wYk5+OC n6nQ== X-Gm-Message-State: AOAM531cvDhrBcwy+tAKLPux7QaA78qzBZMhUgOSUgu8/EFR12Icx/zT MzS0IY83lR/RJKHwmKBQ3LKTAQ== X-Received: by 2002:aa7:8d94:0:b029:3a0:a513:e13a with SMTP id i20-20020aa78d940000b02903a0a513e13amr21899757pfr.56.1628581034296; Tue, 10 Aug 2021 00:37:14 -0700 (PDT) Received: from localhost ([122.172.201.85]) by smtp.gmail.com with ESMTPSA id hd21sm1912831pjb.7.2021.08.10.00.37.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Aug 2021 00:37:13 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Vincent Donnefort , lukasz.luba@arm.com, Viresh Kumar Cc: linux-pm@vger.kernel.org, Vincent Guittot , linux-kernel@vger.kernel.org Subject: [PATCH 2/8] cpufreq: dt: Use auto-registration for energy model Date: Tue, 10 Aug 2021 13:06:49 +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/cpufreq-dt.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 2.31.1.272.g89b43f80a514 Reviewed-by: Lukasz Luba diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c index ece52863ba62..b727006e85af 100644 --- a/drivers/cpufreq/cpufreq-dt.c +++ b/drivers/cpufreq/cpufreq-dt.c @@ -143,8 +143,6 @@ static int cpufreq_init(struct cpufreq_policy *policy) cpufreq_dt_attr[1] = &cpufreq_freq_attr_scaling_boost_freqs; } - dev_pm_opp_of_register_em(cpu_dev, policy->cpus); - return 0; out_clk_put: @@ -176,7 +174,8 @@ static int cpufreq_exit(struct cpufreq_policy *policy) static struct cpufreq_driver dt_cpufreq_driver = { .flags = CPUFREQ_NEED_INITIAL_FREQ_CHECK | - CPUFREQ_IS_COOLING_DEV, + CPUFREQ_IS_COOLING_DEV | + CPUFREQ_REGISTER_WITH_EM, .verify = cpufreq_generic_frequency_table_verify, .target_index = set_target, .get = cpufreq_generic_get,