From patchwork Thu Jan 23 12:41:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roja Rani Yarubandi X-Patchwork-Id: 214327 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=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable 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 68917C2D0DB for ; Thu, 23 Jan 2020 12:42:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3B6C224655 for ; Thu, 23 Jan 2020 12:42:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726219AbgAWMmv (ORCPT ); Thu, 23 Jan 2020 07:42:51 -0500 Received: from alexa-out-blr-01.qualcomm.com ([103.229.18.197]:27165 "EHLO alexa-out-blr-01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726170AbgAWMmv (ORCPT ); Thu, 23 Jan 2020 07:42:51 -0500 Received: from ironmsg01-blr.qualcomm.com ([10.86.208.130]) by alexa-out-blr-01.qualcomm.com with ESMTP/TLS/AES256-SHA; 23 Jan 2020 18:12:15 +0530 Received: from c-rojay-linux.qualcomm.com ([10.206.21.80]) by ironmsg01-blr.qualcomm.com with ESMTP; 23 Jan 2020 18:11:54 +0530 Received: by c-rojay-linux.qualcomm.com (Postfix, from userid 88981) id C230A26EB; Thu, 23 Jan 2020 18:11:53 +0530 (IST) From: Roja Rani Yarubandi To: Greg Kroah-Hartman Cc: akashast@codeaurora.org, msavaliy@qti.qualcomm.com, mgautam@codeaurora.org, skakit@codeaurora.org, Andy Gross , Bjorn Andersson , Jiri Slaby , linux-arm-msm@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Roja Rani Yarubandi Subject: [PATCH 1/1] tty: serial: qcom_geni_serial: Configure UART_IO_MACRO_CTRL register Date: Thu, 23 Jan 2020 18:11:50 +0530 Message-Id: <20200123124150.19176-2-rojay@codeaurora.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200123124150.19176-1-rojay@codeaurora.org> References: <20200123124150.19176-1-rojay@codeaurora.org> MIME-Version: 1.0 Sender: linux-serial-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org Configure UART_IO_MACRO_CTRL register if UART lines are swapped. Signed-off-by: Roja Rani Yarubandi --- drivers/tty/serial/qcom_geni_serial.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c index ff63728a95f4..68b11b6ad3be 100644 --- a/drivers/tty/serial/qcom_geni_serial.c +++ b/drivers/tty/serial/qcom_geni_serial.c @@ -24,6 +24,7 @@ /* UART specific GENI registers */ #define SE_UART_LOOPBACK_CFG 0x22c +#define SE_UART_IO_MACRO_CTRL 0x240 #define SE_UART_TX_TRANS_CFG 0x25c #define SE_UART_TX_WORD_LEN 0x268 #define SE_UART_TX_STOP_BIT_LEN 0x26c @@ -1260,6 +1261,7 @@ static int qcom_geni_serial_probe(struct platform_device *pdev) int irq; bool console = false; struct uart_driver *drv; + u32 val; if (of_device_is_compatible(pdev->dev.of_node, "qcom,geni-debug-uart")) console = true; @@ -1309,6 +1311,10 @@ static int qcom_geni_serial_probe(struct platform_device *pdev) return irq; uport->irq = irq; + ret = of_property_read_u32(pdev->dev.of_node, "qcom,pin_inverse", &val); + if (!ret) + writel(val, uport->membase + SE_UART_IO_MACRO_CTRL); + irq_set_status_flags(uport->irq, IRQ_NOAUTOEN); ret = devm_request_irq(uport->dev, uport->irq, qcom_geni_serial_isr, IRQF_TRIGGER_HIGH, port->name, uport);