From: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com>
To: <gregkh@linuxfoundation.org>
Cc: <linux-kernel@vger.kernel.org>, <stefan@agner.ch>,
<shawn.guo@linaro.org>, <kernel@pengutronix.de>, <jslaby@suse.cz>,
<linux-serial@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<devicetree@vger.kernel.org>, <bhuvanchandra.dv@gmail.com>,
Bhuvanchandra DV <bhuvanchandra.dv@toradex.com>
Subject: [PATCH 2/3] tty: serial: fsl_lpuart: remove RTS/CTS control from set/get_mctrl
Date: Fri, 29 May 2015 13:35:53 +0530 [thread overview]
Message-ID: <1432886754-30115-3-git-send-email-bhuvanchandra.dv@toradex.com> (raw)
In-Reply-To: <1432886754-30115-1-git-send-email-bhuvanchandra.dv@toradex.com>
The LPUART does not provide manual control of RTS/CTS signals,
those can only be controlled by the hardware directly. Therefore
manual control of those signals through mctrl can not be provided.
The current implementation enables/disables the automatic control,
which is not what mctrl should do, hence remove the incorrect
implementation.
Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com>
---
drivers/tty/serial/fsl_lpuart.c | 56 ++++++++---------------------------------
1 file changed, 10 insertions(+), 46 deletions(-)
diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
index 08ce76f..357f623 100644
--- a/drivers/tty/serial/fsl_lpuart.c
+++ b/drivers/tty/serial/fsl_lpuart.c
@@ -822,64 +822,28 @@ static unsigned int lpuart32_tx_empty(struct uart_port *port)
static unsigned int lpuart_get_mctrl(struct uart_port *port)
{
- unsigned int temp = 0;
- unsigned char reg;
-
- reg = readb(port->membase + UARTMODEM);
- if (reg & UARTMODEM_TXCTSE)
- temp |= TIOCM_CTS;
-
- if (reg & UARTMODEM_RXRTSE)
- temp |= TIOCM_RTS;
-
- return temp;
+ return TIOCM_CAR | TIOCM_CTS | TIOCM_DSR;
}
static unsigned int lpuart32_get_mctrl(struct uart_port *port)
{
- unsigned int temp = 0;
- unsigned long reg;
-
- reg = lpuart32_read(port->membase + UARTMODIR);
- if (reg & UARTMODIR_TXCTSE)
- temp |= TIOCM_CTS;
-
- if (reg & UARTMODIR_RXRTSE)
- temp |= TIOCM_RTS;
-
- return temp;
+ return TIOCM_CAR | TIOCM_CTS | TIOCM_DSR;
}
static void lpuart_set_mctrl(struct uart_port *port, unsigned int mctrl)
{
- unsigned char temp;
-
- temp = readb(port->membase + UARTMODEM) &
- ~(UARTMODEM_RXRTSE | UARTMODEM_TXCTSE);
-
- if (mctrl & TIOCM_RTS)
- temp |= UARTMODEM_RXRTSE;
-
- if (mctrl & TIOCM_CTS)
- temp |= UARTMODEM_TXCTSE;
-
- writeb(temp, port->membase + UARTMODEM);
+ /*
+ * CTS/RTS can _only_ be handled
+ * automatically by the hardware.
+ */
}
static void lpuart32_set_mctrl(struct uart_port *port, unsigned int mctrl)
{
- unsigned long temp;
-
- temp = lpuart32_read(port->membase + UARTMODIR) &
- ~(UARTMODIR_RXRTSE | UARTMODIR_TXCTSE);
-
- if (mctrl & TIOCM_RTS)
- temp |= UARTMODIR_RXRTSE;
-
- if (mctrl & TIOCM_CTS)
- temp |= UARTMODIR_TXCTSE;
-
- lpuart32_write(temp, port->membase + UARTMODIR);
+ /*
+ * CTS/RTS can _only_ be handled
+ * automatically by the hardware.
+ */
}
static void lpuart_break_ctl(struct uart_port *port, int break_state)
--
2.1.0
next prev parent reply other threads:[~2015-05-29 8:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-29 8:05 [PATCH 0/3] Add RS-485 support and fix RTS/CTS implementation Bhuvanchandra DV
2015-05-29 8:05 ` [PATCH 1/3] ARM: dts: colibri-vf: Add pinmux for UART_0 aka UART_A RTS/CTS pins Bhuvanchandra DV
2015-05-29 8:05 ` Bhuvanchandra DV [this message]
2015-05-29 10:04 ` [PATCH 2/3] tty: serial: fsl_lpuart: remove RTS/CTS control from set/get_mctrl Jakub Kiciński
2015-05-29 10:10 ` Bhuvanchandra DV
2015-05-29 8:05 ` [PATCH 3/3] tty: serial: fsl_lpuart: Add support for RS-485 Bhuvanchandra DV
2015-05-29 10:18 ` Jakub Kiciński
2015-05-29 10:42 ` Bhuvanchandra DV
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1432886754-30115-3-git-send-email-bhuvanchandra.dv@toradex.com \
--to=bhuvanchandra.dv@toradex.com \
--cc=bhuvanchandra.dv@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.cz \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=shawn.guo@linaro.org \
--cc=stefan@agner.ch \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®