From patchwork Wed Aug 17 10:54:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Marussi X-Patchwork-Id: 12945707 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id EC928C2BB41 for ; Wed, 17 Aug 2022 10:55:55 +0000 (UTC) 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: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:In-Reply-To:References: List-Owner; bh=eCGJ151bM8lznd5SAJvhpvg1cu4ZH2+GTnnJuqH3eAw=; b=ZzvQURoE6kFwx3 IvaCenfHWRCgfguBRnm23NNdPv6IHa3Twra1v0rntbqIoORpjzXOyI/5WU454Jus1pFzwPKxRajKN Tdtxn8nwrwDRZHyYv3pN38MFgvfZoMhIlfx7LDAcZdTIxCiLEAKxwytMCZ8/HSBwLPOqaY4kq3+N5 TV10yLbitdcTfgrcVFRGyiCkQk30/k4nG3JNOy1d3YiqKoJE/U5sTGeF+708rvAYNyvM1HrP50+di 82w+UsHUXJjJcPI49X+yAKsyD5A4ctFbDu+8laJ9AM/qLc+KfGyjOcBq2ZxLwgW3ZufWhftio0wjz p5ONXjIKWi/OFnod/9yA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oOGhD-000v85-Lr; Wed, 17 Aug 2022 10:54:47 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oOGh9-000v2y-FA for linux-arm-kernel@lists.infradead.org; Wed, 17 Aug 2022 10:54:45 +0000 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 0FBCC113E; Wed, 17 Aug 2022 03:54:43 -0700 (PDT) Received: from e120937-lin.home (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 26A1E3F67D; Wed, 17 Aug 2022 03:54:40 -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, Cristian Marussi Subject: [PATCH 0/3] Add ARM SCMI Powercap driver Date: Wed, 17 Aug 2022 11:54:21 +0100 Message-Id: <20220817105424.3124006-1-cristian.marussi@arm.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220817_035443_614851_60DBCD9A X-CRM114-Status: GOOD ( 10.58 ) 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 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 (with the Fixes tags removed) but for now I have just added them here as patches on top, for clarity and to preserve authorship. The series is based on v6.0-rc1: Thanks, Cristian 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 drivers/powercap/Kconfig | 13 + drivers/powercap/Makefile | 1 + drivers/powercap/arm_scmi_powercap.c | 545 +++++++++++++++++++++++++++ 3 files changed, 559 insertions(+) create mode 100644 drivers/powercap/arm_scmi_powercap.c