From patchwork Thu Aug 8 06:06:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Othacehe X-Patchwork-Id: 13756980 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D7FCCC3DA4A for ; Thu, 8 Aug 2024 06:07:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=dPnHCZkMyi4sPBDmcehTv7Rl0E4zJPeC8eYBG6fTrNM=; b=AX6yXDm1ehija25ImG2nK+q5t9 J2WWtN10FUIKuYzgxXlgyooqhM2x/ML/nxR6Ch6frsr9aOxdTM3Km1EIhMApL4oYdte88vQlCbXAo fqE+XwyQ437fsfvMKZu57N3fJS0m6E9nqoEZWN8kuvqatz21/0lhW1OnlC/3dIGM70tLm62RZLkVL rYRm1AhLV4w1ydaoAq1AsB7zP9X7JC0yAUN2ioGER+AlLdYJyra/DHhLNKyBjuLd07tMNqRFiHs+h eb1mUv5ZoLm2I2f2B6P06d+UpILcVu2B065uCuSPP587goN9yd062Wk1dwKfnA06Pw5CZSmCCT6ML B2XeQuIw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbwJ9-00000007CEK-0Q1d; Thu, 08 Aug 2024 06:07:31 +0000 Received: from eggs.gnu.org ([2001:470:142:3::10]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbwIa-00000007C9R-0NHM for linux-arm-kernel@lists.infradead.org; Thu, 08 Aug 2024 06:06:57 +0000 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sbwIM-0000GG-Fx; Thu, 08 Aug 2024 02:06:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=dPnHCZkMyi4sPBDmcehTv7Rl0E4zJPeC8eYBG6fTrNM=; b=XCjkHT3UUOFb10 eZWp+ft1Tu3PuYROQdd3b+b58k3RUR8k4YfyZ+1h+ZNcC9Vw+xy5hpKhsqK6XEv62yu24/K/cc2h6 4r+Ty3qRaBOzp+3IBwhZ7OfCwBVuqcPGF4oGOCdR0+CSex2REsSexeBNalUHuZdONNZ6faTFpTxJx /gzRO8voPY9C3nY4C2JjxFEz+ODvVon3WGqeeZfr+NTJcms5WdEu+vtNqgCYZSlCh3enLTudaxY7t lsvTVrEaBefh4oM1llW2CqW/utAmdIMbXMAHyLEwQKEvfCTx2NrXHfVyeoTi99GAZ+6Q7OtQ4tQqO PlNVGKjtB54TLRLTSSbg==; From: Mathieu Othacehe To: Richard Genoud , Greg Kroah-Hartman , Jiri Slaby , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Mathieu Othacehe Subject: [PATCH] tty: atmel_serial: use the correct RTS flag. Date: Thu, 8 Aug 2024 08:06:37 +0200 Message-ID: <20240808060637.19886-1-othacehe@gnu.org> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240807_230656_379763_D8F7B06B X-CRM114-Status: GOOD ( 12.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org In RS485 mode, the RTS pin is driven high by hardware when the transmitter is operating. This behaviour cannot be changed. This means that the driver should claim that it supports SER_RS485_RTS_ON_SEND and not SER_RS485_RTS_AFTER_SEND. Otherwise, when configuring the port with the SER_RS485_RTS_ON_SEND, one get the following warning: kern.warning kernel: atmel_usart_serial atmel_usart_serial.2.auto: ttyS1 (1): invalid RTS setting, using RTS_AFTER_SEND instead which is contradictory with what's really happening. Signed-off-by: Mathieu Othacehe Tested-by: Alexander Dahl Acked-by: Richard Genoud --- drivers/tty/serial/atmel_serial.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c index 0a90964d6d107..09b246c9e389e 100644 --- a/drivers/tty/serial/atmel_serial.c +++ b/drivers/tty/serial/atmel_serial.c @@ -2514,7 +2514,7 @@ static const struct uart_ops atmel_pops = { }; static const struct serial_rs485 atmel_rs485_supported = { - .flags = SER_RS485_ENABLED | SER_RS485_RTS_AFTER_SEND | SER_RS485_RX_DURING_TX, + .flags = SER_RS485_ENABLED | SER_RS485_RTS_ON_SEND | SER_RS485_RX_DURING_TX, .delay_rts_before_send = 1, .delay_rts_after_send = 1, };