From patchwork Mon Jun 6 10:04:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ilpo_J=C3=A4rvinen?= X-Patchwork-Id: 12870216 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 342A0C43334 for ; Mon, 6 Jun 2022 10:10:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=BkaLfndc3vteJVV8LxMlyt26NTbe6R5fMPgY8O+A508=; b=FWrSI21ZDmP0bB c7Olu50JodkkmFHWTXY/ETd1/5bLn1Ta3/cBtEvThKaGU/3aq4FdoQfcufyeE1BS9JLsZlbPt7j/j OAV/dmhnGp4wWo8tSwuQIZwmHlqHIR0TxhqtdsKt9Bc5TrdO3+MSdfq2jtnUVsimnqkk8bUjx/fQ8 gpIpNSwNQmRybh8UL7G22AuXWRUHOoqulnbI+WhtC4Tt8RbmgN93LF2G7nmJXStyfq0+CZ2jJcBIL FjUmnC9asLWIvIYi3Vk/mPgpyMaXfi8Mo+vlnblK9LlpW1v9F2I6dXFfsMOdLeYg+sdy2mJQj6Ajv /urp5I/3ZAQhvgUBY1Dw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ny9fQ-000dB8-Ns; Mon, 06 Jun 2022 10:09:01 +0000 Received: from mga03.intel.com ([134.134.136.65]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ny9cS-000bZ3-I4 for linux-arm-kernel@lists.infradead.org; Mon, 06 Jun 2022 10:05:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654509956; x=1686045956; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ZM/pEhOqDZJ2vEjEvweRMXHfCanuCKshhfEXaADs/+c=; b=N6EEUbPGSKk+3XbEX0IjJLdPZzn1UkgX3jJ+XFs0Q/f99hDr7hps52iV K7dY1ndy2OrSFGxoGlIC+z7B+g5K3Ef40oChYOp/obvLq5jS5ecogMHhm j4SlFTBskd1iJ08CFcrwahBUL7m3WoKtoRNtun0xO3fg+B336mVVPnlL4 yCeMzjrhHmF85LJI3+H1Vhmkycmz1z5+BQZZvm8cbIC+skTkSQprIVjFF eAM+jqGPbzFfA3TJgxD458wapyvKsmZb9lCwFaDjxc60cw3gOEdVL4OG3 LZgfALBJhouH41VCrPAdE8+V/yNsCyhROSEyp5zLyiMWVWJqxBmyGsz3k Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10369"; a="276875856" X-IronPort-AV: E=Sophos;i="5.91,280,1647327600"; d="scan'208";a="276875856" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jun 2022 03:05:55 -0700 X-IronPort-AV: E=Sophos;i="5.91,280,1647327600"; d="scan'208";a="635523787" Received: from amkossek-mobl1.ger.corp.intel.com (HELO ijarvine-MOBL2.ger.corp.intel.com) ([10.252.57.11]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jun 2022 03:05:52 -0700 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: linux-serial@vger.kernel.org, Greg KH , Jiri Slaby , Maxime Coquelin , Alexandre Torgue , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: =?utf-8?q?Ilpo_J=C3=A4rvinen?= Subject: [PATCH 21/36] serial: stm32: Fill in rs485_supported Date: Mon, 6 Jun 2022 13:04:18 +0300 Message-Id: <20220606100433.13793-22-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220606100433.13793-1-ilpo.jarvinen@linux.intel.com> References: <20220606100433.13793-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220606_030556_714317_18960E92 X-CRM114-Status: UNSURE ( 8.86 ) X-CRM114-Notice: Please train this message. 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 Add information on supported serial_rs485 features. Signed-off-by: Ilpo Järvinen --- drivers/tty/serial/stm32-usart.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index b7b44f4050d4..db3dd9731ee1 100644 --- a/drivers/tty/serial/stm32-usart.c +++ b/drivers/tty/serial/stm32-usart.c @@ -1375,6 +1375,13 @@ static void stm32_usart_deinit_port(struct stm32_port *stm32port) clk_disable_unprepare(stm32port->clk); } +static const struct serial_rs485 stm32_rs485_supported = { + .flags = SER_RS485_ENABLED | SER_RS485_RTS_ON_SEND | SER_RS485_RTS_AFTER_SEND | + SER_RS485_RX_DURING_TX, + .delay_rts_before_send = 1, + .delay_rts_after_send = 1, +}; + static int stm32_usart_init_port(struct stm32_port *stm32port, struct platform_device *pdev) { @@ -1394,6 +1401,7 @@ static int stm32_usart_init_port(struct stm32_port *stm32port, port->has_sysrq = IS_ENABLED(CONFIG_SERIAL_STM32_CONSOLE); port->irq = irq; port->rs485_config = stm32_usart_config_rs485; + port->rs485_supported = &stm32_rs485_supported; ret = stm32_usart_init_rs485(port, pdev); if (ret)