From patchwork Thu Nov 19 19:10:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Marussi X-Patchwork-Id: 11918851 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CB09CC388F9 for ; Thu, 19 Nov 2020 19:11:58 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 51F4D22226 for ; Thu, 19 Nov 2020 19:11:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="TLFz5Y2F" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 51F4D22226 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-Id:Date:Subject: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=IGAVJZVQmYtZiT2iHXPUXLQr85L8qhV9EiaIEwxdsZ0=; b=TLFz5Y2FKH8TKNaVHh8syDDefO nlYCsqdD8qVVcxKNH1fzAzs8uoUxHAbPUgUCT+fpDT1r45PZTnfrVZt2hZ/YNJjw0UpFFkbA8e+6Z QwMmPTbBHyMveJMJ1UWcgje9gOVn8A5MOENy7JeiVIqMMhO8g9Ro0kCS1E84xNxeHQ3PwO1IfzqG4 WqnM/Rq9xKQG+/mLIGQy0s/V2IfFVWjPeCxOmYpOL0vwd54Z0M+NKhgs5s1zp0O+52h5jNmsKCRkc hTmSipN5HkdUOgh+SJtJ3qUNaJYUjLfvJhsgRqICHMWTLJHjgOgSpTYOWz2DM8ePQRESVWk4uZXML oT/LnlQQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kfpL7-0004PI-1i; Thu, 19 Nov 2020 19:11:29 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kfpL3-0004Nu-6K for linux-arm-kernel@lists.infradead.org; Thu, 19 Nov 2020 19:11:26 +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 7880B1396; Thu, 19 Nov 2020 11:11:24 -0800 (PST) Received: from e120937-lin.home (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 797BC3F70D; Thu, 19 Nov 2020 11:11:22 -0800 (PST) From: Cristian Marussi To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org Subject: [PATCH v6 0/5] Add support for SCMIv3.0 Voltage Domain Protocol and SCMI-Regulator Date: Thu, 19 Nov 2020 19:10:46 +0000 Message-Id: <20201119191051.46363-1-cristian.marussi@arm.com> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201119_141125_346282_B866C328 X-CRM114-Status: GOOD ( 16.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robh@kernel.org, satyakim@qti.qualcomm.com, f.fainelli@gmail.com, vincent.guittot@linaro.org, sudeep.holla@arm.com, broonie@kernel.org, Cristian Marussi , james.quinlan@broadcom.com, Jonathan.Cameron@Huawei.com, souvik.chakravarty@arm.com, etienne.carriere@linaro.org, lukasz.luba@arm.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, this series introduces the support for the new SCMI Voltage Domain Protocol defined by the upcoming SCMIv3.0 specification, whose BETA release is available at [1]. Afterwards, a new generic SCMI Regulator driver is developed on top of the new SCMI VD Protocol. In V4 Patch 3/5 introduced a needed fix in Regulator framework to cope with generic named nodes. The series is currently based on for-next/scmi [2] on top of: commit b141fca08207 ("firmware: arm_scmi: Fix missing destroy_workqueue()") Any feedback welcome, Thanks, Cristian --- v5 --> v6 - reordered dt bindings patch - removed single field struct - reviewed args to scmi_init_voltage_levels() - allocating scmi_voltage_info_array contiguously v4 --> v5 - rebased - VD Protocol - removed inline - moved segmented intervals defines - fixed some macros complaints by checkpatch v3 --> v4 - DT bindings - using generic node names - listing explicitly subset of supported regulators bindings - SCMI Regulator - using of_match_full_name core regulator flag - avoid coccinelle false flag complaints - VD Protocol - avoid coccinelle false flag complaints - avoiding fixed size typing v2 --> v3 - DT bindings - avoid awkard examples based on _cpu/_gpu regulators - SCMI Regulator - remove multiple linear mappings support - removed duplicated voltage name printout - added a few comments - simplified return path in scmi_reg_set_voltage_sel() - VD Protocol - restrict segmented voltage domain descriptors to one triplet - removed unneeded inline - free allocated resources for invalid voltage domain - added __must_check to info_get voltage operations - added a few comments - removed fixed size typing from struct voltage_info v1 --> v2 - rebased on for-next/scmi v5.10 - DT bindings - removed any reference to negative voltages - SCMI Regulator - removed duplicate regulator naming - removed redundant .get/set_voltage ops: only _sel variants implemented - removed condexpr on fail path to increase readability - VD Protocol - fix voltage levels query loop to reload full cmd description between iterations as reported by Etienne Carriere - ensure transport rx buffer is properly sized calli scmi_reset_rx_to_maxsz between transfers [1]:https://developer.arm.com/documentation/den0056/c/ [2]:https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git/log/?h=for-next/scmi Cristian Marussi (5): firmware: arm_scmi: Add Voltage Domain Support firmware: arm_scmi: add SCMI Voltage Domain devname regulator: core: add of_match_full_name boolean flag dt-bindings: arm: add support for SCMI Regulators regulator: add SCMI driver .../devicetree/bindings/arm/arm,scmi.txt | 43 ++ drivers/firmware/arm_scmi/Makefile | 2 +- drivers/firmware/arm_scmi/common.h | 1 + drivers/firmware/arm_scmi/driver.c | 3 + drivers/firmware/arm_scmi/voltage.c | 380 ++++++++++++++++ drivers/regulator/Kconfig | 9 + drivers/regulator/Makefile | 1 + drivers/regulator/of_regulator.c | 8 +- drivers/regulator/scmi-regulator.c | 409 ++++++++++++++++++ include/linux/regulator/driver.h | 3 + include/linux/scmi_protocol.h | 64 +++ 11 files changed, 920 insertions(+), 3 deletions(-) create mode 100644 drivers/firmware/arm_scmi/voltage.c create mode 100644 drivers/regulator/scmi-regulator.c