Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp238129rdh; Thu, 23 Nov 2023 02:38:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IFXaP2X7YOVhaDbG3LxGUXtXi8u1zI8ZrtrjL5WES+h56MP5Kk0CwnexEP1RNL56rsznZLb X-Received: by 2002:a05:6a20:4416:b0:18a:d4ea:1678 with SMTP id ce22-20020a056a20441600b0018ad4ea1678mr3356323pzb.15.1700735894602; Thu, 23 Nov 2023 02:38:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700735894; cv=none; d=google.com; s=arc-20160816; b=NRaxkNFdDBNV9rG0LsKnMNsVO4ADGc8wffMAL/U/F/1MLHZ/UihMyoE4S5iLXkA5w2 dW/XoqIswVJ864a+n9wEFdMk8H5emjzuIuwu5RkZgBgAndi80SeAzm3BIjVJgDjKLaWi iBkpCXzqUD2s2tN1YoMrIKQt9c79Lggsb9ZkERVTJFNz+tqfUX9/6C+O6qYMjqJGLFXN gBn92qJv8PSiSqCImT9easkvxNXFCpF+SjkJUG05waeYj6xMjzQ7Ua/1MALaZfdSN/dQ m+IoqJpt56MLUHkFngJqX1H55JbfeB8XFIAMU2k7tSZh/0aTYQWv+ApAZ/WVUN6VHWD9 zTAQ== 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=Y6UgbYsHRzxoDiXw1xh8g6fSahI+rc07lVUEQquGoWc=; fh=9dKK5jOGqt6xvLUIfUcZsOjzOtngApshJEr9DrqgiQU=; b=YmD0dO1G+mP7czKItAxtrKU/l2lbqi6bxov4xVWrxr+YbKTYAJ/rO42xmjAG/xWpiH 83+FQxozg4eCRNtrhyLGTsF1cql2CoSd9adVk9hoOX7sH4wUnx7/MQihHnsF18WVjvPP YAdxcnMJY/pHVKZaFdefDotVYcSVxdGoLXn3Ct5efvjviMhX2r4QhKe0qi06BAHBp+cN OBFf/qLBIoOnow8Ij25EA+xy7+J3Sm5p+I+J0XF/I0ngBe9iIMQEqTpWIsCUyGCtDUjc 6UgZQipUk0ggzpSMN8athPEbVSwRnWkGtDyZLge7NREV2UVfVTfowNbjiVc5O4w/RvAx M6QQ== 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 s8-20020a056a0008c800b006b5c34a0c8csi1014305pfu.251.2023.11.23.02.38.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 02:38:14 -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 7FA4282A754F; Thu, 23 Nov 2023 02:38:13 -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 S1344599AbjKWKiC (ORCPT + 99 others); Thu, 23 Nov 2023 05:38:02 -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) 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,URIBL_BLOCKED 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]); Thu, 23 Nov 2023 02:38:13 -0800 (PST) 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