Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2159444ybl; Thu, 5 Dec 2019 13:07:43 -0800 (PST) X-Google-Smtp-Source: APXvYqyLJAr/jDLkOUbwixifTDMS/yl5NtrLyaYFb+oPNhzCzzFTlcJTVdeL+p+0eklPzmm1mz3x X-Received: by 2002:a9d:7085:: with SMTP id l5mr8727782otj.25.1575580063232; Thu, 05 Dec 2019 13:07:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575580063; cv=none; d=google.com; s=arc-20160816; b=eNhVShTVskRn5l+TOZizXgtxNRnlPU/yDhMc/CYF2Ybu4e7Kdi4ziBtjWgQNJ5fmtl pkENbrKMz08AJ9DlF5xLyBDVVj67X7YjsCX13T4ySYwBxyKebr5V1Q8+9/mwekDz8nUf a7f+J5vuVlZC4BXIZurdN21YSTtQqtdDmIxf53kGZDvZjFQ/k4y2aMfofZDDRwWnKQE3 tpFGp36TwGPmfD43PkS599jjJYPQrYT1yig4BJvnKwaj5RnXXNr0fcb0NOXr1jwRXq8q k0alAPIxt3HnHyWuIcVoDP4DEH8TCxqPiS0SEhmbjnW1Kl8on5+BFSfbuBLqgHSYoVQ2 AzxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=kfZJgMdMZnEWqYp4l6MRhDa+lgrmX+5UPFpYfdvrZFQ=; b=zSaVCKRIonAU++EE1QJiEHgOgiDSUwRTMc6ecW3pNTO4SS43fh9HvKUe16FqX+q95u PVVQBl3MlYspw2tU3WkR+x3ORCkamfMcq6zy+6TqhRFMiHzNMxX0mZJvpp4sWsvZ4mwk qqEEQGQHIsyTk9xujmeHnQgaU9ByTtHj5wOrzKjRWOTVYEY8qbF34hkB3aZ5/y0tD4ji kDiu37V7WzbBM+5rA8oRGz+DdO8TFjFToYI/NUMdxWySTOGnRI+Rl8Pqfavxwja09ei+ dKBsKn53+DnFhRcnfAZAkT1tMcz7Di5ZanMAVAMWOGqltY2ze1ZKUDNRsVardVP116Wy fMEA== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e74si5611682ote.14.2019.12.05.13.07.28; Thu, 05 Dec 2019 13:07:43 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730026AbfLEVG4 (ORCPT + 99 others); Thu, 5 Dec 2019 16:06:56 -0500 Received: from mail-ot1-f65.google.com ([209.85.210.65]:42505 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729145AbfLEVG4 (ORCPT ); Thu, 5 Dec 2019 16:06:56 -0500 Received: by mail-ot1-f65.google.com with SMTP id 66so3890328otd.9; Thu, 05 Dec 2019 13:06:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=kfZJgMdMZnEWqYp4l6MRhDa+lgrmX+5UPFpYfdvrZFQ=; b=SoZxAsjeHAmoEf4nNdWHdNcH1eSxQGcAMlZkojEugsfwFP+PMHN/5fG+rRd+a6QsrN UZ2nSGHtgB7j38V6j9TPs0jIXrA+Q5OOtGsGzONxVQ+ynCqo2IadyilFgPosg3/gOxdf 3VEQNi8ZiUF0J5ebBwjKwSVnI1m2V/fb8mcJFHJJz5VZSTeZbTV0nOK1nLiSW1ghecYD /flwLufgKqBJxGPODZgph7WUClg+7YA1/B3cJsgJ2UGN4Qxyfg9Ma3+VFf8vsxZlveMq 0WbZLwUoPFak+8xVRRFjNI2Gvm8RxNzKG0Q3uoWlDgAn4m8Ds/4u1RwXhKM2C0/9CGja C50A== X-Gm-Message-State: APjAAAVKlfEd2gTkmkWLBWw8xtEUxm7kwBuU/TsAzv72M3BjbzhHMyv2 7TT0vK57ZYd3gRo5ej7OQA== X-Received: by 2002:a9d:75c7:: with SMTP id c7mr2839523otl.181.1575580014993; Thu, 05 Dec 2019 13:06:54 -0800 (PST) Received: from localhost (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.gmail.com with ESMTPSA id r25sm3819723otk.22.2019.12.05.13.06.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Dec 2019 13:06:54 -0800 (PST) Date: Thu, 5 Dec 2019 15:06:53 -0600 From: Rob Herring To: Geert Uytterhoeven Cc: Linus Walleij , Bartosz Golaszewski , Jonathan Corbet , Mark Rutland , Harish Jenny K N , Eugeniu Rosca , 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 Subject: Re: [PATCH v3 4/7] dt-bindings: gpio: Add gpio-repeater bindings Message-ID: <20191205210653.GA29969@bogus> References: <20191127084253.16356-1-geert+renesas@glider.be> <20191127084253.16356-5-geert+renesas@glider.be> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191127084253.16356-5-geert+renesas@glider.be> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 27, 2019 at 09:42:50AM +0100, 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. It can't? Why not? The point of the passthru mask is to not do translation of flags, but without it you are always doing translation of cells. > > 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]). Adding an inverted flag as I've suggested would also solve this issue. > > [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