From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A372DC5AD4C for ; Thu, 23 Nov 2023 10:38:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344720AbjKWKiD (ORCPT ); Thu, 23 Nov 2023 05:38:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229844AbjKWKh7 (ORCPT ); Thu, 23 Nov 2023 05:37:59 -0500 Received: from bmailout1.hostsharing.net (bmailout1.hostsharing.net [IPv6:2a01:37:1000::53df:5f64:0]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B49631BF; Thu, 23 Nov 2023 02:38:04 -0800 (PST) Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (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 bmailout1.hostsharing.net (Postfix) with ESMTPS id C2F8730000D0B; Thu, 23 Nov 2023 11:38:02 +0100 (CET) Received: by h08.hostsharing.net (Postfix, from userid 100393) id B3F4C3E732; Thu, 23 Nov 2023 11:38:02 +0100 (CET) Date: Thu, 23 Nov 2023 11:38:02 +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: <20231123103802.GA30056@wunner.de> References: <20231120151056.148450-1-linux@rasmusvillemoes.dk> <20231120151056.148450-2-linux@rasmusvillemoes.dk> <20231122145344.GA18949@wunner.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 23, 2023 at 11:07:16AM +0100, Rasmus Villemoes wrote: > On 22/11/2023 15.53, Lukas Wunner wrote: > > 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. > > I don't see Crescent introducing any new gpio that needs to be handled. > In fact, I can't even see why from the perspective of the software that > rs422 isn't just rs232; there's no transmit enable pin that needs to be > handled. But maybe the uart driver does something different in rs422 > mode; I assume he must have some update of some driver, since otherwise > the new rs422 bit should be rejected by the core. So I can't really see > the whole picture of that rs422 story. The question is, could we conceivably have the need to support switching between the three modes RS-232, RS-485, RS-422. If yes, then the GPIO mux interface should probably allow for that. As a case in point, the Siemens IOT 2040 has two serial ports which can be set to either of those three modes. The signals are routed to the same D-sub socket, but the pins used are different. See page 46 and 47 of this document: https://cache.industry.siemens.com/dl/files/658/109741658/att_899623/v1/iot2000_operating_instructions_enUS_en-US.pdf The driver for this product is 8250_exar.c. It's an Intel-based product, so no devicetree, but it shows that such use cases exist. Thanks, Lukas