From patchwork Tue Aug 10 07:36:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 12428143 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73646C4338F for ; Tue, 10 Aug 2021 07:39:47 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3530260F38 for ; Tue, 10 Aug 2021 07:39:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3530260F38 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=OmlTOLlQOpshONziY19eJBo4zqnan/6vKmbKgnziZ1w=; b=dXkpVC6WVoUjtJ WMs+EvQ1bVXn+ms46i7jhOenrAhUpc7cNp626/XX6v01e3EuS/BEJhjj0ImZoNy3wehNH9hY9CsXE iaGvFt+tHXRWPaFK70OrW2PPGMXiZaciEARSzTlbKgotyZ4mPfan4Qw/sMt956DxYzbz2yDzdnmB+ 02rXEFiR9qrvn5xeERVbRSphPENytgxUXLB6gD8eD+nvm6MXC2wqba4OX89g2iC+63M3nvDjQo9hB JlCjI/RkbrAj7vy/V182hOzl0KNkQLHJkvYyOdYQdjkQMOVAl/WcRJOOK+kbNk0vrZH39Ptz5eRou dHF1/kc78YKzE0g2oZ4A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mDMKC-002kpX-27; Tue, 10 Aug 2021 07:37:24 +0000 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mDMK5-002knh-SH for linux-arm-kernel@lists.infradead.org; Tue, 10 Aug 2021 07:37:21 +0000 Received: by mail-pl1-x62f.google.com with SMTP id k2so19767958plk.13 for ; Tue, 10 Aug 2021 00:37:17 -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=l+OKnXMPuWjj4W4bJLq3zK2g9mX6oy/b+uBVNWEhoHA=; b=tDJZDgwt6Zksre0+Hb84Oaba+GoGOFFnBNTSeFFbIxWMY/kmyer6CIsG5m8Gy1g4kk ZPUAYeVRYBtzn0FBsxM4HhlemFAWLIb56qQo4pQnz6c5f7xENOK6is2MpgB5M1+OBV+S 9Zm/29cSjLdXxi+vsEPSUIH6KgUXgXJsq0AylkYvvSZhObcjRBgiojCe/7Sj210pOp80 B+rZ+ivfcTLYlFni4Hj2lO6nKUPI0+ITlM7b3vSLzNp2txKbP/hwxM67bbsz45XYtwBD 0fFIr55WXt/JEs1cPOIdCNfXMztD8eqHJaqaBeHvwiddMhcl6kMq2iyk2VxenpTkoJfB SiDg== 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=l+OKnXMPuWjj4W4bJLq3zK2g9mX6oy/b+uBVNWEhoHA=; b=ggsjqAeIsM1U2CgP8Lfrohu7+nQhR3jw1pGUd7Q13fIoXIaI21shxeoYPHQ46VMZFD cMSvxM4lx8ja+sV6JJ/UibNRWNlIQxJ/IYkzsHmWaouVkXw0/jr5OlkjgmMUwQ2ckvfj sCxe7z7mX1brDyJp2nhVX3BNzkw/qrh4onKsQFd8dRbAbKVM9nOL/9mgqDN/hwpNqvz+ gSwMMFOxLm/Nb9ns8c+78jypU1eC4aEXB9o22k62osV8nvp3solAR6cqK6EAiomZhj6f 91XOhOpiqpq9fGN3tGGvVxyd3qVL5turnHxWy5ddiuGCX+Tbn28/j4iciqXUhaxRlRbm 4M9Q== X-Gm-Message-State: AOAM533aYZE8md8egwMsYYjFKPkx11zCpjp2lm+IiR3Aw2vooHtQJ/Yu 78WvSmnFrXrCZk1Ji6hne5w5QQ== X-Google-Smtp-Source: ABdhPJxsNfQtKMmDJCqfKBGePJ4HXpw4jtllLvQqCujxTBROh6Vo5ApG0dxLBFcfmn+AeKmqFYOShg== X-Received: by 2002:a65:5c48:: with SMTP id v8mr8527pgr.411.1628581037290; Tue, 10 Aug 2021 00:37:17 -0700 (PDT) Received: from localhost ([122.172.201.85]) by smtp.gmail.com with ESMTPSA id d9sm21546884pfv.161.2021.08.10.00.37.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Aug 2021 00:37:16 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Vincent Donnefort , lukasz.luba@arm.com, Viresh Kumar , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team Cc: linux-pm@vger.kernel.org, Vincent Guittot , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/8] cpufreq: imx6q: Use auto-registration for energy model Date: Tue, 10 Aug 2021 13:06:50 +0530 Message-Id: X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210810_003717_955370_9566140E X-CRM114-Status: GOOD ( 14.41 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 Reviewed-by: Lukasz Luba --- 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,