diff options
author | Sergej Pupykin <ml@sergej.pp.ru> | 2014-11-06 06:36:31 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-11-06 17:58:21 -0500 |
commit | 2fdd8c8c5304901fa7dbb2ce5dbc90a1984cee3d (patch) | |
tree | fdf14940a51b0307b951a1ba88ed6f6b26e0cc17 | |
parent | cab68f89546ba5a04bf28aaeaca841d4ccc2fd52 (diff) |
parport: Add support for the WCH382 2S/1P multi-IO card
WCH382 is a PCI-E card with 1 LPT and 2 DB9 COM ports detected as
Serial controller: Device 1c00:3250 (rev 10) (prog-if 05 [16850])
Signed-off-by: Sergej Pupykin <ml@sergej.pp.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/parport/parport_serial.c | 10 | ||||
-rw-r--r-- | drivers/tty/serial/8250/8250_pci.c | 21 |
2 files changed, 31 insertions, 0 deletions
diff --git a/drivers/parport/parport_serial.c b/drivers/parport/parport_serial.c index ee932004724f..e15b4845f7c6 100644 --- a/drivers/parport/parport_serial.c +++ b/drivers/parport/parport_serial.c | |||
@@ -64,6 +64,7 @@ enum parport_pc_pci_cards { | |||
64 | timedia_9079c, | 64 | timedia_9079c, |
65 | wch_ch353_1s1p, | 65 | wch_ch353_1s1p, |
66 | wch_ch353_2s1p, | 66 | wch_ch353_2s1p, |
67 | wch_ch382_2s1p, | ||
67 | sunix_2s1p, | 68 | sunix_2s1p, |
68 | }; | 69 | }; |
69 | 70 | ||
@@ -151,6 +152,7 @@ static struct parport_pc_pci cards[] = { | |||
151 | /* timedia_9079c */ { 1, { { 2, 3 }, } }, | 152 | /* timedia_9079c */ { 1, { { 2, 3 }, } }, |
152 | /* wch_ch353_1s1p*/ { 1, { { 1, -1}, } }, | 153 | /* wch_ch353_1s1p*/ { 1, { { 1, -1}, } }, |
153 | /* wch_ch353_2s1p*/ { 1, { { 2, -1}, } }, | 154 | /* wch_ch353_2s1p*/ { 1, { { 2, -1}, } }, |
155 | /* wch_ch382_2s1p*/ { 1, { { 2, -1}, } }, | ||
154 | /* sunix_2s1p */ { 1, { { 3, -1 }, } }, | 156 | /* sunix_2s1p */ { 1, { { 3, -1 }, } }, |
155 | }; | 157 | }; |
156 | 158 | ||
@@ -257,6 +259,7 @@ static struct pci_device_id parport_serial_pci_tbl[] = { | |||
257 | /* WCH CARDS */ | 259 | /* WCH CARDS */ |
258 | { 0x4348, 0x5053, PCI_ANY_ID, PCI_ANY_ID, 0, 0, wch_ch353_1s1p}, | 260 | { 0x4348, 0x5053, PCI_ANY_ID, PCI_ANY_ID, 0, 0, wch_ch353_1s1p}, |
259 | { 0x4348, 0x7053, 0x4348, 0x3253, 0, 0, wch_ch353_2s1p}, | 261 | { 0x4348, 0x7053, 0x4348, 0x3253, 0, 0, wch_ch353_2s1p}, |
262 | { 0x1c00, 0x3250, 0x1c00, 0x3250, 0, 0, wch_ch382_2s1p}, | ||
260 | 263 | ||
261 | /* | 264 | /* |
262 | * More SUNIX variations. At least one of these has part number | 265 | * More SUNIX variations. At least one of these has part number |
@@ -494,6 +497,13 @@ static struct pciserial_board pci_parport_serial_boards[] = { | |||
494 | .base_baud = 115200, | 497 | .base_baud = 115200, |
495 | .uart_offset = 8, | 498 | .uart_offset = 8, |
496 | }, | 499 | }, |
500 | [wch_ch382_2s1p] = { | ||
501 | .flags = FL_BASE0, | ||
502 | .num_ports = 2, | ||
503 | .base_baud = 115200, | ||
504 | .uart_offset = 8, | ||
505 | .first_offset = 0xC0, | ||
506 | }, | ||
497 | [sunix_2s1p] = { | 507 | [sunix_2s1p] = { |
498 | .flags = FL_BASE0|FL_BASE_BARS, | 508 | .flags = FL_BASE0|FL_BASE_BARS, |
499 | .num_ports = 2, | 509 | .num_ports = 2, |
diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c index 003679fc884b..0468e15e6f10 100644 --- a/drivers/tty/serial/8250/8250_pci.c +++ b/drivers/tty/serial/8250/8250_pci.c | |||
@@ -1783,6 +1783,16 @@ pci_wch_ch353_setup(struct serial_private *priv, | |||
1783 | return pci_default_setup(priv, board, port, idx); | 1783 | return pci_default_setup(priv, board, port, idx); |
1784 | } | 1784 | } |
1785 | 1785 | ||
1786 | static int | ||
1787 | pci_wch_ch382_setup(struct serial_private *priv, | ||
1788 | const struct pciserial_board *board, | ||
1789 | struct uart_8250_port *port, int idx) | ||
1790 | { | ||
1791 | port->port.flags |= UPF_FIXED_TYPE; | ||
1792 | port->port.type = PORT_16850; | ||
1793 | return pci_default_setup(priv, board, port, idx); | ||
1794 | } | ||
1795 | |||
1786 | #define PCI_VENDOR_ID_SBSMODULARIO 0x124B | 1796 | #define PCI_VENDOR_ID_SBSMODULARIO 0x124B |
1787 | #define PCI_SUBVENDOR_ID_SBSMODULARIO 0x124B | 1797 | #define PCI_SUBVENDOR_ID_SBSMODULARIO 0x124B |
1788 | #define PCI_DEVICE_ID_OCTPRO 0x0001 | 1798 | #define PCI_DEVICE_ID_OCTPRO 0x0001 |
@@ -1837,6 +1847,8 @@ pci_wch_ch353_setup(struct serial_private *priv, | |||
1837 | #define PCI_VENDOR_ID_SUNIX 0x1fd4 | 1847 | #define PCI_VENDOR_ID_SUNIX 0x1fd4 |
1838 | #define PCI_DEVICE_ID_SUNIX_1999 0x1999 | 1848 | #define PCI_DEVICE_ID_SUNIX_1999 0x1999 |
1839 | 1849 | ||
1850 | #define PCIE_VENDOR_ID_WCH 0x1c00 | ||
1851 | #define PCIE_DEVICE_ID_WCH_CH382_2S1P 0x3250 | ||
1840 | 1852 | ||
1841 | /* Unknown vendors/cards - this should not be in linux/pci_ids.h */ | 1853 | /* Unknown vendors/cards - this should not be in linux/pci_ids.h */ |
1842 | #define PCI_SUBDEVICE_ID_UNKNOWN_0x1584 0x1584 | 1854 | #define PCI_SUBDEVICE_ID_UNKNOWN_0x1584 0x1584 |
@@ -2528,6 +2540,14 @@ static struct pci_serial_quirk pci_serial_quirks[] __refdata = { | |||
2528 | .subdevice = PCI_ANY_ID, | 2540 | .subdevice = PCI_ANY_ID, |
2529 | .setup = pci_wch_ch353_setup, | 2541 | .setup = pci_wch_ch353_setup, |
2530 | }, | 2542 | }, |
2543 | /* WCH CH382 2S1P card (16750 clone) */ | ||
2544 | { | ||
2545 | .vendor = PCIE_VENDOR_ID_WCH, | ||
2546 | .device = PCIE_DEVICE_ID_WCH_CH382_2S1P, | ||
2547 | .subvendor = PCI_ANY_ID, | ||
2548 | .subdevice = PCI_ANY_ID, | ||
2549 | .setup = pci_wch_ch382_setup, | ||
2550 | }, | ||
2531 | /* | 2551 | /* |
2532 | * ASIX devices with FIFO bug | 2552 | * ASIX devices with FIFO bug |
2533 | */ | 2553 | */ |
@@ -3635,6 +3655,7 @@ static const struct pci_device_id blacklist[] = { | |||
3635 | /* multi-io cards handled by parport_serial */ | 3655 | /* multi-io cards handled by parport_serial */ |
3636 | { PCI_DEVICE(0x4348, 0x7053), }, /* WCH CH353 2S1P */ | 3656 | { PCI_DEVICE(0x4348, 0x7053), }, /* WCH CH353 2S1P */ |
3637 | { PCI_DEVICE(0x4348, 0x5053), }, /* WCH CH353 1S1P */ | 3657 | { PCI_DEVICE(0x4348, 0x5053), }, /* WCH CH353 1S1P */ |
3658 | { PCI_DEVICE(0x1c00, 0x3250), }, /* WCH CH382 2S1P */ | ||
3638 | }; | 3659 | }; |
3639 | 3660 | ||
3640 | /* | 3661 | /* |