diff mbox

[1/2] davinci: Support disabling modem status interrupts on SOC UARTS

Message ID 1293844317-11757-1-git-send-email-michael.williamson@criticallink.com (mailing list archive)
State Superseded
Headers show

Commit Message

Michael Williamson Jan. 1, 2011, 1:11 a.m. UTC
None
diff mbox

Patch

diff --git a/arch/arm/mach-davinci/include/mach/serial.h b/arch/arm/mach-davinci/include/mach/serial.h
index 8051110..db1d208 100644
--- a/arch/arm/mach-davinci/include/mach/serial.h
+++ b/arch/arm/mach-davinci/include/mach/serial.h
@@ -49,6 +49,8 @@ 
 struct davinci_uart_config {
 	/* Bit field of UARTs present; bit 0 --> UART1 */
 	unsigned int enabled_uarts;
+	/* Bit field of RTS/CTS disable; bit 0 --> UART1 */
+	unsigned int disable_rtscts;
 };
 
 extern int davinci_serial_init(struct davinci_uart_config *);
diff --git a/arch/arm/mach-davinci/serial.c b/arch/arm/mach-davinci/serial.c
index 1875740..738048e 100644
--- a/arch/arm/mach-davinci/serial.c
+++ b/arch/arm/mach-davinci/serial.c
@@ -31,6 +31,22 @@ 
 #include <mach/serial.h>
 #include <mach/cputype.h>
 
+static void davinci_set_termios_noms(struct uart_port *up,
+				     struct ktermios *new,
+				     struct ktermios *old)
+{
+	/*
+	 * disabling CLOCAL, or enabling CRTSCTS, will enable the modem status
+	 * interrupts.  If this routine is being called, the port in question
+	 * does not have valid CTS/RTS pins (they are pinmuxed to some other
+	 * function).  Override any requested operation that may enable the
+	 * interrupts.
+	 */
+	new->c_cflag &= ~CRTSCTS;
+	new->c_cflag |= CLOCAL;
+	serial8250_do_set_termios(up, new, old);
+}
+
 static inline unsigned int serial_read_reg(struct plat_serial8250_port *up,
 					   int offset)
 {
@@ -109,6 +125,9 @@  int __init davinci_serial_init(struct davinci_uart_config *info)
 
 		if (p->membase && p->type != PORT_AR7)
 			davinci_serial_reset(p);
+
+		if (info->disable_rtscts & (1 << i))
+			p->set_termios = davinci_set_termios_noms;
 	}
 
 	return platform_device_register(soc_info->serial_dev);