Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3748603pxt; Tue, 10 Aug 2021 10:23:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwa4KezqyyTfzzK22v5bqQCUDZkBveViIhARp5BZUe1Nuvj4hHvAoHD70WPY7HhkI0HNRAc X-Received: by 2002:a5d:8d83:: with SMTP id b3mr186612ioj.179.1628616190348; Tue, 10 Aug 2021 10:23:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628616190; cv=none; d=google.com; s=arc-20160816; b=oXSo0K9BO7kGGRBrSv5+16fzRBzSfo8SbHY4dubdpTD68g+kO8s+bP5d+UiXyglz7R iUnlmj+5i1EPS/CI3ClywAI1BTvH40fjPbFx7BwLHsqtn+8ZlKDvU+HuJJMVS0F5krix 0CCOlTI2pIgeeoeIaAu4Eg5jPO/UMS3iWxd9u3QCHoDsArYLN6OJ8FS9Z0hBb1MzqvNB IWxlCgPGVut3JWrnIYgB8jg4X7bHIWcZAwRR/nkT5UQXYNEVPyxkCsSTLtqY9nhRWcor HgUSDdEgZ0PoAWaB+Yt3BUsJo0bjUXratabqbjqlyPzrr+DdWobEV2/kMzF4NSIFDDDQ AG5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=seSBdVP0KPQ14bD3Bo1DRf3Cpm9g9UuIdmzP522fJoQ=; b=lcSw3C9aVw56JUdcqXIM4itW2UxgyjdMkVOQJmuPql86be53RBHUjqYhfPABliaNZj vBnmecZZhZPrScycwggqfS3+BpSLsaBwzF7Q6WQrxGmB/DMSPf/ZemkLBkWvI4bo2vkE Bbmg4C5XHLJyfRrzUPDDLwZ6lwgiUsEwbGoTrjO4M7rzuH+ZJU4bbLrzPJED53u4p+we yCB8ObkxtBt38DSYItY3PcUMApXBv3AgManeC2HezJYOVS1rlPZK64i29iwwln0nU/DI 59wknVn83SfvzAQymlW1s6qf/n+GbDI3zUETNsOgwvF+jxmMcXwAJvK12ldNnS3/1mWX B7Mw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u6si11201899ilm.133.2021.08.10.10.22.55; Tue, 10 Aug 2021 10:23:10 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238878AbhHJKVW (ORCPT + 99 others); Tue, 10 Aug 2021 06:21:22 -0400 Received: from foss.arm.com ([217.140.110.172]:53028 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239814AbhHJKVS (ORCPT ); Tue, 10 Aug 2021 06:21:18 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id BD9C76D; Tue, 10 Aug 2021 03:20:56 -0700 (PDT) Received: from [10.57.9.181] (unknown [10.57.9.181]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AC5D73F70D; Tue, 10 Aug 2021 03:20:54 -0700 (PDT) Subject: Re: [PATCH 4/8] cpufreq: mediatek: Use auto-registration for energy model To: Viresh Kumar Cc: Rafael Wysocki , Vincent Donnefort , Matthias Brugger , linux-pm@vger.kernel.org, Vincent Guittot , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org References: From: Lukasz Luba Message-ID: <12fc1e9d-bb74-63c2-7905-c0917df1cf5b@arm.com> Date: Tue, 10 Aug 2021 11:20:53 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/10/21 8:36 AM, Viresh Kumar wrote: > 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(-) > > 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, > Reviewed-by: Lukasz Luba