From patchwork Tue Aug 2 05:32:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 12934239 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 D672BC00140 for ; Tue, 2 Aug 2022 05:34:11 +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:References:In-Reply-To: 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: List-Owner; bh=p7TGePwF+yGpEjQ49byZK+dQ9VDgZksJ7V6+nlaolNY=; b=LsLk8tGjqX48r8 5uxG9pTpkoTC/nFn3rJW72BQUpX19Uq/CWkxmKl43f8Fz9DiaHJ9R+w+V1k1a+42VIJ4lqygAJ2NC yZW/hJqvg7zIrWvw6ZwrpT6o0h4sYz+IAQEsEp920+S1r5/DbdJjwqP1ZljXpadYIjhNshLQUc7Yl 3JIIK+gOpGsmBn7qi4uisrBTBjS+FyVVyF945TDEX791BU+joCuItqtNahDsxpFvNT8f6XlfMK4Yo DQmbIqga80dPhHe0qY7HRFxnxi/rEWH4dqC7jALBx8Jb/kpc49OJJ/9bkkZa6Zm8VRnFQh/L4dQ+v NUjfgwMHfgZyphcyIfaQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oIkWa-00Acnb-6M; Tue, 02 Aug 2022 05:33:00 +0000 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oIkW2-00AcXn-Hk for linux-arm-kernel@lists.infradead.org; Tue, 02 Aug 2022 05:32:28 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 062B3320084E; Tue, 2 Aug 2022 01:32:24 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Tue, 02 Aug 2022 01:32:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1659418344; x=1659504744; bh=Cd xH8UECdWP/FcfgxxRpxsH2KZRjenbkyAWm1xRm+GE=; b=G4FKdF+nAkhHdDc9xU V11QudM9pIImMjuaM/1DmummhBzGUwRaxnApIpJO9PT+x8KJeUa4RFgyb8cLhSUb OdB7KHKZxTBtuMRSEc1x/eFPx21cpBReM3SJbtjPsts7kBVmKf+KeSeH6x4On0oL riHKBDio9FODZoJqxjgEeDECVSuuw/p/CtT/00y435ix+pR8oQJrA/Quyx2cs5rh yfRUGqlokjL/9oW6w60tbGRe7kUHjaLFciu13qnxPPLGlRUhFd6CAaudnNksciyX wELgA9FRSd6/af82YdqcRhffq2jfaaFsg45VI/dcChtbRo9ztElWRdyZX6TgWpWJ 0rYw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1659418344; x=1659504744; bh=CdxH8UECdWP/F cfgxxRpxsH2KZRjenbkyAWm1xRm+GE=; b=bf0f5UIm+QtFpyTXIdcU8+e1WUEMp 5PN8EQ6pLBYw1Cjfqld+K7Mc4oganQYhXhavV53ZUqPtDcTr2N/2FnkmKkzkNd+6 i0IIcCHOf73WdehybnnyJfE4gEGs28O7/6gnllHQVWUqkqJlMwNyfMhJRBHM7kHL QXlE4XRp+N4zmEANOUJlY8Q0IY3aZLqucV82g2mh5uqWUn55Q0fs+h7Lm0rumr1q tXZQSWvUoOsXPw7daooIMVemBJ7mC3sgEgpSfZ4r23BlBRSROLCcJahxQQXfesRu fIB0wY1dQnsFVtBOHkIhPrx/BifYd/L6hPyTn8Xu2dZ/knJfWdnPv+sDQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvddvgedgleejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepufgrmhhu vghlucfjohhllhgrnhguuceoshgrmhhuvghlsehshhholhhlrghnugdrohhrgheqnecugg ftrfgrthhtvghrnhepgffhvefhgfehjeehgfekheeuffegheffjeegheeuudeufeffhffh ueeihfeufffhnecuffhomhgrihhnpeguvghvihgtvghtrhgvvgdrohhrghenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehsrghmuhgvlhesshhh ohhllhgrnhgurdhorhhg X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 2 Aug 2022 01:32:23 -0400 (EDT) From: Samuel Holland To: Liam Girdwood , Mark Brown , Chen-Yu Tsai , Jernej Skrabec , Krzysztof Kozlowski , Rob Herring Cc: Samuel Holland , Maxime Ripard , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev Subject: [PATCH v2 3/4] regulator: dt-bindings: Add Allwinner D1 LDOs Date: Tue, 2 Aug 2022 00:32:12 -0500 Message-Id: <20220802053213.3645-4-samuel@sholland.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220802053213.3645-1-samuel@sholland.org> References: <20220802053213.3645-1-samuel@sholland.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220801_223226_650865_E497C4B3 X-CRM114-Status: GOOD ( 14.83 ) 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 The Allwinner D1 SoC contains two pairs of in-package LDOs. One pair is for general purpose use. LDOA generally powers the board's 1.8 V rail. LDOB generally powers the in-package DRAM, where applicable. The other pair of LDOs powers the analog power domains inside the SoC, including the audio codec, thermal sensor, and ADCs. These LDOs require a 0.9 V bandgap voltage reference. The calibration value for the voltage reference is stored in an eFuse, accessed via an NVMEM cell. Neither LDO control register is in its own MMIO range; instead, each regulator device relies on a regmap/syscon exported by its parent. Signed-off-by: Samuel Holland --- Changes in v2: - Remove syscon property from bindings - Update binding examples to fix warnings and provide context .../allwinner,sun20i-d1-analog-ldos.yaml | 65 +++++++++++++++++++ .../allwinner,sun20i-d1-system-ldos.yaml | 57 ++++++++++++++++ 2 files changed, 122 insertions(+) create mode 100644 Documentation/devicetree/bindings/regulator/allwinner,sun20i-d1-analog-ldos.yaml create mode 100644 Documentation/devicetree/bindings/regulator/allwinner,sun20i-d1-system-ldos.yaml diff --git a/Documentation/devicetree/bindings/regulator/allwinner,sun20i-d1-analog-ldos.yaml b/Documentation/devicetree/bindings/regulator/allwinner,sun20i-d1-analog-ldos.yaml new file mode 100644 index 000000000000..19c984ef4e53 --- /dev/null +++ b/Documentation/devicetree/bindings/regulator/allwinner,sun20i-d1-analog-ldos.yaml @@ -0,0 +1,65 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/regulator/allwinner,sun20i-d1-analog-ldos.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Allwinner D1 Analog LDOs + +description: + Allwinner D1 contains a set of LDOs which are designed to supply analog power + inside and outside the SoC. They are controlled by a register within the audio + codec MMIO space, but which is not part of the audio codec clock/reset domain. + +maintainers: + - Samuel Holland + +properties: + compatible: + enum: + - allwinner,sun20i-d1-analog-ldos + + nvmem-cells: + items: + - description: NVMEM cell for the calibrated bandgap reference trim value + + nvmem-cell-names: + items: + - const: bg_trim + +patternProperties: + "^(aldo|hpldo)$": + type: object + $ref: regulator.yaml# + +required: + - compatible + - nvmem-cells + - nvmem-cell-names + +unevaluatedProperties: false + +examples: + - | + audio-codec@2030000 { + compatible = "simple-mfd", "syscon"; + reg = <0x2030000 0x1000>; + + regulators { + compatible = "allwinner,sun20i-d1-analog-ldos"; + nvmem-cells = <&bg_trim>; + nvmem-cell-names = "bg_trim"; + + reg_aldo: aldo { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + }; + + reg_hpldo: hpldo { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + }; + }; + }; + +... diff --git a/Documentation/devicetree/bindings/regulator/allwinner,sun20i-d1-system-ldos.yaml b/Documentation/devicetree/bindings/regulator/allwinner,sun20i-d1-system-ldos.yaml new file mode 100644 index 000000000000..c95030a827d6 --- /dev/null +++ b/Documentation/devicetree/bindings/regulator/allwinner,sun20i-d1-system-ldos.yaml @@ -0,0 +1,57 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/regulator/allwinner,sun20i-d1-system-ldos.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Allwinner D1 System LDOs + +description: + Allwinner D1 contains a pair of general-purpose LDOs which are designed to + supply power inside and outside the SoC. They are controlled by a register + within the system control MMIO space. + +maintainers: + - Samuel Holland + +properties: + compatible: + enum: + - allwinner,sun20i-d1-system-ldos + +patternProperties: + "^(ldoa|ldob)$": + type: object + $ref: regulator.yaml# + +required: + - compatible + +unevaluatedProperties: false + +examples: + - | + syscon@3000000 { + compatible = "allwinner,sun20i-d1-system-control"; + reg = <0x3000000 0x1000>; + ranges; + #address-cells = <1>; + #size-cells = <1>; + + regulators { + compatible = "allwinner,sun20i-d1-system-ldos"; + + reg_ldoa: ldoa { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + }; + + reg_ldob: ldob { + regulator-name = "vcc-dram"; + regulator-min-microvolt = <1500000>; + regulator-max-microvolt = <1500000>; + }; + }; + }; + +...