From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linus Walleij Subject: Re: [RFC next v1 2/5] gpio: of: parse stmmac PHY reset line specific active-low property Date: Sun, 9 Jun 2019 23:29:08 +0200 Message-ID: References: <20190609180621.7607-1-martin.blumenstingl@googlemail.com> <20190609180621.7607-3-martin.blumenstingl@googlemail.com> <20190609203828.GA8247@lunn.ch> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: In-Reply-To: Sender: netdev-owner@vger.kernel.org To: Martin Blumenstingl Cc: Andrew Lunn , netdev , "open list:GPIO SUBSYSTEM" , "open list:ARM/Amlogic Meson..." , Bartosz Golaszewski , Giuseppe CAVALLARO , Alexandre TORGUE , Jose Abreu , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Neil Armstrong , Kevin Hilman , "linux-kernel@vger.kernel.org" , "David S. Miller" , Linux ARM List-Id: devicetree@vger.kernel.org On Sun, Jun 9, 2019 at 11:21 PM Martin Blumenstingl wrote: > my understanding that of_gpio_flags_quirks (which I'm touching with > this patch) is supposed to manage similar quirks to what we have in > stmmac (it also contains some regulator and MMC quirks too). > however, that's exactly the reason why I decided to mark this as RFC - > so I'm eager to hear Linus comments on this The idea with the quirks in gpiolib-of.c is to make device drivers simpler, and phase them over to ignoring quirks for mistakes done in the early days of DT standardization. This feature of the gpiolib API is supposed to make it "narrow and deep": make the generic case simple and handle any hardware description languages (DT or ACPI or board files) and quirks (mostly historical) under the hood. Especially drivers should not need to worry about polarity inversion instead just grab a GPIO descriptor and play away with it, asserting it as 1 and deasserting it as 0 whether that is the right polarity or not, the gpiolib should keep track of polarity no matter how that is described, even with historical weird bools like "snps,active-low" etc. So I think you are probably doing the right thing here. This patch is: Reviewed-by: Linus Walleij Yours, Linus Walleij