Skip to content

Commit 8e4d295

Browse files
chenhuacaiKexyBiscuit
authored andcommitted
AOSCOS: parport: Add support for the WCH384 4S/1P multi-IO card
WCH384 4S/1P is a PCI-E card with 1 LPT and 4 DB9 COM ports detected as Serial controller: Device 1c00:3450 (rev 10) (prog-if 05 [16850]) [Mingcong Bai: Resolved minor merge conflicts in drivers/tty/serial/8250/8250_pci.c.] Signed-off-by: Huacai Chen <[email protected]> Signed-off-by: Mingcong Bai <[email protected]> Signed-off-by: Kexy Biscuit <[email protected]>
1 parent a285b62 commit 8e4d295

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

drivers/parport/parport_serial.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ enum parport_pc_pci_cards {
6060
wch_ch353_2s1p,
6161
wch_ch382_0s1p,
6262
wch_ch382_2s1p,
63+
wch_ch384_4s1p,
6364
brainboxes_5s1p,
6465
sunix_4008a,
6566
sunix_5069a,
@@ -157,6 +158,7 @@ static struct parport_pc_pci cards[] = {
157158
/* wch_ch353_2s1p*/ { 1, { { 2, -1}, } },
158159
/* wch_ch382_0s1p*/ { 1, { { 2, -1}, } },
159160
/* wch_ch382_2s1p*/ { 1, { { 2, -1}, } },
161+
/* wch_ch384_4s1p*/ { 1, { { 2, -1}, } },
160162
/* brainboxes_5s1p */ { 1, { { 3, -1 }, } },
161163
/* sunix_4008a */ { 1, { { 1, 2 }, } },
162164
/* sunix_5069a */ { 1, { { 1, 2 }, } },
@@ -274,6 +276,8 @@ static struct pci_device_id parport_serial_pci_tbl[] = {
274276
0x1c00, 0x3050, 0, 0, wch_ch382_0s1p },
275277
{ PCI_VENDOR_ID_WCHIC, PCI_DEVICE_ID_WCHIC_CH382_2S1P,
276278
0x1c00, 0x3250, 0, 0, wch_ch382_2s1p },
279+
{ PCI_VENDOR_ID_WCHIC, PCI_DEVICE_ID_WCHIC_CH384_4S1P,
280+
0x1c00, 0x3450, 0, 0, wch_ch384_4s1p },
277281

278282
/* BrainBoxes PX272/PX306 MIO card */
279283
{ PCI_VENDOR_ID_INTASHIELD, 0x4100,
@@ -562,6 +566,13 @@ static struct pciserial_board pci_parport_serial_boards[] = {
562566
.uart_offset = 8,
563567
.first_offset = 0xC0,
564568
},
569+
[wch_ch384_4s1p] = {
570+
.flags = FL_BASE0,
571+
.num_ports = 4,
572+
.base_baud = 115200,
573+
.uart_offset = 8,
574+
.first_offset = 0xC0,
575+
},
565576
[brainboxes_5s1p] = {
566577
.flags = FL_BASE2,
567578
.num_ports = 5,

drivers/tty/serial/8250/8250_pci.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
#define PCI_DEVICE_ID_AMCC_ADDIDATA_APCI7800 0x818e
7575

7676
#define PCI_DEVICE_ID_WCHIC_CH384_4S 0x3470
77+
#define PCI_DEVICE_ID_WCHIC_CH384_4S1P 0x3450
7778
#define PCI_DEVICE_ID_WCHIC_CH384_8S 0x3853
7879

7980
#define PCI_DEVICE_ID_MOXA_CP102E 0x1024
@@ -2905,6 +2906,14 @@ static struct pci_serial_quirk pci_serial_quirks[] = {
29052906
.subdevice = PCI_ANY_ID,
29062907
.init = pci_wch_ch38x_init,
29072908
.exit = pci_wch_ch38x_exit,
2909+
.setup = pci_wch_ch38x_setup,
2910+
},
2911+
/* WCH CH384 4S1P card (16850 clone) */
2912+
{
2913+
.vendor = PCI_VENDOR_ID_WCHIC,
2914+
.device = PCI_DEVICE_ID_WCHIC_CH384_4S1P,
2915+
.subvendor = PCI_ANY_ID,
2916+
.subdevice = PCI_ANY_ID,
29082917
.setup = pci_wch_ch38x_setup,
29092918
},
29102919
/*
@@ -3982,6 +3991,8 @@ static const struct pci_device_id blacklist[] = {
39823991
{ PCI_VDEVICE(WCHCN, 0x5053), REPORT_CONFIG(PARPORT_SERIAL), },
39833992
/* WCH CH382 2S1P */
39843993
{ PCI_VDEVICE(WCHIC, 0x3250), REPORT_CONFIG(PARPORT_SERIAL), },
3994+
/* WCH CH384 4S1P */
3995+
{ PCI_VDEVICE(WCHIC, 0x3450), REPORT_CONFIG(PARPORT_SERIAL), },
39853996

39863997
/* Intel platforms with MID UART */
39873998
{ PCI_VDEVICE(INTEL, 0x081b), REPORT_8250_CONFIG(MID), },

0 commit comments

Comments
 (0)