Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5846569rdb; Thu, 14 Dec 2023 00:52:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IFW51LBU1pFvyUZ2cgESJK7m6WFj95Smyuv0YjMzDIsd3dymlm0qHiCyJYH7fqfZTNMiTqq X-Received: by 2002:a05:6e02:1c4b:b0:35d:6e56:3d1 with SMTP id d11-20020a056e021c4b00b0035d6e5603d1mr15567892ilg.6.1702543977579; Thu, 14 Dec 2023 00:52:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702543977; cv=none; d=google.com; s=arc-20160816; b=LOPxZGQdbDwH7gxbrjCxGGXlOOGigocGczVPo/dHdsFVwuIpOOmHCdsfi3QexFGEbJ VMxko8xouIu1sg88USd3clNA95dhJlr3jBb4BKTrYC7QTTA0Tv1gpxKhzcXcPjPJd5d4 Wu7CMruq7Mrtm+xpxt12PL4t0Tpz/a4tMz6zBXZ8HXlhfPdfNRKkQlYKgWJnYFIYQjL0 InojahXyk0buaabLVmJ5Ik9yw5J60LNtUTkeimAvYmKGzJq1HAftDIifJVzTn8TIQ4Zy tZdJj8Y5NcpIHJRWUCu8tJCfXT3Y+9N2pyLAHWaO9mlVTK+J+O9GWxXkrGxh7MJkKXUS 5Vag== 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 :in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=0a0UxSFZ5v83kZklXr2C0iTGvVsLYQDL0DuQCAjXKHg=; fh=8PQ9Yo9TQyHTORcyBqF/G8f1uuYaODbuQbsbXuLeNp0=; b=yAL7qawCKJqxaaA0nnLK2BIQLCcfMY4g/I346c3hv4T19gs+N7M48PJIpjECu3K9nb TbMp0SItQmhjD9SwsfgrIMsiw8pZ77yt5A/RPOeomjmHyl/OSzKO6SuRMcF1Z6yxL+WH MfBf8449LS/gkHW+6ogxFaOHxqCRHL9pvqnNKt5bIi/F/nD0UiQOSmS/x2Y4eMCyTnrv vNTH9kzZFbU7peE/601RTxvhwA2L0MJmNiDONwVcfM23HLbPHAwKXNGynzP7ifegv53q FHe1cqSW2EsMv4gX7IKWUqL/haQlBcIVotlEUZ4lIC4Kpn5tJwS0NkPLxjS1YIZLkLjA bmLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=rbFh6xG4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=gmx.de Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id j4-20020a654304000000b005c661efffd0si10681318pgq.754.2023.12.14.00.52.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 00:52:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=rbFh6xG4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=gmx.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 4460D801B8A3; Thu, 14 Dec 2023 00:52:54 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234535AbjLNIwi (ORCPT + 99 others); Thu, 14 Dec 2023 03:52:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229633AbjLNIwg (ORCPT ); Thu, 14 Dec 2023 03:52:36 -0500 Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 129F4A0; Thu, 14 Dec 2023 00:52:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1702543935; x=1703148735; i=linosanfilippo@gmx.de; bh=nVGZXwaLHN7v4BUnHdEIrojj3cfgCeXb8jS185agoEo=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From: In-Reply-To; b=rbFh6xG4CahoZaL/sMgl/3if2tf0TOBiPvD5QcPYaPhBQJa7G4E3164qwAP8xTor lP7SQ9HoO67Y5Yu0Ak6bqCnFm6/yn9aORt4u+Rhx7RXjC7MCAwgD/f9MUY0UBPcIb DXUomy83R5yO4VFYeTLtPh2Pbz9o4xrWwhPLMQTflGtPQJzjjigN6/qCnKPMm5enH 2BDEDL0c4c2QrWErfGFjJjkhynSJ6iKpukgwwBf0arIjeWN59i9FsRKu2MzSmSgRh KLcQ3XaxSKNvv0rqYxHQ8t/l4AzN1zjeJPfy3oNQpEHUQ3RBUss3TWLA9f5j2dtt3 BSAAFsYy/3KZBYRWww== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.2.42] ([84.180.3.177]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MKbkC-1quwfz0BTQ-00L1Zg; Thu, 14 Dec 2023 09:52:15 +0100 Message-ID: Date: Thu, 14 Dec 2023 09:52:13 +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 To: Andy Shevchenko Cc: Christoph Niedermaier , Lukas Wunner , Rasmus Villemoes , Greg Kroah-Hartman , Jiri Slaby , Rob Herring , Krzysztof Kozlowski , Conor Dooley , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-serial@vger.kernel.org" , =?UTF-8?Q?Ilpo_J=C3=A4rvinen?= , "brenda.streiff@ni.com" , Crescent CY Hsieh , Tomas Paukrt References: <20231120151056.148450-1-linux@rasmusvillemoes.dk> <20231120151056.148450-2-linux@rasmusvillemoes.dk> <20231122145344.GA18949@wunner.de> <3b8548b1-b8a9-0c9e-4040-5cfda06a85c6@gmx.de> <5c140498-69e3-4187-8703-db0c41e7ca89@gmx.de> From: Lino Sanfilippo In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:Il2EdiqegOFeHXIgLDNacYB57UTBj/2H78z8fR1nAnaR3vju0uW 6wIQlPcrsViy5HQGYy5nBtZE5YIwzfm9uh0syGDS8UF/tbVNz101FncwoIKLt9y+fYl49jF jkALz49RAkvCKi6IseMcXFvMhviTdWBYqX89Id7xPh8IuYgOLSqI76R3OSd8xwuE08X/wJt /0YA6Iu5jc7vowk6NxGrQ== UI-OutboundReport: notjunk:1;M01:P0:y73/cztHYiE=;pUtBUjJgBrX8akDqFkq++QJ48kp lHZhpzLI/m7EARbZ02k5hbxdJNasRxaPpK4cgYi46oUmfrNw4oORjpEVHsne8ZzeeZk1wYNHX 3sfXXeIWHkRVQL/Cw81l53RRWdYX24hAKERtjrGWOgQO/Ayt/3IPVQJqK3j5WucVHhDuVMekt TAF2IxLK8VfI0K8in9whGxhu7jMWdI0brXwvOlREcJILmfPkQxYmQJsgM3+nB7zvGIEdgzNVX awv4lAhG4e7AaUBJl0NenNL9SarGKZJnVlrd+klCCmEpIZnBgCDSfdPxwahVTTK50/D1H16aL F1y0nXJg0qI5S5Ftan6vdagZZ56rbWsCotVwIW35ieADZ6NGmyUeLgq7tFsC3ziRYUy+xh2ID 2EtipEkI3eeJb2bbwxyOXzvHLeXQxGYybyQ7FnYKBno3uzCJIb7KWIDCR1nwVoFM4jvjuhjMY +4k39lJV2d/qTcB3p+FDIXNO6HRUpfl3ku5KpgHNt9zHQUYrqfuHt2mszowujOApFvRMfQSRK 1PUX+FAW0QZuEyrd8i+XCjjBe7uFjNT80SiiDAaQCP9bPaxLy9j4nMNswfq+OQoXNiP0ZlDeS QVnRUuI509Tx+6BXDQb5yyWkXuEhCPnLLQ4EX2vzIEX3ofb0HpsyDaXnR6SODZehirtdjU8wP O6KVayLdnwg20/7gBLC59v7Ir6f9WSFcSQowWDVQXg0RMEfdkpsdK1pz9x0KoyExyppqtsebs LMVzDpqrWnUasRZKW9bI1QFPbAkV+UY/GmwR07yP3U6AHuMLrNQW0xvnxWLjFXKaEcwvjf43g Xenn/MLgq9Gvz6iP+scHKpIS0WR7JiXooUk7zRm6eqSRUfzkz+XqCpSI8gKGOLkWc20HKf3VG zipRw7ljepD9JEZlgZi5DG6dVpg3C4T+GovEo1+aQIkQ34B1X7yMnp5cJWe1Uy/tvDUo3vCy4 rYNq+VTcnrqCXvTjEX0SZKlWjL8= X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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 groat.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 (groat.vger.email [0.0.0.0]); Thu, 14 Dec 2023 00:52:54 -0800 (PST) Hi, On 11.12.23 14:07, Andy Shevchenko wrote: > On Sat, Dec 09, 2023 at 12:47:47PM +0100, Lino Sanfilippo wrote: >> On 06.12.23 16:42, Lino Sanfilippo wrote: > >>>>>> 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= , which >>>>> would mostly be redundant to SER_RS485_ENABLED. >> >> A cleaner solution would probably be to not handle RS422 with the RS485= settings at >> all, but to introduce another set of ioctls to set and read it. >> >> An own RS422 structure like >> >> struct serial_rs422 { >> __u32 flags; >> #define SER_RS422_ENABLED (1 << 0) >> #define SER_RS422_TERMINATE_BUS (1 << 1) >> }; >> >> >> could be used as the parameter for these new ioctls. >> >> Any comments on this? > > I have (maybe not so constructive) a comment. Please, at all means try t= o not > extend the existing serial data structures, we have too many ones with t= oo many > fields already. For user space, though, one may use unions and flags, bu= t for > internal ones it might be better ways, I think. > Ok, thanks. This is still a valuable information. So what if the above str= ucture (serial_rs422) is only used as a parameter of a new TIOCSRS422 ioctl and only internally = we set a SER_RS485_MODE_RS422 flag in the serial_rs485 struct? So we do not have to add something new to uart_port but also do not expose= the mixture of RS485 and RS422 settings within the serial_rs485 structure to userspace. Regards, Lino