From patchwork Fri Nov 25 04:01:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 2206 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp3755257wrr; Thu, 24 Nov 2022 20:04:25 -0800 (PST) X-Google-Smtp-Source: AA0mqf7cQ24JAHMctIMs2avGUNzcvf0Dmrb3oLqwhKIv2IWDVtbdNNfOWv8cDW/rHdeawC/w7Tja X-Received: by 2002:aa7:d482:0:b0:461:8503:2b46 with SMTP id b2-20020aa7d482000000b0046185032b46mr33231299edr.202.1669349065124; Thu, 24 Nov 2022 20:04:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669349065; cv=none; d=google.com; s=arc-20160816; b=SaP4W1Z+Mp37NTC+xeQA7XY9XTd9Z3kCP2THVjXQ7H+xw3wBXIvFncsvFxtQv3RUku 9t4Ih9qXjh+1DUiuJ1aE3bWYW+BA+f2bzH4jpQj0A2UmEs9KnMqwq+pPe3jIrI/r14N5 eVl7xEKtQzeTcnUF+r/zaHOtt9kXI8MCX/m4y1y3IY0mIfwr+7X3LUFWH+lz6PQtx5So OkWbRGdMDC1q6u8mS9NmjsBsW/PqZqyv5GAviqEJoEdfLgmf9xf7BJjgeVRlb5bUYMgT 8VJ7gxnWOMM88ueQ95wG124ocBaRQ54v1Z3bg9E+fU+/4k7GEYL4OCqQQe4xenjtodrK JUbQ== 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:feedback-id:dkim-signature :dkim-signature; bh=ABZhlJD5S/ZKX7Bf8fIlM84g5HAFuIAnCW2oNys0fZk=; b=Adm4WQlCVjCEfOrmeBPXxZy2DTZO0IZjBpxkQkCiqELj8sVFUpC+00+5oVFzMj9a5Z 3Hr7jihW/hVGg1DJD9dkl136hf2OAYQ3pGiBj1vpKyR8GTd3tYdjGcgXWEoFqJZUG+VK SRqJ/JFzBe+dVM+OSxjP56RK6shH2BKyhcwzoGZSb4UaMBNQtXoLtRynGwW+YpJvYc/U sKv58ks/jp+VWCLcDwCzf2GXlMxSbxe5Nw0yEPn6kmOB9lLSvaWTtuJvb2CA6X6vfr2C aYa2ctPJ+X+wQO/kxkB7WtlY0vfJAqN8DKzqGgV6cg/TIapqYRmZr2SRKtntYk/vDv09 bNjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sholland.org header.s=fm2 header.b="E/xlqJyR"; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=ucHH4tyW; 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=pass (p=NONE sp=NONE dis=NONE) header.from=sholland.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o23-20020a509b17000000b00461e322ec5dsi2388131edi.294.2022.11.24.20.04.01; Thu, 24 Nov 2022 20:04:25 -0800 (PST) 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; dkim=pass header.i=@sholland.org header.s=fm2 header.b="E/xlqJyR"; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=ucHH4tyW; 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=pass (p=NONE sp=NONE dis=NONE) header.from=sholland.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229728AbiKYECC (ORCPT + 99 others); Thu, 24 Nov 2022 23:02:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229773AbiKYEBT (ORCPT ); Thu, 24 Nov 2022 23:01:19 -0500 Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27EBC2C139; Thu, 24 Nov 2022 20:01:16 -0800 (PST) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 681D45C009B; Thu, 24 Nov 2022 23:01:15 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Thu, 24 Nov 2022 23:01:15 -0500 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 :message-id:mime-version:reply-to:sender:subject:subject:to:to; s=fm2; t=1669348875; x=1669435275; bh=ABZhlJD5S/ZKX7Bf8fIlM84g5 HAFuIAnCW2oNys0fZk=; b=E/xlqJyRjXELgidPjDVX3pkVBthvO9UTTBJmoGZ6/ v4VGLZmEtYIkEmtrdptKGpRNk7LpSFG7pG7ZgXJtppBnatVrzos/T7Wz3P5yHFMH 39n7CrAYOK87X7377cG0K3iD/Z2/e0Nc1PHOVpPWXhviQWP4GPYH7fSWmT+RwXdV b9RHEhWFrY1drViap8B/WePKFXJVoRYtim3c5IMb9x3GVRDgLWxBMDekIAqDbppd +xH+qi1ZdRGpyfH51leOmTVaYTwX0y9iLSwOiBpX4DWfNAVfwHmD1BAaPJvbZAS6 P6+VFIq9PdAbn0GibCCj9lMLhaRqkW6oGVtLi2t8QIxKQ== 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:message-id :mime-version:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1669348875; x=1669435275; bh=ABZhlJD5S/ZKX7Bf8fIlM84g5HAFuIAnCW2 oNys0fZk=; b=ucHH4tyW5BMnD0GQOXFrwSYuVyZbmNkC+8oU7CA14OSXCDUHb8Y SsKiudJbN7r0ntju67eSWj2vEmYARg8edW7cfGtIpKUd+KXsEEnJvVCfKT5EnN35 Kl/7XKXNKG0Tfo8arm8wljS57yJEkp1T0kFif+QkJ+wz+cFc2z1ONxQmFKPvldxb iJfW2c2NAP+REW/6roJpedafTinWbrOoyPRmhwbpwtoQr/I5e4N6u4zWcfEpVlmR 7cbYLm2KkcEls+ywN5pLGeEFMAD4CH/ZMhLs9HtJgRRPGDE8LyOUdRAgBHRf1dA5 qa4kzBf3HnMFm5IUQcC+aV+OTpk+PGBh9lQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrieeggdeigecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgvlhcu jfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtffrrg htthgvrhhnpeekveelhfejueelleetvdejvdeffeetgeelheeujeffhefgffefkeehhffh keekgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hsrghmuhgvlhesshhhohhllhgrnhgurdhorhhg X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 24 Nov 2022 23:01:13 -0500 (EST) From: Samuel Holland To: Liam Girdwood , Mark Brown , Chen-Yu Tsai , Jernej Skrabec , Krzysztof Kozlowski , Rob Herring Cc: Samuel Holland , Andrew Lunn , Heiko Stuebner , Maxime Ripard , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev Subject: [PATCH v4 0/4] regulator: Add support for Allwinner D1 system LDOs Date: Thu, 24 Nov 2022 22:01:08 -0600 Message-Id: <20221125040112.18160-1-samuel@sholland.org> X-Mailer: git-send-email 2.37.4 MIME-Version: 1.0 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750439364908017815?= X-GMAIL-MSGID: =?utf-8?q?1750439364908017815?= This series adds the binding and driver for one of the two pairs of LDOs inside the Allwinner D1 SoC. I am splitting up the series to unblock merging the SoC devicetree; the analog LDOs are not required to boot. A binding and driver change is required for the SRAM controller, to accept the regulators device as its child node. The example for the regulator device binding is in SRAM controller binding document, per Rob's request to keep MFD examples in one place. Changes in v4: - Fix the order of the maintainer/description sections - Replace unevaluatedProperties with "additionalProperties: false" - Drop the analog LDOs until the codec binding is ready - Drop the analog LDOs until the codec binding is ready - Remove unevaluatedProperties from regulators schema reference - Check the compatible string instead of the node name Changes in v3: - Add "reg" property to bindings - Add "unevaluatedProperties: true" to regulator nodes - Minor changes to regulator node name patterns - Remove system-ldos example (now added in the parent binding) - Adjust control flow in sun20i_regulator_get_regmap() for clarity - Require the regulators node to have a unit address - Reference the regulator schema from the SRAM controller schema - Move the system LDOs example to the SRAM controller schema - Reorder the patches so the example passes validation Changes in v2: - Remove syscon property from bindings - Update binding examples to fix warnings and provide context - Use decimal numbers for .n_voltages instead of field widths - Get the regmap from the parent device instead of a property/phandle Samuel Holland (4): regulator: dt-bindings: Add Allwinner D1 system LDOs regulator: sun20i: Add Allwinner D1 LDOs driver dt-bindings: sram: sunxi-sram: Add regulators child soc: sunxi: sram: Only iterate over SRAM children .../allwinner,sun20i-d1-system-ldos.yaml | 37 +++++ .../allwinner,sun4i-a10-system-control.yaml | 28 ++++ drivers/regulator/Kconfig | 8 + drivers/regulator/Makefile | 1 + drivers/regulator/sun20i-regulator.c | 150 ++++++++++++++++++ drivers/soc/sunxi/sunxi_sram.c | 3 + 6 files changed, 227 insertions(+) create mode 100644 Documentation/devicetree/bindings/regulator/allwinner,sun20i-d1-system-ldos.yaml create mode 100644 drivers/regulator/sun20i-regulator.c