FreeCalypso > hg > fc-linux-patch
annotate 4.9.240/0003-USB-serial-ftdi_sio-add-support-for-FreeCalypso-DUAR.patch @ 3:e8b699ce98a2
add 5.10
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Mon, 11 Dec 2023 06:27:14 +0000 |
parents | 713fe1e8df41 |
children |
rev | line source |
---|---|
0
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 From 8edb5017764d4ad9d90a631c420caca41827cd6e Mon Sep 17 00:00:00 2001 |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 From: "Mychaela N. Falconia" <falcon@freecalypso.org> |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 Date: Fri, 2 Oct 2020 18:01:12 +0000 |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 Subject: [PATCH 3/3] USB: serial: ftdi_sio: add support for FreeCalypso |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 DUART28C adapter |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 FreeCalypso DUART28C is an FT2232D-based USB to dual UART adapter |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 with a special quirk: Channel B RTS and DTR outputs (BDBUS2 and BDBUS4 |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 on the chip) have been repurposed to drive PWON and RESET controls |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 on Calypso targets. The circuit is wired such that BDBUS[24] high |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 (RTS/DTR inactive) is the normal state with Iota VRPC controls |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 NOT activated, whereas BDBUS[24] low (RTS or DTR active) turn ON |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 the corresponding open drain control signal drivers. |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 A special ftdi_sio driver quirk is needed in order to suppress |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 automatic assertion of DTR & RTS on device open: this device's |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 special PWON and RESET control drivers MUST NOT be activated |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 when the port is ordinarily opened for plain serial communication, |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 instead they must only be activated when a special userspace |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 application explicitly requests such activation with a TIOCMBIS ioctl. |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 These special userspace applications are responsible for making the |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 needed pulse with a TIOCMBIS, delay, TIOCMBIC sequence. |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 The special quirk is conditionalized on the DUART28C adapter's custom |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 USB ID, and is further limited to FT2232D Channel B only: Channel A |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 is wired normally, with the chip's ADBUS2 and ADBUS4 outputs |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 actually being RTS and DTR rather than something else. |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 Signed-off-by: Mychaela N. Falconia <falcon@freecalypso.org> |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 --- |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 drivers/usb/serial/ftdi_sio.c | 61 +++++++++++++++++++++++++++++++++++---- |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 drivers/usb/serial/ftdi_sio_ids.h | 1 + |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 2 files changed, 57 insertions(+), 5 deletions(-) |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 index 878ab4e5625c..443aee847556 100644 |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 --- a/drivers/usb/serial/ftdi_sio.c |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 +++ b/drivers/usb/serial/ftdi_sio.c |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 @@ -73,6 +73,8 @@ struct ftdi_private { |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 this value */ |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 int force_rtscts; /* if non-zero, force RTS-CTS to always |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 be enabled */ |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 + int no_auto_dtr_rts; /* if non-zero, suppress automatic assertion |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 + of DTR & RTS on device open */ |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 unsigned int latency; /* latency setting in use */ |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
47 unsigned short max_packet_size; |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
48 @@ -92,6 +94,7 @@ static int ftdi_stmclite_probe(struct usb_serial *serial); |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
49 static int ftdi_8u2232c_probe(struct usb_serial *serial); |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
50 static void ftdi_USB_UIRT_setup(struct usb_serial_port *port); |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
51 static void ftdi_HE_TIRA1_setup(struct usb_serial_port *port); |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
52 +static void ftdi_duart28c_setup(struct usb_serial_port *port); |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
53 |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
54 static const struct ftdi_sio_quirk ftdi_jtag_quirk = { |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
55 .probe = ftdi_jtag_probe, |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
56 @@ -117,6 +120,10 @@ static const struct ftdi_sio_quirk ftdi_8u2232c_quirk = { |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
57 .probe = ftdi_8u2232c_probe, |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
58 }; |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
59 |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
60 +static const struct ftdi_sio_quirk ftdi_duart28c_quirk = { |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
61 + .port_probe = ftdi_duart28c_setup, |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
62 +}; |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
63 + |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
64 /* |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
65 * The 8U232AM has the same API as the sio except for: |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
66 * - it can support MUCH higher baudrates; up to: |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
67 @@ -1037,6 +1044,8 @@ static const struct usb_device_id id_table_combined[] = { |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
68 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
69 { USB_DEVICE(FTDI_VID, FTDI_FALCONIA_JTAG_UNBUF_PID), |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
70 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
71 + { USB_DEVICE(FTDI_VID, FTDI_FALCONIA_DUART28C_PID), |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
72 + .driver_info = (kernel_ulong_t)&ftdi_duart28c_quirk }, |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
73 { } /* Terminating entry */ |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
74 }; |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
75 |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
76 @@ -1961,6 +1970,39 @@ static int ftdi_stmclite_probe(struct usb_serial *serial) |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
77 return 0; |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
78 } |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
79 |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
80 +/* |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
81 + * FreeCalypso DUART28C is an FT2232D-based USB to dual UART adapter |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
82 + * with a special quirk: Channel B RTS and DTR outputs (BDBUS2 and BDBUS4 |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
83 + * on the chip) have been repurposed to drive PWON and RESET controls |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
84 + * on Calypso targets. The circuit is wired such that BDBUS[24] high |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
85 + * (RTS/DTR inactive) is the normal state with Iota VRPC controls |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
86 + * NOT activated, whereas BDBUS[24] low (RTS or DTR active) turn ON |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
87 + * the corresponding open drain control signal drivers. |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
88 + * |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
89 + * A special ftdi_sio driver quirk is needed in order to suppress |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
90 + * automatic assertion of DTR & RTS on device open: this device's |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
91 + * special PWON and RESET control drivers MUST NOT be activated |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
92 + * when the port is ordinarily opened for plain serial communication, |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
93 + * instead they must only be activated when a special userspace |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
94 + * application explicitly requests such activation with a TIOCMBIS ioctl. |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
95 + * These special userspace applications are responsible for making the |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
96 + * needed pulse with a TIOCMBIS, delay, TIOCMBIC sequence. |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
97 + * |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
98 + * The special quirk must be applied only to FT2232D Channel B: |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
99 + * Channel A is wired normally, with the chip's ADBUS2 and ADBUS4 outputs |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
100 + * actually being RTS and DTR rather than something else. |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
101 + */ |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
102 +static void ftdi_duart28c_setup(struct usb_serial_port *port) |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
103 +{ |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
104 + struct ftdi_private *priv = usb_get_serial_port_data(port); |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
105 + struct usb_serial *serial = port->serial; |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
106 + struct usb_interface *intf = serial->interface; |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
107 + int ifnum = intf->cur_altsetting->desc.bInterfaceNumber; |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
108 + |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
109 + if (ifnum == 1) |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
110 + priv->no_auto_dtr_rts = 1; |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
111 +} |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
112 + |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
113 static int ftdi_sio_port_remove(struct usb_serial_port *port) |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
114 { |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
115 struct ftdi_private *priv = usb_get_serial_port_data(port); |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
116 @@ -2010,10 +2052,18 @@ static void ftdi_dtr_rts(struct usb_serial_port *port, int on) |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
117 dev_err(&port->dev, "error from flowcontrol urb\n"); |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
118 } |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
119 } |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
120 - /* drop RTS and DTR */ |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
121 - if (on) |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
122 - set_mctrl(port, TIOCM_DTR | TIOCM_RTS); |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
123 - else |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
124 + /* |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
125 + * Assert or negate RTS and DTR as requested. When DUART28C |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
126 + * quirk is applied, we suppress automatic assertion, but |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
127 + * automatic negation on device close is retained - these |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
128 + * special control signals are meant to be pulsed, and leaving |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
129 + * either of them stuck on when the responsible userspace |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
130 + * program has terminated unexpectedly is undesirable. |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
131 + */ |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
132 + if (on) { |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
133 + if (!priv->no_auto_dtr_rts) |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
134 + set_mctrl(port, TIOCM_DTR | TIOCM_RTS); |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
135 + } else |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
136 clear_mctrl(port, TIOCM_DTR | TIOCM_RTS); |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
137 } |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
138 |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
139 @@ -2355,7 +2405,8 @@ static void ftdi_set_termios(struct tty_struct *tty, |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
140 dev_err(ddev, "%s urb failed to set baudrate\n", __func__); |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
141 mutex_unlock(&priv->cfg_lock); |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
142 /* Ensure RTS and DTR are raised when baudrate changed from 0 */ |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
143 - if (old_termios && (old_termios->c_cflag & CBAUD) == B0) |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
144 + if (old_termios && (old_termios->c_cflag & CBAUD) == B0 |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
145 + && !priv->no_auto_dtr_rts) |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
146 set_mctrl(port, TIOCM_DTR | TIOCM_RTS); |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
147 } |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
148 |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
149 diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
150 index f3302516a1e4..f756b80cb361 100644 |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
151 --- a/drivers/usb/serial/ftdi_sio_ids.h |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
152 +++ b/drivers/usb/serial/ftdi_sio_ids.h |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
153 @@ -44,6 +44,7 @@ |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
154 */ |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
155 #define FTDI_FALCONIA_JTAG_BUF_PID 0x7150 |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
156 #define FTDI_FALCONIA_JTAG_UNBUF_PID 0x7151 |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
157 +#define FTDI_FALCONIA_DUART28C_PID 0x7152 |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
158 |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
159 /* Sienna Serial Interface by Secyourit GmbH */ |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
160 #define FTDI_SIENNA_PID 0x8348 |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
161 -- |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
162 2.9.0 |
713fe1e8df41
initial import of formal patches from freecalypso-hwlab repo
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
163 |