From patchwork Thu Sep 28 22:12:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lino Sanfilippo X-Patchwork-Id: 727557 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 45786E743C8 for ; Thu, 28 Sep 2023 22:13:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232507AbjI1WNv (ORCPT ); Thu, 28 Sep 2023 18:13:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231689AbjI1WNv (ORCPT ); Thu, 28 Sep 2023 18:13:51 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A46BA199; Thu, 28 Sep 2023 15:13:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1695939213; x=1696544013; i=linosanfilippo@gmx.de; bh=D/HyYToAkt8HPU01PSU5AsEnPHKGV/ERmzj/d7KZ9N8=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=ocXHYEMymDm8AwrYH/9hMJ23Uqf+T7qGBDjofO6MnC6jsyI9U5leiSguquC9l1kvTHib+tl0cdQ fQrXMxJHX760iyvo/3dTfAyHkL/As0TTLkct/wT0qB/IX0qVitgP/WPI0aoZEGFb5J2NundoDdnE3 7n3pLfPgXCmeAzMqSO/7XykHQjHNVnZqbUu8Ec2r1cCZRMZXEIUtNAmD8Ag23loUyZBm8JhSPNKAA SMx3a7Co1HAwznwkRZaCAkJE2xvZEJJ57LySHnQLfV5G9eHFqmlr88Deh02T2mOmNVOt4hU+JhxSn qzf1GSMsoslAlTqyiK9+kLolOKsvjs+xcxAg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from Venus.speedport.ip ([84.162.21.41]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MnakR-1rSRUe28N3-00jWnv; Fri, 29 Sep 2023 00:13:33 +0200 From: Lino Sanfilippo To: gregkh@linuxfoundation.org, jirislaby@kernel.org Cc: shawnguo@kernel.org, s.hauer@pengutronix.de, ilpo.jarvinen@linux.intel.com, mcoquelin.stm32@gmail.com, alexandre.torgue@foss.st.com, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, l.sanfilippo@kunbus.com, LinoSanfilippo@gmx.de, lukas@wunner.de, p.rosenberger@kunbus.com, stable@vger.kernel.org Subject: [PATCH 3/6] serial: core: set missing supported flag for RX during TX GPIO Date: Fri, 29 Sep 2023 00:12:43 +0200 Message-Id: <20230928221246.13689-4-LinoSanfilippo@gmx.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230928221246.13689-1-LinoSanfilippo@gmx.de> References: <20230928221246.13689-1-LinoSanfilippo@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:QcDgxfI6XE1Vgtej5E7fXsbYloK1SIkv9Fyxhooz1MfNM3zpbJY dmIGkalvdLuwTRffnp5MXVpTGMjkrwAjqGhNtMIPWW3jfOVMgkUh53zJo5NqE3I7gBTMFU6 0TEz6YrcUIRHEgU33k8I2vopmmvpX0nKH48r8xBZfn61yJmlOMnIe368suvkB7wImPQ6fkH rS5RpDyGpJ0JI7dmXuOcg== UI-OutboundReport: notjunk:1;M01:P0:Hrdkk3es4BE=;05suxLYMnno4mb/EG0e3AmVxk8n XvAqZj/RZb+iEJQs80GZbmaXK/a/NPFV/3wWWSVFKqwC5TJwqb7a+jwXCAn4ncxlyUVmfjaNZ gXToS8rzVUatV48BOYEpPJF9vRz+1PCU8ytIwX3QA0JO+zyMwzRj9PR9Y5szHfsJsjQcI+uEh 68FU12dVwiOdOfnSk2bKiXGLGxjFiO2IxJEbSK2AsRIWvBthT7xFXkET/86zF/nmOfaYbCGo/ 7asFxs+d64DBL6wYzKPxY629gQCeQgRx+07xrc5osq/WSWxRCUVX9S3DcgJZXVbjiJpDwXrgW r+ZbaORrrcuOog02YNd3XJa13GwMfiXesHh7qQngFkdtW9EAj2Pxc2C+yue8a1B3sJSHxfNmv rHqnpJpVdJcAir+dPGd0cPDeT6wpnnvrL9IK1/gbGvgqP/yb1aSYUbKM3FyeREsaZYIqTlR4m C2mLAkDlgzog1SeQIi5VKbJqpIBU+54wNB5Ab63pFGiRS8dGzdOxSXu6V4vt8+WRr0jYUrIOT mpw2DiKx+S0kxkVkfyjGoEQHRab8iBTZ7kCShrpGh0XR6EzAq7ptBjGJ9xD32DgxlhokdBUlp 0TbTRZi+E2dXvyCTyPCt1ls0Jzi6F4ihS+QmdB4PSQUXYLb/7unndXGwgEvD+lkp/zDmlHzCC l9lNaGukPE5Zg129OqVyFXzJSgKcdPcpM9MvdoSJYxtg5K5ZzPVYqn0eQ1RepFxuJZfbwDwLr lyY8IZ6JMcQHzZ/IOjEZoeA/T1sAP8U0fbjLM9ynI6hDwUUKuGfkgQmKVm12qO9yBpiBUpCAO q7hleiy/OIokeQv2IQv1IpGw/BrJVDWl632tT4mkLIG6AY/ClJVyeqYjmgM/OdPCls2vYuUac KHV8bHclUpLGY1pcFKv6ZfDBA4ye5ylua1zVz12HpCoMs3ZuVqkKa6r4bv/4x+2MzT2hjEj+k lt0q/Q== Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org From: Lino Sanfilippo If the RS485 feature RX-during-TX is supported by means of a GPIO set the according supported flag. Otherwise setting this feature from userspace may not be possible, since in uart_sanitize_serial_rs485() the passed RS485 configuration is matched against the supported features and unsupported settings are thereby removed and thus take no effect. Cc: stable@vger.kernel.org Fixes: 163f080eb717 ("serial: core: Add option to output RS485 RX_DURING_TX state via GPIO") Signed-off-by: Lino Sanfilippo --- drivers/tty/serial/serial_core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index ef0500be3553..697c36dc7ec8 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -3622,6 +3622,8 @@ int uart_get_rs485_mode(struct uart_port *port) port->rs485_rx_during_tx_gpio = NULL; return dev_err_probe(dev, ret, "Cannot get rs485-rx-during-tx-gpios\n"); } + if (port->rs485_rx_during_tx_gpio) + port->rs485_supported.flags |= SER_RS485_RX_DURING_TX; return 0; }