Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1243325rwi; Thu, 13 Oct 2022 10:53:31 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6/9SUqcyNJorxCT3RQVI9a39XX+KKw29GRfr5itED7A2K9W+cOSbQLKNFmCeV82WRlWTSk X-Received: by 2002:a63:f206:0:b0:446:eb31:47e0 with SMTP id v6-20020a63f206000000b00446eb3147e0mr898171pgh.491.1665683611640; Thu, 13 Oct 2022 10:53:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665683611; cv=none; d=google.com; s=arc-20160816; b=Fj0rqHDvkK1IUDxVQsVcRq3pQqNHozJ1F145RyHMA/wannfQyMJEKcjhbzObZvCXDY zNTGHnNw0xR7ZuJ/zUjQ9Q3n3H+F+wQ322RgdoAMi2y8YIHBVLbw9kiw8sjlLfBc12fo 2ktq71nU+ifBhk8sQBDZI72SXpto1dDW21eoFTYlRE9heSLvgXunkRFh9iATixJJ0asc Z24MH8x41iZQhcw3VusGRs0roVYaGtQWAVzPrWZxWMlLoxQpNaqua86zC+oSrDyLIsij Ru2e44Z9ZZXDV4Eajv6HW2TmsDPimQJRG3aXMy6exSb1Icr32Mg2eZvHCuhNUFwlj4fn EQTg== 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=ISMmfFdJnoxVw1XPsPhWBFw9to4Ba9OLvQiPODgfYyA=; b=ZZOtsvOG1bx8wZPJlQ8KIQKML5JitoJd3MxZ1z3VU0E+JwLm8Uv2L6tKuRr3+xQigR DtBzVUqZLM9h/rAPnZCKkjOevpJLY4Gl6iQeQ+JD1bBL+6qkHlRe/96Dst+E60wM3E15 5nI2il5vWTQbYtdEYiNsQ0d7fcoJ45jaWl40fSYU0AJ5WSqcEQ5ucU1v9SFjJ5WP26bW jo0mpfUX+fJ8NcqU1d66qL6Gy2EopLBiPS3MU5PRhX8VgT3DfcjRTEOb8AYvXoZs1gfH a878BPpHRlj+cWgP1bJGWzQ60/E0F1XhbE0lVChCzf0Kth7SqocNTXNN8QQe2GZcMfgp 6ZYg== 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 a12-20020a634d0c000000b0043087ac1272si21922757pgb.586.2022.10.13.10.53.19; Thu, 13 Oct 2022 10:53:31 -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 S229629AbiJMRqe (ORCPT + 99 others); Thu, 13 Oct 2022 13:46:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229462AbiJMRqc (ORCPT ); Thu, 13 Oct 2022 13:46:32 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 67D7213ECC4; Thu, 13 Oct 2022 10:46:31 -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 ED9491424; Thu, 13 Oct 2022 10:46:36 -0700 (PDT) Received: from e120937-lin.home (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6DFB63F766; Thu, 13 Oct 2022 10:46:28 -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, wzmuda@marvell.com, dan.carpenter@oracle.com, Cristian Marussi Subject: [PATCH v3 0/1] Add ARM SCMI Powercap driver Date: Thu, 13 Oct 2022 18:46:11 +0100 Message-Id: <20221013174612.393830-1-cristian.marussi@arm.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE 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 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 have been squashed into this patch in V3. Based on v6.0. Thanks, Cristian --- v2 --> v3 - rebased on v6.0 - added review tag - squashed Dan Carpenter fixes into this powercap patch: https://lore.kernel.org/linux-arm-kernel/20220906142337.1697569-3-cristian.marussi@arm.com/ https://lore.kernel.org/linux-arm-kernel/20220906142337.1697569-4-cristian.marussi@arm.com/ 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 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.34.1