Received: by 2002:ac2:5a04:0:0:0:0:0 with SMTP id q4csp392205lfn; Wed, 2 Mar 2022 09:33:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJyDhMA/PHZuAzn14yKFnHumPoKhqpKXM1Yx2qgMt9jnm1nJtTaeRx3ULVl9xhObP42sNiEl X-Received: by 2002:a17:903:2cb:b0:14f:4fb6:2fb0 with SMTP id s11-20020a17090302cb00b0014f4fb62fb0mr31411835plk.172.1646242429808; Wed, 02 Mar 2022 09:33:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646242429; cv=none; d=google.com; s=arc-20160816; b=EU5T2D0kV7QDBDkgDMQzzyyBAPuMpl6gAtgfWbIvylA+6WZ1Q1q/DkIiQUBFqvqqaW 0glREu2fpMTVqETrA6Y3zyeBvlvghWI8tW3JHA4FrwV0uA9Z5YvzmoaDhwu0F0h9IY/y hnva5C6R4BsRZfXXePrJeE50JXRkJCYPx8Qtan+HPVcrv4RLcMFbuANCt84EUc3+PSyT LsMW9p7Ak2qXKErvmO6MA2HajkeW/JmyMsXfHrf7GgP0ysrV0wQe5nBeHnvsC9CPwPgR KouqY2T30x1B5SkeaXpjGE3gAxMZATBWHU3SzSw8Vbv/Qkcnppq1E2bQgGRGnMN1wqQ1 ZPtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=UAtX7doSGeclPGEmQysRF9yGByv/RstPFMqTatzFfSU=; b=BT6F1ed0tH4XLNM8AR+zPYlaM2EBNMqrSHCBe+7PN2qo+cUwAHBEa6wcyY02rhMZNP ojllfLMhwms9qJANKkgGwiWzw/AliBuX77hTOG/ai/C1m6zvfFhapb0+PjTSTUI29Oj8 s7JOb/N3/2yP1PxPCwCObB2xu0ROT19CSLkuxyTq2f0TG5l2Pbyo9OWn6d8eIeMPCJe7 UZxjbN+v9MTh4+fabKhuG8AIb37LAAWFqS6KQP/bIWg77IZVU/qDPtZzXWMNiy+09Dwb 9pPG45QLBFd/nISpO98CU/gXSgnDSL22FWkFeAePJzsbyBtKyYGAuF9FvzPOnO/M6Z91 vz1Q== 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 m129-20020a625887000000b004e16e1f5aebsi14915592pfb.152.2022.03.02.09.33.17; Wed, 02 Mar 2022 09:33:49 -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 S241337AbiCBLaP (ORCPT + 99 others); Wed, 2 Mar 2022 06:30:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234695AbiCBLaK (ORCPT ); Wed, 2 Mar 2022 06:30:10 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D2F9831214; Wed, 2 Mar 2022 03:29:27 -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 9C43C13D5; Wed, 2 Mar 2022 03:29:27 -0800 (PST) Received: from e123648.arm.com (unknown [10.57.21.27]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 62C4C3F70D; Wed, 2 Mar 2022 03:29:25 -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 0/5] Introduce "opp-microwatt" and Energy Model from DT Date: Wed, 2 Mar 2022 11:29:12 +0000 Message-Id: <20220302112917.27270-1-lukasz.luba@arm.com> X-Mailer: git-send-email 2.17.1 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 Hi all, This patch set solves a few issues: 1. It allows to register EM from DT, when the voltage information is not available. (Some background of the issues present on Chromebook devices can be checked at [1].) 2. It allows to register 'advanced' EM from the DT, which is more accurate and reflects total power (dynamic + static). Implementation details: Existing machinery in the OPP framework now handles "opp-microwatt", similarly to "opp-microamp". It also has helper exported function to get power from OPP. For the EM, it adds a new callback in OPP framework to use this new API and read power while having an opp pointer. It's agreed to work with OPP-v2. Comments, suggestions are very welcome. changelog: v5: - added dual-macro to conditionally setup needed callback and compile on !EM kernel gently - removed 'advanced' word from OPP patch header description v4 [2] Regards, Lukasz Luba [1] https://lore.kernel.org/linux-pm/20220207073036.14901-2-lukasz.luba@arm.com/ [2] https://lore.kernel.org/linux-pm/20220301093524.8870-1-lukasz.luba@arm.com/ Lukasz Luba (5): dt-bindings: opp: Add "opp-microwatt" entry in the OPP OPP: Add "opp-microwatt" supporting code PM: EM: add macro to set .active_power() callback conditionally OPP: Add support of "opp-microwatt" for EM registration Documentation: EM: Describe new registration method using DT .../devicetree/bindings/opp/opp-v2-base.yaml | 23 ++++ Documentation/power/energy-model.rst | 10 ++ drivers/opp/core.c | 25 ++++ drivers/opp/debugfs.c | 3 + drivers/opp/of.c | 108 +++++++++++++++++- include/linux/energy_model.h | 2 + include/linux/pm_opp.h | 12 +- 7 files changed, 179 insertions(+), 4 deletions(-) -- 2.17.1