Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp4533945rwb; Tue, 6 Sep 2022 08:49:25 -0700 (PDT) X-Google-Smtp-Source: AA6agR6UhK7eGVp0rmueDyrHizAt0IAB8eXsczqxf8b93F3i3sTGF6eh+ctSeIbVVwyLqXI5RF+J X-Received: by 2002:a63:4a21:0:b0:434:7838:ae46 with SMTP id x33-20020a634a21000000b004347838ae46mr6561005pga.559.1662479364898; Tue, 06 Sep 2022 08:49:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662479364; cv=none; d=google.com; s=arc-20160816; b=InXoANufehbNw14EpgZVhFtzzV3syiAVe/kzzX6trgvbkdKWvsp8z6OlApxd8CtfNn 4pR9O0ateplQnupO+6eX3ItXgH3orAEjHz8hIhpPsRtEuN3OjWOO3GhwtefPcgrGv8ev PJ3YsnDHr84x6xOwXhIe6NugL5GI+UwPmbSuCZcMaOErXzVb6N4WDtzn8IicxLlv6ofi Y86+6RQmtCjbAWwY9sTUa1Ag+Ev04KFnSE4AhupLVzXenbjZnrYihCggXvmG4KxMTjuH yX/kYwQcLjrydJHwl45v4eHOSEz3eloRYdV+FrMSeztqcsrgxwIMcXIHdKZeRu+9IIfX E4sg== 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 :message-id:date:subject:cc:to:from; bh=eeasfQXesp/vmDT3/ckZPOkYGB5Uw724p8c6OGLgzjM=; b=WkkyDHk0A361fAVCYIc4aB68rLP1l5SQiippWCXFeVzS//HxHDBy03U0ht3qt56x+G tk3O1NB1REItAgL9Xr+kzQuryD/rMVxcTzgNGVrBbOGbQjxau5dd+LbLtkkGDVfR7Lof tQn7mKrCSJHDHsUyn/ym8xHeXAwvxxaNt4WgcKUWLQjMdd+irUL/cHF8HsQp0IBquVYu WBByea+51gLCSC4a/0zMw0utKWSPKomXQETMwMwQRWAAg8p3GSyCI9Ppo3MEG/cS3fn8 vWG+sg4qAV1qBaYU2bheE4wds2ONgHRYI1QEvNPzX7/n7yfYqSOvpmYC4d+HOK1Srgsf acAQ== 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 g4-20020a1709026b4400b0016f16417f6dsi12707791plt.16.2022.09.06.08.49.11; Tue, 06 Sep 2022 08:49:24 -0700 (PDT) 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 S233357AbiIFPlz (ORCPT + 99 others); Tue, 6 Sep 2022 11:41:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239142AbiIFPiv (ORCPT ); Tue, 6 Sep 2022 11:38:51 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 004D1A00E1; Tue, 6 Sep 2022 07:48:53 -0700 (PDT) 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 D8CF91A2D; Tue, 6 Sep 2022 07:24:31 -0700 (PDT) Received: from e120937-lin.home (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4CBB33F7B4; Tue, 6 Sep 2022 07:24:23 -0700 (PDT) From: Cristian Marussi To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org Cc: sudeep.holla@arm.com, james.quinlan@broadcom.com, Jonathan.Cameron@Huawei.com, f.fainelli@gmail.com, etienne.carriere@linaro.org, vincent.guittot@linaro.org, daniel.lezcano@linaro.org, tarek.el-sherbiny@arm.com, adrian.slatineanu@arm.com, souvik.chakravarty@arm.com, wleavitt@marvell.com, wbartczak@marvell.com, dan.carpenter@oracle.com, lukasz.luba@arm.com, Cristian Marussi Subject: [PATCH v2 0/3] Add ARM SCMI Powercap driver Date: Tue, 6 Sep 2022 15:23:34 +0100 Message-Id: <20220906142337.1697569-1-cristian.marussi@arm.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_NONE,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 short series builts on top of recently introduced SCMI v3.1 Powercap protocol to implement an ARM SCMI Powercap driver which takes care to expose via the Powercap framework all the SCMI Powercap zones that have been discovered asking the SCMI platform firmware. Basic testing has been performed against an emulated SCMI platform supporting SCMIv3.1 Powercap protocol using powercap-utils. A couple of fixes spotted with Smatch by Dan are queued on top of the driver itself; these may have to be squashed finally into the driver itself but for now I have just added them here as patches on top, for clarity and to preserve authorship. The series is based on sudeep/for-next/scmi [1] on top of commit 40d30cf680cb ("firmware: arm_scmi: Harmonize SCMI tracing message format") Thanks, Cristian --- v1 --> v2 - using clamp_t() to simplify normalizations - cleanup style in block of var declarations - refactor scale conversions code - add MAINTAINER entry - refactored normalizations and added dev_dbg Cristian Marussi (1): powercap: arm_scmi: Add SCMI Powercap based driver Dan Carpenter (2): powercap: arm_scmi: Fix signedness bug in probe powercap: arm_scmi: Fix a NULL vs IS_ERR() bug MAINTAINERS | 1 + drivers/powercap/Kconfig | 13 + drivers/powercap/Makefile | 1 + drivers/powercap/arm_scmi_powercap.c | 509 +++++++++++++++++++++++++++ 4 files changed, 524 insertions(+) create mode 100644 drivers/powercap/arm_scmi_powercap.c -- 2.32.0