From patchwork Tue Aug 10 07:36:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 494324 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:396:0:0:0:0 with SMTP id y22csp3683036jap; Tue, 10 Aug 2021 00:37:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxthLnIwO2M63O8ngPAV5jzwjIwsw0576E0PC7G/KYRlm9BTmB1D7GrdMjz1i/BIz7SLoqE X-Received: by 2002:a92:b312:: with SMTP id p18mr117166ilh.233.1628581047831; Tue, 10 Aug 2021 00:37:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628581047; cv=none; d=google.com; s=arc-20160816; b=WrVwixdF6GZIULL3GF1IAumIYO64eqQ/WF0tyJ5m2w21eBDqFjROwc8uJVaWcQ47Aw gP5ertBxBgbdXNd/fmjNu5M2ODV1Q3RRjWRj8JoydQ+qP4XoE2FjIMkPWPYVrKZa9pVf sVAE65f+tN3GRWf5VTFQ1+zvibRGDj1PJPM61QwTQEAfdIjpJpohcg/Psty7DhS5TSwo snDTPE6alU+VjXYl3r1F2XaY+yrioOlDvthnJL7ZrW8LxwWiQ5NRMQo5ZIP74xfI9pDu IvcZNwM1epiFgZFwvTBvg59/C8DB5NGQlJjoeOnhJwsBL6hgW9/jaLMfhctoVQ6RPmGj N0Jg== 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=tPg7HlHiNHIgMXq3ifzrutSGoJ3kBhUfJVLyMOqT33Y=; b=0XoJS1HaTnm90kq+j/hzURr+UaQKnIIJBNz/QVAJF8n40G1NSeqCCHBlgbm4h7lif9 fRvqxF0/mENURw/Uz2Vz5CyHO+oZ22APeKNCWg1YHtRNEvJ8yT93EvqVTyu/ZrPN05O0 CtUXCYYOjNFoUwjF+qRSSEWTLEGqCcmHUg7aI4457cDZwIs+7WAnRnma+rVI8bm40CNR y2qjgGeS5zPOZly4g1D4SewvpFdAmeJ4/m2aCq0HroNyd0fsQQgKyw8GHRjpFJ0c6j8j VPAOi8RH0i4XVIvsJtHQXk85DUXuHBENdWL809NVqCvEwc1SHFdTwnVgZbi3UUCPOtcX 5reA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aNHkIE5n; spf=pass (google.com: domain of linux-omap-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-omap-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.27; Tue, 10 Aug 2021 00:37:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-omap-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=aNHkIE5n; spf=pass (google.com: domain of linux-omap-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-omap-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 S236207AbhHJHhs (ORCPT + 3 others); Tue, 10 Aug 2021 03:37:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235980AbhHJHhp (ORCPT ); Tue, 10 Aug 2021 03:37:45 -0400 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D166C06179E for ; Tue, 10 Aug 2021 00:37:23 -0700 (PDT) Received: by mail-pj1-x1036.google.com with SMTP id bo18so9806981pjb.0 for ; Tue, 10 Aug 2021 00:37:23 -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=tPg7HlHiNHIgMXq3ifzrutSGoJ3kBhUfJVLyMOqT33Y=; b=aNHkIE5ncBMIBjIjJvsC//j+DCdVWU0P4mzCLIQHFyneAmv1sc641l9Q+BDeuVkMJd PNmGFG0IJoM/1JPjohriJqPUme/cxg10EBbwPzE19jElRJFRedJFYBrpS9EiCnkJPzHr GLtZfw09928BFmsHu+W98ZpncTYDBeubpxHs7U7AUpTwy4DiNNHHBEW21Jwb/jKTctRy 0+dUm0n4ZOtUcmaYgKSn/jqluJVRsegnjQ2BCqTdVZpMK/1A1NxOY6IOjlWIU2ra9dj5 hdFCmsxmnfliD8GFswr/gVl+pA67f40FeLQqe3ecQZ8qxvkdGs5Bk1VBb3oBH+D7c8FO 1RDw== 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=tPg7HlHiNHIgMXq3ifzrutSGoJ3kBhUfJVLyMOqT33Y=; b=epQCA0F+Ks1cs1FJoDz9oSOjuSu5hYumiw9qjic1NBolirrYta6D5/EGn1RXIvViBC kdoxesK1dk1HkMcpLOXvFpjTx1GHgB4G672L7dPr4kEm3cygjBxjWnY2L4SsuXVJGU5p OKiuxBS4029zMOSZgYZffXbzFl4ZS7KzkKcU0JMdQI52kmss59H5eG2N1qyw8HqPfC4h dCc0+HL0W3wg4qUevhsI76ST3tm3IJz+32HK0cQmiJB5gYS3sqpMUQqYkMPXRJH/JFTD Je2ANST/u9M0ytmUafhBszWKEObJA68ee+Z+BJCokdQxzEIX0C6rYx0RO+QN2tYqbHcj 78pg== X-Gm-Message-State: AOAM533ZG2DcbNuh22YJqZ+fkw+sidlhwa24fQTRCz1K5ZFlgBSWiWRL d08rL9PMPbMbqdNpPCKWYyRrEg== X-Received: by 2002:a17:90b:1102:: with SMTP id gi2mr29168901pjb.43.1628581043191; Tue, 10 Aug 2021 00:37:23 -0700 (PDT) Received: from localhost ([122.172.201.85]) by smtp.gmail.com with ESMTPSA id 6sm1927629pjk.1.2021.08.10.00.37.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Aug 2021 00:37:22 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Vincent Donnefort , lukasz.luba@arm.com, Kevin Hilman , Viresh Kumar Cc: linux-pm@vger.kernel.org, Vincent Guittot , linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/8] cpufreq: omap: Use auto-registration for energy model Date: Tue, 10 Aug 2021 13:06:52 +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-omap@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/omap-cpufreq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.31.1.272.g89b43f80a514 Reviewed-by: Lukasz Luba diff --git a/drivers/cpufreq/omap-cpufreq.c b/drivers/cpufreq/omap-cpufreq.c index e035ee216b0f..303136f97773 100644 --- a/drivers/cpufreq/omap-cpufreq.c +++ b/drivers/cpufreq/omap-cpufreq.c @@ -131,7 +131,6 @@ static int omap_cpu_init(struct cpufreq_policy *policy) /* FIXME: what's the actual transition time? */ cpufreq_generic_init(policy, freq_table, 300 * 1000); - dev_pm_opp_of_register_em(mpu_dev, policy->cpus); return 0; } @@ -144,7 +143,8 @@ static int omap_cpu_exit(struct cpufreq_policy *policy) } static struct cpufreq_driver omap_driver = { - .flags = CPUFREQ_NEED_INITIAL_FREQ_CHECK, + .flags = CPUFREQ_NEED_INITIAL_FREQ_CHECK | + CPUFREQ_REGISTER_WITH_EM, .verify = cpufreq_generic_frequency_table_verify, .target_index = omap_target, .get = cpufreq_generic_get,