Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp2141741rdh; Sat, 25 Nov 2023 15:40:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IE10jBNB9GcX9Q2T62/2rX2xnbsDr1JeX2zCTZ8BSm4nwXzO+tuXsp+JvWNQaNajrB0nOun X-Received: by 2002:a17:90a:d152:b0:280:29df:747e with SMTP id t18-20020a17090ad15200b0028029df747emr14544103pjw.1.1700955650967; Sat, 25 Nov 2023 15:40:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700955650; cv=none; d=google.com; s=arc-20160816; b=DwI6ffjMIQrgZSMPOhUW7JWsa4qYi029Ln0wKsBPSAfaRDbZb4V8tWDea92U65UT5f zQhEOVraOIyJxTUiW7d6Eu7nNSHlyj7Y0ChfCzZegVQJhDkHI/ZwabgXJIf46HNd3GSi LSYr8YLv5tbpzalWdE916mAi+UpL5fZh3gpWYGf/MKSvGRA8ab1/CeQvX1O1isJdZM3e 8hAcQTrZASlgdrEkmaXKHwC7EOUm9mpBS993iPrw6LZmkKJSFrtl7gzOPfFZEYDWsDje 6DODZxWPd+l84Vc/biExWzGcS85LkDhQfyGGunNn5lIGmjtdOFCCigKzeaa8cZfxH47f oWHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:ui-outboundreport:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=lPeJvlVRjij8nFwv3/nfE1yElJI+ckueVIu8OcmuvQc=; fh=gFik7Pjv/Hxmx774ZkPQEZHre6aHtb+G0ym2yFtvsJc=; b=p1oTyHPXr4G5clN9LkJ4KXilYHfPHkWhVETFd7crz0ZbCTWMuuvFlcjXKAR3MQ8aGk Rd+AnGfC8E7jFbBlvfZjIp9GMOk6vcfz51zIOAL6OGc1skZxBCumn2Ldl8xwLetSrR6M 9k7wZPXCPALJYDJveKtzQ0s6vphtxQ0qN/rqpEO32IcUpjHNpebX40eAilzwkIX94NJj h7fRdvt7oBw2TLg7x15/+pGak2aFxaM0q8d8chDByG2viNohPuqwkbegyzspLGfS6+3z Hvz+g/f0wSBaSeOGW0a2HOQJeEEsBgAiypzAA/jp7dfs/no1woaLgDGinm5NG1JH4dxg pqIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=V6p4UK7g; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmx.de Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id h6-20020a170902f54600b001ce160421b2si7097026plf.408.2023.11.25.15.40.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Nov 2023 15:40:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=V6p4UK7g; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmx.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 3FBFC8026C3D; Sat, 25 Nov 2023 15:40:48 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229505AbjKYXkc (ORCPT + 99 others); Sat, 25 Nov 2023 18:40:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229448AbjKYXkb (ORCPT ); Sat, 25 Nov 2023 18:40:31 -0500 Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A622A6; Sat, 25 Nov 2023 15:40:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1700955609; x=1701560409; i=linosanfilippo@gmx.de; bh=SP2ucH5r5Gk6l2j+5rFElVMMInW0SpnmPF4xI/IwDj0=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date: In-Reply-To; b=V6p4UK7gc83syEEOnBaGBw9lFADuk+sWQohChmEK6WvkDETUiRSQaZ5KSCsIZocR MK23vO7gJdBzSfWsEq3GGTr9DdBCSVtp6+G7RDWlYhXkc1Q03yTVdWDhFhBVMB2DO DLv5/hVIREd7eIcG+SmuvxHXs/6E3QKTfGHVgVAZrLxKSk4i7gHXA1iZQ2A7/d1cx 0x0cCw60xJTN43cRFHlnik97/fUqiAu778DvfjswGEVDPO0fEKNTvT7aVElXA14iG n58Tx5qvVtC44Wckii8PBfLMoALnXdCuRO6GM/VTNsZX3PX4qMucW95pjV94eDpeF 52dyLqJonZb5Nr0KBA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.2.37] ([84.180.3.177]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MirjY-1rlbjR1zNM-00exK7; Sun, 26 Nov 2023 00:40:09 +0100 Subject: Re: [PATCH 1/2] dt-bindings: serial: rs485: add rs485-mux-gpios binding To: Lukas Wunner , 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 , =?UTF-8?Q?Ilpo_J=c3=a4rvinen?= , brenda.streiff@ni.com, cniedermaier@dh-electronics.com, Tomas Paukrt References: <20231120151056.148450-1-linux@rasmusvillemoes.dk> <20231120151056.148450-2-linux@rasmusvillemoes.dk> <20231122145344.GA18949@wunner.de> From: Lino Sanfilippo Message-ID: <3b8548b1-b8a9-0c9e-4040-5cfda06a85c6@gmx.de> Date: Sun, 26 Nov 2023 00:40:07 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20231122145344.GA18949@wunner.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:07zHm1TyCdV/+MnqDviThy3OX1Ef71ZtfO7wE5IGH7Hq4oN7q+t 2lKYbOsDocv7AfpDI3evugvWmaMTGi04fYGqZ/7leh7DmDYTkcP57crLET5UfQvzylA1QmS RounC16PHjjcMwRi+q5altMwuK7TGYLcIIoB3AEvEfLVF2SgybEp6okwxR5ICNd4hubeZeO kc4HMpQNxfWKxMmvG77yg== UI-OutboundReport: notjunk:1;M01:P0:ZInMyQRO+3o=;dTF6cGcRKSxrqhzmrjwN9Ahblyj 37gS6WPx7o94qtr6i0w7Cacqcyt7J9YMXgNQutM0Wl5k3vuy1drPTFrGzsvTWFNxxsUuSOl5g r4PDepomjUsUw0STwz78iIUMOij2QWB/bhZ5f88l7awbzudXGqi/P12P2b9HGO229b5oxMKF5 lC75SZ2VvyZCUiXXXgDGFcG8NwuxeS9dXE+MAP5L5K/bt+6VsXFO/1/fRg+OqOeLwX4OuGcPv cw/uxi700jQsW/chl68+CwL0iVBEJWn+treuXaDghxU/U1jYj7weLZPx2mDwUU5DQhPniSv5v 9IjtM/rdAm3BSRE+Xeid4oAzK8ieEmK2iBwDeD6TbUU9TJ1owY9QSKmqgqjnOSoHprWyIaiWN sZf5hkPqY+4iMBxbw5OzN1lr1AI6ZdQn66asD177epJ8tSdSdDKSkXm31mP8ZT7Y03qQ1aBRM BJ+DcYi3RiHWAKvkCulrUXOki7lygIqGYcwwO/MfhPRoRO3WmiDsaki4CTEp61fQn+PgdFXXP vYQJ12sfAlSB27L+yNYVkobwZvlrCmdqomr8zY9e/lLaYKlmLm8YzJk2bPAkSPyOSjANG1G3x tYJ975ZzU2JW9KnwuvbC3B4z5zOq92gzEgwMmlMeb9OJ9k0YuuiY8OIJB9Tz/bgPEcMwN4qYV Fc+WiBgF7HV7o2+gROAigPQh2fUOLe6+vdckPlZbesW2NUazkk52o54VylUmG/V2rJeCuotYO LEdnx/PmRx61D7Et3K6/Gs5oJDWDWRF1US43h8DmVmhwEpGIWPaxmCHPK4DYzxVFCHQfJMmFX Hkcy5cz2T3k4ucwtybxT8rDqDt665pwCkoy/hVx9AynQ46ZD8deZ7SKAOTaQZUxYRr/kn2F2T aicbcef84LXnpSRoOFNIBEp5OmRiPJkUwyb93eqaLTMeTo+YXKOc2Z/YJl4Y359BWhhO8A2OF BTVjn2FlSo1HPqVPPx2GMr4/3u0= X-Spam-Status: No, score=-3.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, 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 pete.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 (pete.vger.email [0.0.0.0]); Sat, 25 Nov 2023 15:40:48 -0800 (PST) Hi, On 22.11.23 at 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/ > That new flag was suggested by me instead of using SER_RS422_ENABLED, whic= h would mostly be redundant to SER_RS485_ENABLED. I dont know if it is a good choice in the long term to handle both modes w= ithin the RS485 configuration. It would be cleaner to have an own RS422 structur= e with its own flags and properties. And until now the only flag that seems to ma= ke sense for both RS422 and RS485 is AFAICS SER_RS485_TERMINATE_BUS. On the other hand the bus termination is at least a property that both mod= es have in common. And handling RS422 in its own structure would require another i= octl to set and get the the RS422 settings. But maybe there are more or better possibilities to handle RS4822 support.= I would like to hear other ideas. > 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. Actually we would have four (as Brenda already wrote, see https://lore.kernel.org/all/c6ea912f-d5ab-4761-813d-3b6b6be141cb@ni.co= m/), and with the propose SER_RS485_MODE_RS422 flag these modes would be used l= ike RS-232: rs485->flags =3D 0 RS-422: rs485->flags =3D SER_RS485_ENABLED|SER_RS485= _MODE_RS422 RS-485 (2-wire half-duplex): rs485->flags =3D SER_RS485_ENABLED RS-485 (4-wire full-duplex): rs485->flags =3D SER_RS485_ENABLED|SER_RS485= _RX_DURING_TX > A single GPIO seems insufficient to handle that. GPIOs for RS485 is another thing. I mean, currently we have a GPIO for RS485 termination (I introduced it wi= th commit 44b27aec9d9680875). Christoph introduced support for a rx-during-tx GPIO (see commit 163f080eb= 717). Tomas intends to add a GPIO which enables RS485 if asserted (see https://lore.kernel.org/all/3Za.ZZs%7D.ndXI8CMee4.1bN6eQ@seznam.cz/) = and with Rasmus patches we are about to add a MUX-GPIO which is to be asserted if RS485 is enabled= . I wonder where this will end and if we really have to support every possib= le GPIO in the serial core. Regards, Lino