summaryrefslogtreecommitdiff
path: root/recipes-kernel/vizzini/kernel-module-vizzini-1.1/vizzini-1.1-enable-cts.patch
blob: 12e6d04ad189ac6eaa1db2487368ee6f9c3bd23c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Index: xr21v141x-lnx3.10-3.11/vizzini.c
===================================================================
--- xr21v141x-lnx3.10-3.11.orig/vizzini.c	2014-04-04 19:58:55.000000000 -0500
+++ xr21v141x-lnx3.10-3.11/vizzini.c	2014-04-16 15:05:16.470621233 -0500
@@ -61,6 +61,9 @@
 #define DRIVER_AUTHOR "Ravi Reddy"
 #define DRIVER_DESC "Exar USB UART Driver for XR21V141x "
 
+#define UART_PIN_RTS   0x020
+#define UART_GPIO_DIR  0x01b
+
 static struct usb_driver xr21v141x_driver;
 static struct tty_driver *xr21v141x_tty_driver;
 static struct xr21v141x *xr21v141x_table[XR21V141X_TTY_MINORS];
@@ -1172,6 +1175,17 @@
         vizzini_set_reg(xr21v141x, block, UART_FLOW, flow);
         vizzini_set_reg(xr21v141x, block, UART_GPIO_MODE, gpio_mode);
 
+	/* if flow control hasn't been turned on, enable RTS for modem-like functionality */
+	if (flow == UART_FLOW_MODE_NONE) {
+	    char value;
+	    vizzini_get_reg(xr21v141x, block, UART_GPIO_DIR, &value);
+	    value |= UART_PIN_RTS;
+	    vizzini_set_reg(xr21v141x, block, UART_GPIO_DIR, value);
+	    vizzini_get_reg(xr21v141x, block, UART_GPIO_CLR, &value);
+	    value |= UART_PIN_RTS;
+	    vizzini_set_reg(xr21v141x, block, UART_GPIO_CLR, value);
+	}
+
         if (xr21v141x->trans9) {
                 /* Turn on wide mode if we're 9-bit transparent. */
                 vizzini_set_reg(xr21v141x, EPLOCALS_REG_BLOCK, (block * MEM_EP_LOCALS_SIZE) + EP_WIDE_MODE, 1);