Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3562207pxt; Tue, 10 Aug 2021 06:28:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyjll8TMXyEL0aQkE+OwwV5SgXUjl1o1mdWDi4XPNZGmbstvYoeakGPiWHnGkCag+wBbeXB X-Received: by 2002:a17:906:270f:: with SMTP id z15mr21026358ejc.348.1628602127492; Tue, 10 Aug 2021 06:28:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628602127; cv=none; d=google.com; s=arc-20160816; b=eZe2v3zQQ1BtvELLuZ8GEdEuSVJb6zE/YpD426NxlSem2SZu54cPEhgjITP30P8BHH Zspy2vXheox5k3jaK+wJW2uPkkdwecEyyjD/BRCat3sR45EOkE06K/hEf0ZMoiVxNagM UK7hw4qkcqWAeyrUsvZMKd0HkxqFz//5yjqIGuMcptzW4tctdXr84ncUyNK9P6qzGBZc WxT3cmWr4Ghgno5c0H2WJ9S8Gkqo0IHt00qTZfob1IgQbYzInphmMv2IMkXJDXLHrKZo 6YO24UbNNobbeb9mg7uTM2QJRsE3RAfbTRu3bv8VjyZ9N5JxF7JldiZWhRLbjCACuWxO Wemg== 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=zUxaJh1MVhOFCRlr98GHQ6zX8urk7TxKwFWX1nUYqKU=; b=DYHVSDMlgO3IaTxss7FOfuTv4m2ojjv1iszYRggJLqKB/oZhOK6d7e78wP/ZFQGpVc bl3IKEQDXqv1EiY8MLgjwGF7Nev38wGS0jpTYTYV8jq0LPMOZTvaOLySBApdluXJYCvY LeWIFiBRfi/+Go4qWK7jo0sHwC27Kl1GTSiYiUWZMd8SrkZLuo8aNCjf++Pm8QVZGodT D8Al7MWZgDtiOSN7zjs8jG3jdAdgSg1x3id0MQV9pOoxqqYHCWaWHf0kcxC2sNdHAZxc TanuHtdkvq+trMCoXOCtKCA0jeyXoV5piH3DQBMdjFuf09OLTZquHjDMFsTppGWxvdpa jECA== 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 u10si20843039edy.509.2021.08.10.06.28.20; Tue, 10 Aug 2021 06:28: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; 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 S236481AbhHJKWN (ORCPT + 99 others); Tue, 10 Aug 2021 06:22:13 -0400 Received: from foss.arm.com ([217.140.110.172]:53000 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239790AbhHJKUm (ORCPT ); Tue, 10 Aug 2021 06:20:42 -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 81DEF6D; Tue, 10 Aug 2021 03:20:20 -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 CE5C93F70D; Tue, 10 Aug 2021 03:20:17 -0700 (PDT) Subject: Re: [PATCH 3/8] cpufreq: imx6q: Use auto-registration for energy model To: Viresh Kumar Cc: Rafael Wysocki , Vincent Donnefort , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , linux-pm@vger.kernel.org, Vincent Guittot , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: From: Lukasz Luba Message-ID: Date: Tue, 10 Aug 2021 11:20:16 +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/imx6q-cpufreq.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c > index 5bf5fc759881..aa8df5b468d7 100644 > --- a/drivers/cpufreq/imx6q-cpufreq.c > +++ b/drivers/cpufreq/imx6q-cpufreq.c > @@ -192,14 +192,14 @@ static int imx6q_cpufreq_init(struct cpufreq_policy *policy) > policy->clk = clks[ARM].clk; > cpufreq_generic_init(policy, freq_table, transition_latency); > policy->suspend_freq = max_freq; > - dev_pm_opp_of_register_em(cpu_dev, policy->cpus); > > return 0; > } > > static struct cpufreq_driver imx6q_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 = imx6q_set_target, > .get = cpufreq_generic_get, > Reviewed-by: Lukasz Luba