Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp6316331ybc; Wed, 27 Nov 2019 19:50:14 -0800 (PST) X-Google-Smtp-Source: APXvYqwF5Bg58LC6UTOt8eA9jbteWfpV7Pvog9lkNrsstqHV69VAHDQD29NduuY0GoGIZdFej+Q6 X-Received: by 2002:aa7:d306:: with SMTP id p6mr219886edq.72.1574913014454; Wed, 27 Nov 2019 19:50:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574913014; cv=none; d=google.com; s=arc-20160816; b=av+38ukQicjvXjVscYSUcwyQgGDXnYOZ4tfxefp2XHtteQh89WToV0eUif4m9jLS7o 1zNsUJqxohFojoUtS/9ogC0dcbgSP8CLayU3syipKhQ76lql8Htfop46zjYy32NdlyLF ywcmolMP26r13yUKRDu5ueqBxebRntGG87JjXeYS+XBRq8pcf1NMMID3B8kAD/NIuM7z nkJlFHNqZr1TC7bDb3foom/Xsw1UeAGxck8k5yoUVpwh/mVdmuajd8ML3Ww7mFvQQecX 1RV/n/galr8KjfJ8KjNJkZLDQ+xoG0MBebQhI8bFSLOOX7Xw9rLJynjt54cUQd88U6r8 yS9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:importance:content-transfer-encoding :mime-version:subject:references:in-reply-to:message-id:cc:to:from :date:dkim-signature; bh=ovvWqqCqtCKN+01XuykkLwFdsy5R9BqiNVQImuwx8zI=; b=O6JEvenK9l6I1k5cWvwc9Xn7jkDmxttKQ2QEgpV51pT6fEeRhE17VquIzjQuxLLbE2 wcSGTsr2cPTyisyrc87E65Ndq0MQ8c75srU9z5y54ebhe9+54Omx1buGyYLuXGpAwTNT ICdAWgwZbvQTSRe3wXc1FKwnBvX6ZI/ju7imdS3tXsv11snjiTwgs4f5HctfZOKLIeGL UUj9AsaDivJD7JqCB2qid7HASmP5QxoKRYv/OUUjurjof53xpfa7O27T0JXvjKxnRdOi Rkn2ZjzVQmuopWSuT6ZqN2LztqBxSxHugyQPn1Wpfug7eBZaw2czq4pdOfixzyImxdg4 urjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@fpond.eu header.s=strato-dkim-0002 header.b="ffk/i1nH"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e12si1781344eja.194.2019.11.27.19.49.49; Wed, 27 Nov 2019 19:50:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@fpond.eu header.s=strato-dkim-0002 header.b="ffk/i1nH"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727614AbfK1Dpp (ORCPT + 99 others); Wed, 27 Nov 2019 22:45:45 -0500 Received: from mo4-p03-ob.smtp.rzone.de ([85.215.255.102]:34474 "EHLO mo4-p03-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727117AbfK1Dpo (ORCPT ); Wed, 27 Nov 2019 22:45:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1574912740; s=strato-dkim-0002; d=fpond.eu; h=Subject:References:In-Reply-To:Message-ID:Cc:To:From:Date: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=ovvWqqCqtCKN+01XuykkLwFdsy5R9BqiNVQImuwx8zI=; b=ffk/i1nHKYX8ytIw6OjhQTaqzVXLFHAHrerwH8kuoBmQmJN9x/+QVQtrNKP5vooEpX 8NDUblQH/wvmKMV25Q88fCgTIhFOVABAIkTuJREo8ezRLctzJrgEFA4s/KjCpkbE4a5H v4iEErdMdtweOtIL3S/GROJ67c3Q7nLJ6WEi3W44TICT1ri9yJG8bGIUNafmMRNzX/lp q9VS5C4VWg2iDxwIechkbGwDXzwUSq56Wm4y8KXsLqOIFxUJS2dXqhdYGL5TwfeXMVKY 4IwJE/1+LPwzIzkrUFdLWOBte7tNPZlBrIdPZSG5y29z5Fq4RevMNievwRk7Q9+DfjOA ACiA== X-RZG-AUTH: ":OWANVUa4dPFUgKR/3dpvnYP0Np73amq+g13rqGzmt2bYDnKIKaws6YXTsc4=" X-RZG-CLASS-ID: mo00 Received: from oxapp04-01.back.ox.d0m.de by smtp-ox.front (RZmta 46.0.0 AUTH) with ESMTPSA id 604beevAS3db2Iu (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve X9_62_prime256v1 with 256 ECDH bits, eq. 3072 bits RSA)) (Client did not present a certificate); Thu, 28 Nov 2019 04:39:37 +0100 (CET) Date: Thu, 28 Nov 2019 04:39:37 +0100 (CET) From: Ulrich Hecht To: Geert Uytterhoeven , Linus Walleij , Bartosz Golaszewski , Jonathan Corbet , Rob Herring , Mark Rutland , Harish Jenny K N , Eugeniu Rosca Cc: Alexander Graf , Peter Maydell , Paolo Bonzini , Phil Reid , Marc Zyngier , Christoffer Dall , Magnus Damm , linux-gpio@vger.kernel.org, linux-doc@vger.kernel.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, qemu-devel@nongnu.org Message-ID: <1708272897.1467701.1574912377195@webmail.strato.com> In-Reply-To: <20191127084253.16356-5-geert+renesas@glider.be> References: <20191127084253.16356-1-geert+renesas@glider.be> <20191127084253.16356-5-geert+renesas@glider.be> Subject: Re: [PATCH v3 4/7] dt-bindings: gpio: Add gpio-repeater bindings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Normal X-Mailer: Open-Xchange Mailer v7.10.1-Rev22 X-Originating-IP: 112.198.74.215 X-Originating-Client: open-xchange-appsuite Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On November 27, 2019 at 9:42 AM Geert Uytterhoeven wrote: > > > Add Device Tree bindings for a GPIO repeater, with optional translation > of physical signal properties. This is useful for describing explicitly > the presence of e.g. an inverter on a GPIO line, and was inspired by the > non-YAML gpio-inverter bindings by Harish Jenny K N > [1]. > > Note that this is different from a GPIO Nexus Node[2], which cannot do > physical signal property translation. > > While an inverter can be described implicitly by exchanging the > GPIO_ACTIVE_HIGH and GPIO_ACTIVE_LOW flags, this has its limitations. > Each GPIO line has only a single GPIO_ACTIVE_* flag, but applies to both > th provider and consumer sides: > 1. The GPIO provider (controller) looks at the flags to know the > polarity, so it can translate between logical (active/not active) > and physical (high/low) signal levels. > 2. While the signal polarity is usually fixed on the GPIO consumer > side (e.g. an LED is tied to either the supply voltage or GND), > it may be configurable on some devices, and both sides need to > agree. Hence the GPIO_ACTIVE_* flag as seen by the consumer must > match the actual polarity. > There exists a similar issue with interrupt flags, where both the > interrupt controller and the device generating the interrupt need > to agree, which breaks in the presence of a physical inverter not > described in DT (see e.g. [3]). > > [1] "[PATCH V4 2/2] gpio: inverter: document the inverter bindings" > https://lore.kernel.org/linux-gpio/1561699236-18620-3-git-send-email-harish_kandiga@mentor.com/ > > [2] Devicetree Specification v0.3-rc2, Section 2.5 > https://github.com/devicetree-org/devicetree-specification/releases/tag/v0.3-rc2 > > [3] "[PATCH] wlcore/wl18xx: Add invert-irq OF property for physically > inverted IRQ" > https://lore.kernel.org/linux-renesas-soc/20190607172958.20745-1-erosca@de.adit-jv.com/ > > Signed-off-by: Geert Uytterhoeven > --- > v3: > - New. > --- > .../bindings/gpio/gpio-repeater.yaml | 53 +++++++++++++++++++ > 1 file changed, 53 insertions(+) > create mode 100644 Documentation/devicetree/bindings/gpio/gpio-repeater.yaml > > diff --git a/Documentation/devicetree/bindings/gpio/gpio-repeater.yaml b/Documentation/devicetree/bindings/gpio/gpio-repeater.yaml > new file mode 100644 > index 0000000000000000..efdee0c3be43f731 > --- /dev/null > +++ b/Documentation/devicetree/bindings/gpio/gpio-repeater.yaml > @@ -0,0 +1,53 @@ > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/gpio/gpio-repeater.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: GPIO Repeater > + > +maintainers: > + - Harish Jenny K N > + - Geert Uytterhoeven > + > +description: > + This represents a repeater for one or more GPIOs, possibly including physical > + signal property translation (e.g. polarity inversion). > + > +properties: > + compatible: > + const: gpio-repeater > + > + "#gpio-cells": > + const: 2 > + > + gpio-controller: true > + > + gpios: > + description: > + Phandle and specifier, one for each repeated GPIO. > + > + gpio-line-names: > + description: > + Strings defining the names of the GPIO lines going out of the GPIO > + controller. > + > +required: > + - compatible > + - "#gpio-cells" > + - gpio-controller > + - gpios > + > +additionalProperties: false > + > +examples: > + # Device node describing a polarity inverter for a single GPIO > + - | > + #include > + > + inverter: gpio-repeater { > + compatible = "gpio-repeater"; > + #gpio-cells = <2>; > + gpio-controller; > + gpios = <&gpio 95 GPIO_ACTIVE_LOW>; > + }; > -- > 2.17.1 > Reviewed-by: Ulrich Hecht CU Uli