Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp1147138rdf; Wed, 22 Nov 2023 06:54:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IGn0KMt0aHbnJBWcFpJxca94K+FAR4FtJuV360J3v37zmyJQndeo9JVQWdzflAQpa5MCvzN X-Received: by 2002:a17:90b:4ace:b0:27c:f80a:2c8a with SMTP id mh14-20020a17090b4ace00b0027cf80a2c8amr2643185pjb.0.1700664839864; Wed, 22 Nov 2023 06:53:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700664839; cv=none; d=google.com; s=arc-20160816; b=inJYhWMtLix4n1pxlw5Eo5oDRW6zZ1yIi5cWZdnDjkfN/1dUzrKkWLvtRh4LYtCQ6q hmIZJF5BDWHDZJKK9qwzystycGLiTdtHHcYbnV1pe1yY9lg4mdgkVBYLK1zy8cJuwUyz ysRjNerlvw+8ltFmjrc6xHNbFKrrXPLCTGs/t++qESMdnFGVckyH6fFIeV0WcCKsIGv7 dytlIAGc5Z/ENdm6J6F8Av2/U/1pPbIBU77EkSXMmwT50ZDzCO7S+lFtm+m/x6LUifzW PdPv3oy5M+feFohXR1bNKgw9PZzKnyiAPJkMlMId9xuJXGrFxeIh33g+8Ku5o3UwfLaO PDBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=TOEtpD9ZiK2VNsUjxIGAwtad0zM5uhzQO/Kq3zNl5QA=; fh=9dKK5jOGqt6xvLUIfUcZsOjzOtngApshJEr9DrqgiQU=; b=QwbmJ130ruPu8Tm74RuBPFB4AqajMqubnjwKNYNXKI++74SnNmdWHAz7V+lOGcMWzR K0y+YbQecTdBQu+hFQGwkKMcjozxUtqcHKR6mf4/qRGS18EiI+U3eOD3rv2wkMUtAqad BLhz/qHp1pz9neP6B17xirVozYrsAkyX6HvmhJyTLmzk0Vn/OpAy0XP81G/jCPO6fwIa szqGvB+zdM33CntOscQm+/g8jy/BLl42OCASrnjGlHXN7JCYBlxP4WMAue//PEETxmct rGOUJk3kuW9t3ydGidl/YQfd6ZXdrJhJjPpCG9XYQDHs2MQ2FtM4iq1/WCfN5mrnRIvt 70oA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id bf5-20020a17090b0b0500b0027d74e8a50bsi1542130pjb.69.2023.11.22.06.53.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 06:53:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 559C9804754C; Wed, 22 Nov 2023 06:53:55 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232747AbjKVOxx (ORCPT + 99 others); Wed, 22 Nov 2023 09:53:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231683AbjKVOxv (ORCPT ); Wed, 22 Nov 2023 09:53:51 -0500 Received: from bmailout3.hostsharing.net (bmailout3.hostsharing.net [IPv6:2a01:4f8:150:2161:1:b009:f23e:0]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A5E3112; Wed, 22 Nov 2023 06:53:46 -0800 (PST) Received: from h08.hostsharing.net (h08.hostsharing.net [IPv6:2a01:37:1000::53df:5f1c:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "*.hostsharing.net", Issuer "RapidSSL Global TLS RSA4096 SHA256 2022 CA1" (verified OK)) by bmailout3.hostsharing.net (Postfix) with ESMTPS id 7C520100DA1D6; Wed, 22 Nov 2023 15:53:44 +0100 (CET) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 373E137FB2; Wed, 22 Nov 2023 15:53:44 +0100 (CET) Date: Wed, 22 Nov 2023 15:53:44 +0100 From: Lukas Wunner To: Rasmus Villemoes Cc: Greg Kroah-Hartman , Jiri Slaby , Rob Herring , Krzysztof Kozlowski , Conor Dooley , devicetree@vger.kernel.org, Andy Shevchenko , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Crescent CY Hsieh , Lino Sanfilippo , Ilpo =?iso-8859-1?Q?J=E4rvinen?= Subject: Re: [PATCH 1/2] dt-bindings: serial: rs485: add rs485-mux-gpios binding Message-ID: <20231122145344.GA18949@wunner.de> References: <20231120151056.148450-1-linux@rasmusvillemoes.dk> <20231120151056.148450-2-linux@rasmusvillemoes.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231120151056.148450-2-linux@rasmusvillemoes.dk> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 22 Nov 2023 06:53:55 -0800 (PST) On Mon, Nov 20, 2023 at 04:10:54PM +0100, Rasmus Villemoes wrote: > Some boards are capable of both rs232 and rs485, and control which > external terminals are active via a gpio-controlled mux. Allow > describing that gpio in DT so that the kernel can transparently handle > the proper setting when the uart is switched between rs232 and rs485 > modes. Crescent CY Hsieh (+cc) is in parallel trying to add an RS-422 mode bit to struct serial_rs485: https://lore.kernel.org/all/20231121095122.15948-1-crescentcy.hsieh@moxa.com/ I don't know whether that makes sense at all (I had thought RS-422 is the same as RS-485 with full-duplex, i.e. SER_RS485_ENABLED plus SER_RS485_RX_DURING_TX). But if that patch gets accepted, we'd have *three* different modes: RS-232, RS-485, RS-422. A single GPIO seems insufficient to handle that. You'd need at least two GPIOs. > --- a/Documentation/devicetree/bindings/serial/rs485.yaml > +++ b/Documentation/devicetree/bindings/serial/rs485.yaml > @@ -61,6 +61,11 @@ properties: > the active state enables RX during TX. > maxItems: 1 > > + rs485-mux-gpios: > + description: GPIO pin to control muxing of the SOC signals to the RS485 > + transceiver. > + maxItems: 1 The description doesn't really add much to the name "rs485-mux-gpios". Suggestion: description: selects whether the UART is connect to an RS-232 driver (low) or an RS-485 transceiver (high) Thanks, Lukas