Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp597157pxu; Sun, 22 Nov 2020 21:27:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJyV9alSJ1YVxLXeYcbvDeFm6TyTvrSinGlQhjUqgv/NwEomXTiHSLgGSB9mYZb4BxcCCNgS X-Received: by 2002:a17:906:170e:: with SMTP id c14mr5918117eje.117.1606109222657; Sun, 22 Nov 2020 21:27:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606109222; cv=none; d=google.com; s=arc-20160816; b=xeeQRPjP0dn7CIqX3rDeWdBJkjhtCtVijOD6+jG1ZQn/OoN8RuI0FBapJKxvCY6z6d aQSmLN+DrxIvgxWPx8XVT1q55u1atCoVMcH8L45fuarSHUkx5OVO1iKrIuPZ0+utgMqF V2H51Lv2z8Zlr3hIw8nhOsHFjI30ZC20NWVaHtd3InoJsugYzbXWISIFxoDNrre2SDGB y+/KzF4cNZlfojZw6/W/8fico+pDtF7IRftaau8c8VLUQ1zbeKOc+KlJ1puiCb7f26lp oAfFtQpuG65uf9wNtiZIAJdjCuRZ6/7tmhFLQqERtY5GkWLXwovxtx4hMUwTPWr0yMg2 c2mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=41P9nu435fMmUKCXQ+eupnyQPmIuwwlpwwo3wAWO9KQ=; b=ezQ/BNEMuteW81tr06oJZtMaXHg2kiYof9qakWgctny7WxLXzvDQP4B06mzmssWmW9 rafItJNE1ZscCyw5H2sULCzL3UBa9o2GgwPvZMKpGDdNo+RUmcRQoXQfeLxwePTAPcEx AwEKfdSOF0lqc0V1IRfhm/AbowmR2bykNGb7c50LJaOgA7qpMoxH/9wumMlmV0TDT4Pn SE8ym9pd6jrU83dlnkUNrBHYUOBcxKM/6BTZDF91pAyYB1f4ECvUS5KZ84Kbr/9AOD3+ /YKvfYDl7nfPrWuEH3ZNb0vIuIUnauFcmV3xTfQTEefJAw6mZETBr1ray73i38BIkmUe d4wA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mf24si4141236ejb.450.2020.11.22.21.26.39; Sun, 22 Nov 2020 21:27:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727414AbgKWEjX (ORCPT + 99 others); Sun, 22 Nov 2020 23:39:23 -0500 Received: from mail-lf1-f65.google.com ([209.85.167.65]:40672 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726885AbgKWEjX (ORCPT ); Sun, 22 Nov 2020 23:39:23 -0500 Received: by mail-lf1-f65.google.com with SMTP id u19so21950481lfr.7; Sun, 22 Nov 2020 20:39:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=41P9nu435fMmUKCXQ+eupnyQPmIuwwlpwwo3wAWO9KQ=; b=Z12NpJ0sHpw9u6ZFAEZEflOMGb7BOlvSmyTZsls2FFR5rJje6hcQeEccCD1WcyYWtj 2NqobeSlXg4Vm99Ck4nE2XSLtWTUDaeJUjq3zYRXDKx3qBjGrxRbFFZivScJIAvBzmBN sQrI+h/5g1ONz07ZLFz7zjlt4JI+Hhd7UT10Rdo2mwt5tY4I389vqcqvRfSVvTyRubOe WMpO2fgtg5/Fkgbiqmu0gaxqblTBG/P1dmeu2t+X5EIVpPz8lXiH2MJE636XjR8zGTYa 68rnKbJ6lIMRIol34wvo3EektLZBkdRhZW/a7xhyfnSI0TAj2ZKocUDxZDyvowT+ZOUS RR8g== X-Gm-Message-State: AOAM530aCxpZhn1iGSj/ZLyp4W452lVBoKKpJUPZAZ6itaeqXz5+fmkl 8SopJ4kck5EuecbW3fC8U7wEG4ap23dnsw== X-Received: by 2002:a19:c8ca:: with SMTP id y193mr11419087lff.150.1606106359429; Sun, 22 Nov 2020 20:39:19 -0800 (PST) Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com. [209.85.208.174]) by smtp.gmail.com with ESMTPSA id q21sm1164857ljm.52.2020.11.22.20.39.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 22 Nov 2020 20:39:19 -0800 (PST) Received: by mail-lj1-f174.google.com with SMTP id t22so4180770ljk.0; Sun, 22 Nov 2020 20:39:18 -0800 (PST) X-Received: by 2002:a2e:3c1a:: with SMTP id j26mr12828664lja.294.1606106358783; Sun, 22 Nov 2020 20:39:18 -0800 (PST) MIME-Version: 1.0 References: <20201115222425.2885427-1-michael@fossekall.de> <20201120155252.kfkavrn4wpqzmbyc@gilmour> <20201120182739.GA3734181@a98shuttle.de> In-Reply-To: <20201120182739.GA3734181@a98shuttle.de> From: Chen-Yu Tsai Date: Mon, 23 Nov 2020 12:39:07 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] ARM: dts: sun8i-h2-plus-bananapi-m2-zero: add gpio-line-names To: Michael Klein Cc: Maxime Ripard , devicetree , Rob Herring , linux-kernel , linux-arm-kernel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Nov 21, 2020 at 2:28 AM Michael Klein wrote: > > Thank you for having a look at the patch! > > On Fri, Nov 20, 2020 at 04:52:52PM +0100, Maxime Ripard wrote: > >On Sun, Nov 15, 2020 at 11:24:25PM +0100, Michael Klein wrote: > >> Add gpio-line-names as documented in the Banana Pi wiki [1] and in the > >> schematics [2]. > >> > >> [1]: http://wiki.banana-pi.org/Banana_Pi_BPI-M2_ZERO#GPIO_PIN_define > >> [2]: https://drive.google.com/file/d/0B4PAo2nW2KfnMW5sVkxWSW9qa28/view > >> > >> Signed-off-by: Michael Klein > >> --- > >> .../dts/sun8i-h2-plus-bananapi-m2-zero.dts | 64 +++++++++++++++++++ > >> 1 file changed, 64 insertions(+) > >> > >> diff --git a/arch/arm/boot/dts/sun8i-h2-plus-bananapi-m2-zero.dts b/arch/arm/boot/dts/sun8i-h2-plus-bananapi-m2-zero.dts > >> index 4c6704e4c57e..b4ddfaf01b45 100644 > >> --- a/arch/arm/boot/dts/sun8i-h2-plus-bananapi-m2-zero.dts > >> +++ b/arch/arm/boot/dts/sun8i-h2-plus-bananapi-m2-zero.dts > >> @@ -136,6 +136,70 @@ bluetooth { > >> > >> }; > >> > >> +&pio { > >> + gpio-line-names = > >> + /* PA */ > >> + "UART2-TX", "UART2-RX", "UART2-RTS", "UART2-CTS", > >> + "UART0-TXD", "UART0-RXD", "PWM1", "PA7-EINT7", > >> + "PA8-EINT8", "PA9-EINT9", "PA10-EINT10", "TWI0-SCK", > >> + "TWI0-SDA", "UART3-TX", "UART3-RX", "UART3-RTS", > >> + "UART3-CTS", "PA17-EINT17", "TWI1-SCK", "TWI1-SDA", > >> + "PA20-EINT20", "PA21-EINT21", "", "", > >> + "", "", "", "", "", "", "", "", > > > >IIRC, the point is to have the pin names that the vendor publishes. > > > >Looking at Documentation/devicetree/bindings/gpio/gpio.txt, it says: > > > >""" > >Optionally, a GPIO controller may have a "gpio-line-names" property. This is > >an array of strings defining the names of the GPIO lines going out of the > >GPIO controller. This name should be the most meaningful producer name > >for the system, such as a rail name indicating the usage. Package names > >such as pin name are discouraged: such lines have opaque names (since they > >are by definition generic purpose) and such names are usually not very > >helpful. > >""" > > > >In this case, from the link you gave above, I think having the CON*-P* > >names make more sense. > > Hm, but these are the pin names (of the connector) and should thus not > be used, right? > > For e.g. the PA0 pin, the wiki link gives three candidates: > > - CON2-P13 (GPIO Pin Name -> pin 13 of the 40 pin GPIO header) > - UART2-TX (Default Function) > - PA0-EINT0 (Function2 : GPIO) > > IMHO, the CON*-P* name is the least helpful of the above, as it tells > nothing about the usage. I'm not sure about the other two names, though. I believe the function names are pretty useless in this case, as you cannot use the GPIO subsystem to mux functions. That is what pinctrl does. And in our case, the pinctrl drivers already know all the available functions each pin has. Using the pin count and connector name provides the user direct mapping of the software representation of the pin against the actual pin on the hardware. The user can then proceed to request and use that pin. Again, you can not request "functions" from userspace, only GPIO usage. Also using "one" function name creates confusion if the same function is available on multiple pins. ChenYu > Michael > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel