From patchwork Mon Apr 25 18:46:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 565915 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 62413C4332F for ; Mon, 25 Apr 2022 18:46:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244556AbiDYStl (ORCPT ); Mon, 25 Apr 2022 14:49:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237946AbiDYStl (ORCPT ); Mon, 25 Apr 2022 14:49:41 -0400 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39FAC6EB01 for ; Mon, 25 Apr 2022 11:46:35 -0700 (PDT) Received: by mail-ej1-x62b.google.com with SMTP id w16so10128447ejb.13 for ; Mon, 25 Apr 2022 11:46:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=zNf6LLD8HrhjGUR4iM02IxWSyL3elzsMKZrfz7gR6SU=; b=dgSGukzZsx9sWgYuXCFyBlckve/tmCUxWQp3gHngo3DlrgGFcC1Y9g9gkwe+8zlJcT ZKBCbKkwRxc/odoMgXwdAcrpVixQcUAt/00qUqfxCYeo2PGlk4oOgpfXfcpQ4gy8eNka zEaYOxLuenTdNcLwjjxiklHPwcFk9N5PAUayZL7blEr2eEexmZyGPEuMxv6r7LjoxXPi 9sDmG9GbuDXX8sV7mAJ5eD4I413aL9kNVi0h0D9j2VNdbzeD98bgj+hPprlUT40LDsLb XBNz7nDbKgFKL51dHTDnu3yKXkC7d2rY9pIdOvP/YgG9aDs2pDd3GbhTSQCxv0TlJ/ft nqnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=zNf6LLD8HrhjGUR4iM02IxWSyL3elzsMKZrfz7gR6SU=; b=QgdmVaVSzfSwfTjdclUQd55h5HYbo8uJ86noP0N5J/BcFo901uN1HD92sQWYqvrPTY /858dKHq/Ix1b2A3YGU4zL5HtHRlUvWz+DkPvjeCqso12JJLBwX+ipDz0YAKWWzk0IC2 zo69tUPvRn1leF16tq7NZvODwAz8igTd8uhzuFXYOHttYauiiGj14xRbxQCw1eeUEHlB AWUSga+l1G8PGgNCtajTEtwZGbsna2ZRLwM/EZEqRshquQlp2CXpkQi7meeGPNFuwR1C EkmsRutniz8jxj5Bx2OY/dtkQ2nBq7UrPz+6sko50nAb9k9bKk/CaK2PF2jMpKPRj4Qw nxZA== X-Gm-Message-State: AOAM530YNJX7OaFav/cLiPBDQUMfosSBmIe5TqegcCXnt7gPmw/tOuiK jGOQvoAv9KYD/K3qsTTXgW0erw== X-Google-Smtp-Source: ABdhPJzD2rFARJCrwO/EzVDwgRmycF8YVobvFL+OL+UL+4dKpJ0NRJbXyqDD2BJbFIFg+GuzisxD+A== X-Received: by 2002:a17:906:38d9:b0:6e8:3f85:4da3 with SMTP id r25-20020a17090638d900b006e83f854da3mr18459489ejd.196.1650912393799; Mon, 25 Apr 2022 11:46:33 -0700 (PDT) Received: from localhost.localdomain (xdsl-188-155-176-92.adslplus.ch. [188.155.176.92]) by smtp.gmail.com with ESMTPSA id v7-20020a50d087000000b00424269f1c75sm5181080edd.96.2022.04.25.11.46.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Apr 2022 11:46:33 -0700 (PDT) From: Krzysztof Kozlowski To: Linus Walleij , Bartosz Golaszewski , Rob Herring , Krzysztof Kozlowski , linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski , Rob Herring Subject: [RESENT PATCH v3] dt-bindings: gpio: add common consumer GPIO lines Date: Mon, 25 Apr 2022 20:46:31 +0200 Message-Id: <20220425184631.684906-1-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Typical GPIO lines like enable, powerdown, reset or wakeup are not documented as common, which leads to new variations of these (e.g. pwdn-gpios). Add a common schema which serves also as a documentation for preferred naming. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring --- Reason for resend: ================== Previously patch was on hold because richtek,rt4801 bindings were using two GPIOs in "enable-gpios", so this schema would complain. This was resolved here: https://lore.kernel.org/all/165089886500.211842.728549769223794277.b4-ty@kernel.org/ Changes since v2: ================== 1. Correct my email address. 2. Add Rob's review. Changes since v1: ================== 1. Select-true, add maxItems and description for each entry (Rob). 2. Mention ACTIVE_LOW in bindings description (Linus). 3. Add allOf for pwrseq reset-gpios case. --- .../bindings/gpio/gpio-consumer-common.yaml | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 Documentation/devicetree/bindings/gpio/gpio-consumer-common.yaml diff --git a/Documentation/devicetree/bindings/gpio/gpio-consumer-common.yaml b/Documentation/devicetree/bindings/gpio/gpio-consumer-common.yaml new file mode 100644 index 000000000000..40d0be31e200 --- /dev/null +++ b/Documentation/devicetree/bindings/gpio/gpio-consumer-common.yaml @@ -0,0 +1,64 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/gpio/gpio-consumer-common.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Common GPIO lines + +maintainers: + - Bartosz Golaszewski + - Linus Walleij + +description: + Pay attention to using proper GPIO flag (e.g. GPIO_ACTIVE_LOW) for the GPIOs + using inverted signal (e.g. RESETN). + +select: true + +properties: + enable-gpios: + maxItems: 1 + description: + GPIO connected to the enable control pin. + + reset-gpios: + description: + GPIO (or GPIOs for power sequence) connected to the device reset pin + (e.g. RESET or RESETN). + + powerdown-gpios: + maxItems: 1 + description: + GPIO connected to the power down pin (hardware power down or power cut, + e.g. PD or PWDN). + + pwdn-gpios: + maxItems: 1 + description: Use powerdown-gpios + deprecated: true + + wakeup-gpios: + maxItems: 1 + description: + GPIO connected to the pin waking up the device from suspend or other + power-saving modes. + +allOf: + - if: + properties: + compatible: + contains: + enum: + - mmc-pwrseq-simple + then: + properties: + reset-gpios: + minItems: 1 + maxItems: 32 + else: + properties: + reset-gpios: + maxItems: 1 + +additionalProperties: true