From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 188C9C4332E for ; Mon, 1 Mar 2021 22:42:24 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CB1BE60201 for ; Mon, 1 Mar 2021 22:42:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CB1BE60201 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=eaxlabs.cz Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=gtPdX1bo7IjwBPlBT2i3Eh73ww1L5F4dFdDxOpiyhSQ=; b=S23YrvObuAGU50jjv9/9/08Ii JDuuSVFLTfwrkyclXN2oPviQIfO60Je0q7qJrUMvNtyKyGG8lvNBIRgpD2RbiWsK5+O5SBP4wrNs6 PctVuWnBryffJ7039YXhchnh6FqJL0JrFLR2/KWwJ1FA8GpMyjPEABqb6oWWE7iNjGVD2QvKemYdZ 38yebDoYy5HPYWryWMQ5Lv7EdGKi3L10z5Ojdwy9tllhRj5P4I1heWJ9GqaYjXjyvwhwMpg9siM4t z+japnh4qflg7Z9Zl3sky/mirSIiHgBZYJ3ttDsowybSor54/NsSJcz+U10nqPRObgNFiZkfHVAB4 uKdS4I0IQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lGrDX-0000DI-Mr; Mon, 01 Mar 2021 22:40:43 +0000 Received: from ms9.eaxlabs.cz ([147.135.177.209]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lGrDU-0000CR-ED for linux-arm-kernel@lists.infradead.org; Mon, 01 Mar 2021 22:40:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=eaxlabs.cz; s=mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject; bh=kFsI78mY/ZRsnqmIBcnHXfh7nTVcK0J3fpNvfJ5QymU=; b=FB6mU5YXCt5R4qgHXWiXGdw2IAjfsEkKwNHCKp8N+JrrsZKpQT34V8BhtNqd/cbpVZ/TzXpYvmACGINyRgpUokHqf6loTYJsHN4FMO0RZzcxxyNAB1x2EGaeoOQHlFQmoUUXoVBxqHHPZW6Sh6gL/oPmGUEqSto3uCN9LaZWOng=; Received: from [82.99.129.6] (helo=[10.76.6.112]) by ms9.eaxlabs.cz with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1lGrDH-0006uv-Ol; Mon, 01 Mar 2021 23:40:29 +0100 Subject: Re: [PATCH v2 1/2] tty/serial: Add rx-tx-swap OF option to stm32-usart To: Fabrice Gasnier , linux-kernel@vger.kernel.org References: <20210227164157.30971-1-devik@eaxlabs.cz> <439a0d7a-cc0e-764b-7ed8-668b5a85f4a7@foss.st.com> From: Martin DEVERA Message-ID: Date: Mon, 1 Mar 2021 23:40:26 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <439a0d7a-cc0e-764b-7ed8-668b5a85f4a7@foss.st.com> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210301_174040_706852_7E0EB173 X-CRM114-Status: GOOD ( 18.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Alexandre Torgue , Greg Kroah-Hartman , Rob Herring , Le Ray , Maxime Coquelin , linux-serial@vger.kernel.org, Jiri Slaby , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 3/1/21 11:28 AM, Fabrice Gasnier wrote: > On 2/27/21 5:41 PM, Martin Devera wrote: >> STM32 F7/H7 usarts supports RX & TX pin swapping. >> Add option to turn it on. >> Tested on STM32MP157. >> >> Signed-off-by: Martin Devera >> --- >> drivers/tty/serial/stm32-usart.c | 3 ++- >> drivers/tty/serial/stm32-usart.h | 1 + >> 2 files changed, 3 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c >> index b3675cf25a69..3650c8798061 100644 >> --- a/drivers/tty/serial/stm32-usart.c >> +++ b/drivers/tty/serial/stm32-usart.c >> @@ -758,7 +758,7 @@ static void stm32_usart_set_termios(struct uart_port *port, >> cr1 = USART_CR1_TE | USART_CR1_RE; >> if (stm32_port->fifoen) >> cr1 |= USART_CR1_FIFOEN; >> - cr2 = 0; >> + cr2 = stm32_port->swap ? USART_CR2_SWAP : 0; > Hi Martin, > > Same could be done in the startup routine, that enables the port for > reception (as described in Documentation/driver-api/serial/driver.rst) Hello Fabrice, I already incorporated all your comments but I'm struggling with the one above. The code must be in stm32_usart_set_termios too, because CR2 is modified. What is the reason to have it in startup() ? Is it because USART can be started without calling set_termios at all ? Like to reuse bootloader's last settings ? Thanks, Martin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel