Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp617358pxm; Wed, 2 Mar 2022 05:22:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJwnxycadURACmjO9c1KwImo2eSfCVI1J/aCqAZWbMjk5ZZ5myKv9msewjNPJKzjv4XISvwx X-Received: by 2002:a17:906:8143:b0:6cf:73c1:8a0 with SMTP id z3-20020a170906814300b006cf73c108a0mr23236765ejw.406.1646227333001; Wed, 02 Mar 2022 05:22:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646227332; cv=none; d=google.com; s=arc-20160816; b=PifCRWKxIVX485EwgSd4upa7spEIpt3YpnGTbkT4yptqI/jSyIoQZ1WxC9c/ecUWc8 SE2hOeHV4tL0ADJEqHOR83tJEgOWgnJ/3nS5eNrcuNsahMNMsImRHqTiLiokICf65AdW Y3itAe+/bs+isnELP/ONMLaKerl0ygFZ9jgvc0yYSlsnRDbu6GzM23SIahgARKqXkkic TmB2K78cqZTD9g89ica9GhIFJGfuwlGiU4pR3+Ib9o6etLGDA3wEmml/hmXeDDTW2Zm1 7iE8vEReES+ICxWoiD4dbd8NF2FthxK224HKs38WG6XxF2f2qFp3sWHi8vMVlJMZnU9H JHlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=WYQVzh+xbnyv2Dyow72zAPwBW+YE4VMmK11XU013vZ8=; b=dOQYUzTqjEjJnunZxYHpvH8avbtRYF1irTg0T/uT4TiDjG+Jp426tBtYCYYxDmY9GE 3YfFXDBYMmcs5pXdTJmWxBxi1DRjOGKKQkh2aDV5jAkTo6+xBjU2eKkOk9IzsbF3iYZ/ iT88r/L9tKUSQQR7UEFMYcNrvHb7tlsbz/lOG5Ca3C/YC88raLvU31nvepwqBJfiqPQK RnX3C8RlfeYnTqI2qPGEcQ7EHL5X9A19ES+ShhB93+AHzPbyiQwHXaMerOwhFTOc6sWw ZpHLctQe5wVcvIuAPonnyY8hR+mYH291CF/Quh/rS0nUEdB/Dav8p+PI8OTlOZICQF4N z6Mg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m8-20020a1709062b8800b006cf723aeb54si9846966ejg.667.2022.03.02.05.21.48; Wed, 02 Mar 2022 05:22:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S241517AbiCBLab (ORCPT + 99 others); Wed, 2 Mar 2022 06:30:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241416AbiCBLaS (ORCPT ); Wed, 2 Mar 2022 06:30:18 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7047E7DA89; Wed, 2 Mar 2022 03:29:35 -0800 (PST) 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 3A6611424; Wed, 2 Mar 2022 03:29:35 -0800 (PST) Received: from e123648.arm.com (unknown [10.57.21.27]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id ECE963F70D; Wed, 2 Mar 2022 03:29:32 -0800 (PST) From: Lukasz Luba To: linux-kernel@vger.kernel.org Cc: lukasz.luba@arm.com, dietmar.eggemann@arm.com, viresh.kumar@linaro.org, rafael@kernel.org, daniel.lezcano@linaro.org, nm@ti.com, sboyd@kernel.org, mka@chromium.org, dianders@chromium.org, robh+dt@kernel.org, devicetree@vger.kernel.org, linux-pm@vger.kernel.org Subject: [PATCH v5 3/5] PM: EM: add macro to set .active_power() callback conditionally Date: Wed, 2 Mar 2022 11:29:15 +0000 Message-Id: <20220302112917.27270-4-lukasz.luba@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220302112917.27270-1-lukasz.luba@arm.com> References: <20220302112917.27270-1-lukasz.luba@arm.com> X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The Energy Model is able to use new power values coming from DT. Add a new macro which is helpful in setting the .active_power() callback conditionally in setup time. The dual-macro implementation handles both kernel configurations: w/ EM and w/o EM built-in. Reported-by: kernel test robot Signed-off-by: Lukasz Luba --- include/linux/energy_model.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/energy_model.h b/include/linux/energy_model.h index 6377adc3b78d..9f3c400bc52d 100644 --- a/include/linux/energy_model.h +++ b/include/linux/energy_model.h @@ -116,6 +116,7 @@ struct em_data_callback { struct device *dev); }; #define EM_DATA_CB(_active_power_cb) { .active_power = &_active_power_cb } +#define EM_SET_ACTIVE_POWER_CB(em_cb, cb) ((em_cb).active_power = cb) struct em_perf_domain *em_cpu_get(int cpu); struct em_perf_domain *em_pd_get(struct device *dev); @@ -264,6 +265,7 @@ static inline int em_pd_nr_perf_states(struct em_perf_domain *pd) #else struct em_data_callback {}; #define EM_DATA_CB(_active_power_cb) { } +#define EM_SET_ACTIVE_POWER_CB(em_cb, cb) do { } while (0) static inline int em_dev_register_perf_domain(struct device *dev, unsigned int nr_states, -- 2.17.1