From patchwork Tue Aug 20 15:25:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 1150265 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 46CZP61fy9z9sDQ for ; Wed, 21 Aug 2019 01:25:30 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728277AbfHTPZ3 (ORCPT ); Tue, 20 Aug 2019 11:25:29 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:52425 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727304AbfHTPZ3 (ORCPT ); Tue, 20 Aug 2019 11:25:29 -0400 Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1i060j-00088F-U1; Tue, 20 Aug 2019 17:25:25 +0200 Received: from ukl by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1i060b-0000UV-79; Tue, 20 Aug 2019 17:25:17 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Liam Girdwood , Mark Brown , Rob Herring , Mark Rutland Cc: kernel@pengutronix.de, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH RFC] dt-bindings: regulator: define a mux regulator Date: Tue, 20 Aug 2019 17:25:11 +0200 Message-Id: <20190820152511.15307-1-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: devicetree@vger.kernel.org Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org A mux regulator is used to provide current on one of several outputs. It might look as follows: ,------------. --; we still needed something to implement compatibility to the currently defined bindings. Signed-off-by: Uwe Kleine-König --- Hello, the obvious alternative is to add (here) eight subnodes to represent the eight outputs. This is IMHO less pretty, but wouldn't need to introduce #regulator-cells. Apart from reg = <..> and a phandle there is (I think) nothing that needs to be specified in the subnodes because all properties of an output (apart from the address) apply to all outputs. What do you think? Best regards Uwe .../bindings/regulator/mux-regulator.yaml | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 Documentation/devicetree/bindings/regulator/mux-regulator.yaml diff --git a/Documentation/devicetree/bindings/regulator/mux-regulator.yaml b/Documentation/devicetree/bindings/regulator/mux-regulator.yaml new file mode 100644 index 000000000000..f06dbb969090 --- /dev/null +++ b/Documentation/devicetree/bindings/regulator/mux-regulator.yaml @@ -0,0 +1,52 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/regulator/mux-regulator.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: MUX regulators + +properties: + compatible: + const: XXX,adb708 + + enable-gpios: + maxItems: 1 + + address-gpios: + description: Array of typically three GPIO pins used to select the + regulator's output. The least significant address GPIO must be listed + first. The others follow in order of significance. + minItems: 1 + + "#regulator-cells": + const: 1 + + regulator-name: + description: A string used to construct the sub regulator's names + $ref: "/schemas/types.yaml#/definitions/string" + + supply: + description: input supply + +required: + - compatible + - regulator-name + - supply + + +examples: + - | + mux-regulator { + compatible = "regulator-mux"; + + regulator-name = "blafasel"; + + supply = <&muxin_regulator>; + + enable-gpios = <&gpio2 5 GPIO_ACTIVE_HIGH>; + address-gpios = <&gpio2 2 GPIO_ACTIVE_HIGH>, + <&gpio2 3 GPIO_ACTIVE_HIGH>, + <&gpio2 4 GPIO_ACTIVE_HIGH>, + }; +...