Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp225530rdh; Thu, 23 Nov 2023 02:08:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IEVvctPQJKIVftNAqEvKQwoaOBZWb8ps2W73SO92wkb8xwFRT8XaEQC0a8k7dEUC8IHF8bX X-Received: by 2002:a05:6a20:2585:b0:188:c44:5e5 with SMTP id k5-20020a056a20258500b001880c4405e5mr5138686pzd.30.1700734089401; Thu, 23 Nov 2023 02:08:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700734089; cv=none; d=google.com; s=arc-20160816; b=bIlmfzHEZr8c/YnfHf7rp1ApvF1X4o6T5HtFHFRypke9yFXlR64Zf2S3lAXj7Sx/jo ih2WP6YjttXbXbOq+wUrXw+1nAF13/Vgv1SujzIB6cPbzdj1Rok5ePaJjrBi+oyAk2l8 CyrhYsejVH4hg4zwX5ytZnwlU17wWrDP1QKAtf8A3RhO7C0isJyk3Ms1Htvhd3hRAjsA 8njtHHAxADxdLd7ifORu9FLW4hcyonQv3tnc5wmfnH/vV+jE1S2PoG1XWcyDitfM6EGY c4xFtEmeovKyir9j8uLKVWJxP7Cgy8Ic420MYXEusCI3sclcuJylvO9yQaM42Nd8DFtc GdtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=SmXvLPzPw+DEwAZx7VriDTykjMFvpksI53NUtYqCnkc=; fh=nGvjp9DqsLMf4uBonLoBR/hSRspcFPLtUUUgDUFubDg=; b=HruLwPaXGWD+1TnAt9ggs3FkmMRSxw6q6g2oWRtrxylYvrSmY8kDn6CkbHIOds1UoZ Wmx7yXS8jYn1ylFwRZ4ViEC828oy7sqAdBxktpQc5WGq3lIj6grnxROZlvhS9r4iGnrI WMuKMwqb9/7iOuxdHXnCUoxFOqs1PDjH8SUeQUMvZ2Er3rsITM/2gBWtTU8vcXdIv1Jq qyV81UDM1bRjK7K99FC8lnfYJVIm1dm0I1wRsxKCxdwFJpfDFH4Gw1y8pTqz9eI2885C uiRe/jXO+g7LE5wCN2ajRjAl2K0zPu2cqolOOSEqJPIgAphgofe/+Mku8cg1QB2tAs0o rlrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=iwnceLNn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id o10-20020a17090a3d4a00b002736ff3cc79si1486339pjf.23.2023.11.23.02.08.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 02:08:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=iwnceLNn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id 3FC158085F85; Thu, 23 Nov 2023 02:08:02 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235250AbjKWKHg (ORCPT + 99 others); Thu, 23 Nov 2023 05:07:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235394AbjKWKHR (ORCPT ); Thu, 23 Nov 2023 05:07:17 -0500 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F13810CF for ; Thu, 23 Nov 2023 02:07:21 -0800 (PST) Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-507c5249d55so944183e87.3 for ; Thu, 23 Nov 2023 02:07:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; t=1700734039; x=1701338839; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=SmXvLPzPw+DEwAZx7VriDTykjMFvpksI53NUtYqCnkc=; b=iwnceLNnY/+gvIFj4IJ4gzgyXO1+KoTx7bQXYQOgXIfd3D+240n9InocZrpWqgqmCQ UYAGhy/4pa7FeS1qGQc8nAXySdP5QeWK/uecfFwsMXfEFDbvGvzVNYVV6102XV/jLl6Q H+6yoLHF2C2TVZ9fimeOR5g8cXJX76fVwKpn8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700734039; x=1701338839; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=SmXvLPzPw+DEwAZx7VriDTykjMFvpksI53NUtYqCnkc=; b=fDW+0VK151ZFiTmZy6yEjt9QPFL11S+IFMe/t+w2tAVEeZiVcScZg5NQ7e7ghYBABL gOG6oOiUqCjp93Ih4rhWS9nw+duQAm81dExgZAhgba7FbsRX2BFijSlxxpUVN7wrcHrr OsNiLRf7Jt4jTt5R3WmQ7MrPrPEXi/ZNx6B4uwpCYYVCkSPpF+tDrCVkF6ScHpvzngGk ItbXc1wRboLCWvmORf+JmgjP7l7wKOUqGKSaAU6rLtuwGxM/n6hIPPFIJiZetdpYRTle Jm+4Y73+0N8imPyv+4N++kHc2SGxVtjljxm33LGiyGXnJZb6ZZA/NNsqiA8L73yH+3qa AOZQ== X-Gm-Message-State: AOJu0YwBkS+wLGprGfRJOlGbX8+hsH6B/Vqm5zQfdDpRCje1VZ9ZPmAE ZXAixOjB17aDGZtIly/Nk11FPQ== X-Received: by 2002:a05:6512:2385:b0:504:3c1f:cbd1 with SMTP id c5-20020a056512238500b005043c1fcbd1mr2496310lfv.12.1700734039096; Thu, 23 Nov 2023 02:07:19 -0800 (PST) Received: from [172.16.11.116] ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id e6-20020a196906000000b0050a5f6b5b46sm146397lfc.225.2023.11.23.02.07.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 23 Nov 2023 02:07:18 -0800 (PST) Message-ID: Date: Thu, 23 Nov 2023 11:07:16 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/2] dt-bindings: serial: rs485: add rs485-mux-gpios binding Content-Language: en-US, da To: Lukas Wunner 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 , =?UTF-8?Q?Ilpo_J=C3=A4rvinen?= References: <20231120151056.148450-1-linux@rasmusvillemoes.dk> <20231120151056.148450-2-linux@rasmusvillemoes.dk> <20231122145344.GA18949@wunner.de> From: Rasmus Villemoes In-Reply-To: <20231122145344.GA18949@wunner.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email 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 (howler.vger.email [0.0.0.0]); Thu, 23 Nov 2023 02:08:02 -0800 (PST) On 22/11/2023 15.53, Lukas Wunner wrote: > 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). No, that latter case is as I understand it usually called "4-wire rs485", while rs-422 is an entirely different animal, and the wiring is in some sense actually closer to rs-232. rs-422 is full-duplex, with all the slave device's tx-lines connected to the master's rx, and the master's tx connected to the slaves' rx (ok, it uses differential signalling, so there are four wires involved and not two as in rs-232). But I'm no expert, and there doesn't seem to be entirely consistent terminology. > > 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. >> --- 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) Indeed, I wasn't really able to come up with a good description. Thanks, that's much better. Rasmus