diff options
author | Guainluca Anzolin <gianluca@sottospazio.it> | 2012-09-04 10:56:12 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-09-05 16:18:13 -0400 |
commit | 6971c635af27b1d18d409e337e70bae25d2fa8ec (patch) | |
tree | 40a7ebd4e57335d1afeb0b1615c6d3c4f9750853 /drivers | |
parent | 9303ac158fcd5f69c032e06391a9a12d3ccb343e (diff) |
parport_serial: Add support for the WCH353 2S/1P multi-IO card
To allow parport_serial to handle the card the same PCI ids are blacklisted
in 8250_pci.c using the existing software blacklist mechanism.
The blacklist array is also renamed because it now covers this new use
case.
Since the two serial ports are auto-detected as XScale instead of 16550A
clones, we also add a quirk to 8250_pci.c to skip autodetection and set the
correct port type.
Signed-off-by: Gianluca Anzolin <gianluca@sottospazio.it>
[Fold in fixes for the uart_8250 change]
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/parport/parport_serial.c | 11 | ||||
-rw-r--r-- | drivers/tty/serial/8250/8250_pci.c | 38 |
2 files changed, 40 insertions, 9 deletions
diff --git a/drivers/parport/parport_serial.c b/drivers/parport/parport_serial.c index e9c32274df3..1631eeaf440 100644 --- a/drivers/parport/parport_serial.c +++ b/drivers/parport/parport_serial.c | |||
@@ -62,6 +62,7 @@ enum parport_pc_pci_cards { | |||
62 | timedia_9079a, | 62 | timedia_9079a, |
63 | timedia_9079b, | 63 | timedia_9079b, |
64 | timedia_9079c, | 64 | timedia_9079c, |
65 | wch_ch353_2s1p, | ||
65 | }; | 66 | }; |
66 | 67 | ||
67 | /* each element directly indexed from enum list, above */ | 68 | /* each element directly indexed from enum list, above */ |
@@ -145,6 +146,7 @@ static struct parport_pc_pci cards[] __devinitdata = { | |||
145 | /* timedia_9079a */ { 1, { { 2, 3 }, } }, | 146 | /* timedia_9079a */ { 1, { { 2, 3 }, } }, |
146 | /* timedia_9079b */ { 1, { { 2, 3 }, } }, | 147 | /* timedia_9079b */ { 1, { { 2, 3 }, } }, |
147 | /* timedia_9079c */ { 1, { { 2, 3 }, } }, | 148 | /* timedia_9079c */ { 1, { { 2, 3 }, } }, |
149 | /* wch_ch353_2s1p*/ { 1, { { 2, -1}, } }, | ||
148 | }; | 150 | }; |
149 | 151 | ||
150 | static struct pci_device_id parport_serial_pci_tbl[] = { | 152 | static struct pci_device_id parport_serial_pci_tbl[] = { |
@@ -243,7 +245,8 @@ static struct pci_device_id parport_serial_pci_tbl[] = { | |||
243 | { 0x1409, 0x7168, 0x1409, 0xb079, 0, 0, timedia_9079a }, | 245 | { 0x1409, 0x7168, 0x1409, 0xb079, 0, 0, timedia_9079a }, |
244 | { 0x1409, 0x7168, 0x1409, 0xc079, 0, 0, timedia_9079b }, | 246 | { 0x1409, 0x7168, 0x1409, 0xc079, 0, 0, timedia_9079b }, |
245 | { 0x1409, 0x7168, 0x1409, 0xd079, 0, 0, timedia_9079c }, | 247 | { 0x1409, 0x7168, 0x1409, 0xd079, 0, 0, timedia_9079c }, |
246 | 248 | /* WCH CARDS */ | |
249 | { 0x4348, 0x7053, 0x4348, 0x3253, 0, 0, wch_ch353_2s1p}, | ||
247 | { 0, } /* terminate list */ | 250 | { 0, } /* terminate list */ |
248 | }; | 251 | }; |
249 | MODULE_DEVICE_TABLE(pci,parport_serial_pci_tbl); | 252 | MODULE_DEVICE_TABLE(pci,parport_serial_pci_tbl); |
@@ -460,6 +463,12 @@ static struct pciserial_board pci_parport_serial_boards[] __devinitdata = { | |||
460 | .base_baud = 921600, | 463 | .base_baud = 921600, |
461 | .uart_offset = 8, | 464 | .uart_offset = 8, |
462 | }, | 465 | }, |
466 | [wch_ch353_2s1p] = { | ||
467 | .flags = FL_BASE0|FL_BASE_BARS, | ||
468 | .num_ports = 2, | ||
469 | .base_baud = 115200, | ||
470 | .uart_offset = 8, | ||
471 | }, | ||
463 | }; | 472 | }; |
464 | 473 | ||
465 | struct parport_serial_private { | 474 | struct parport_serial_private { |
diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c index ad4bb8dec36..803d313e061 100644 --- a/drivers/tty/serial/8250/8250_pci.c +++ b/drivers/tty/serial/8250/8250_pci.c | |||
@@ -1164,6 +1164,16 @@ pci_xr17c154_setup(struct serial_private *priv, | |||
1164 | return pci_default_setup(priv, board, port, idx); | 1164 | return pci_default_setup(priv, board, port, idx); |
1165 | } | 1165 | } |
1166 | 1166 | ||
1167 | static int | ||
1168 | pci_wch_ch353_setup(struct serial_private *priv, | ||
1169 | const struct pciserial_board *board, | ||
1170 | struct uart_8250_port *port, int idx) | ||
1171 | { | ||
1172 | port->port.flags |= UPF_FIXED_TYPE; | ||
1173 | port->port.type = PORT_16550A; | ||
1174 | return pci_default_setup(priv, board, port, idx); | ||
1175 | } | ||
1176 | |||
1167 | #define PCI_VENDOR_ID_SBSMODULARIO 0x124B | 1177 | #define PCI_VENDOR_ID_SBSMODULARIO 0x124B |
1168 | #define PCI_SUBVENDOR_ID_SBSMODULARIO 0x124B | 1178 | #define PCI_SUBVENDOR_ID_SBSMODULARIO 0x124B |
1169 | #define PCI_DEVICE_ID_OCTPRO 0x0001 | 1179 | #define PCI_DEVICE_ID_OCTPRO 0x0001 |
@@ -1737,6 +1747,14 @@ static struct pci_serial_quirk pci_serial_quirks[] __refdata = { | |||
1737 | .subdevice = PCI_ANY_ID, | 1747 | .subdevice = PCI_ANY_ID, |
1738 | .setup = pci_omegapci_setup, | 1748 | .setup = pci_omegapci_setup, |
1739 | }, | 1749 | }, |
1750 | /* WCH CH353 2S1P card (16550 clone) */ | ||
1751 | { | ||
1752 | .vendor = 0x4348, | ||
1753 | .device = 0x7053, | ||
1754 | .subvendor = 0x4348, | ||
1755 | .subdevice = 0x3253, | ||
1756 | .setup = pci_wch_ch353_setup, | ||
1757 | }, | ||
1740 | /* | 1758 | /* |
1741 | * ASIX devices with FIFO bug | 1759 | * ASIX devices with FIFO bug |
1742 | */ | 1760 | */ |
@@ -2636,10 +2654,14 @@ static struct pciserial_board pci_boards[] __devinitdata = { | |||
2636 | }, | 2654 | }, |
2637 | }; | 2655 | }; |
2638 | 2656 | ||
2639 | static const struct pci_device_id softmodem_blacklist[] = { | 2657 | static const struct pci_device_id blacklist[] = { |
2658 | /* softmodems */ | ||
2640 | { PCI_VDEVICE(AL, 0x5457), }, /* ALi Corporation M5457 AC'97 Modem */ | 2659 | { PCI_VDEVICE(AL, 0x5457), }, /* ALi Corporation M5457 AC'97 Modem */ |
2641 | { PCI_VDEVICE(MOTOROLA, 0x3052), }, /* Motorola Si3052-based modem */ | 2660 | { PCI_VDEVICE(MOTOROLA, 0x3052), }, /* Motorola Si3052-based modem */ |
2642 | { PCI_DEVICE(0x1543, 0x3052), }, /* Si3052-based modem, default IDs */ | 2661 | { PCI_DEVICE(0x1543, 0x3052), }, /* Si3052-based modem, default IDs */ |
2662 | |||
2663 | /* multi-io cards handled by parport_serial */ | ||
2664 | { PCI_DEVICE(0x4348, 0x7053), }, /* WCH CH353 2S1P */ | ||
2643 | }; | 2665 | }; |
2644 | 2666 | ||
2645 | /* | 2667 | /* |
@@ -2650,7 +2672,7 @@ static const struct pci_device_id softmodem_blacklist[] = { | |||
2650 | static int __devinit | 2672 | static int __devinit |
2651 | serial_pci_guess_board(struct pci_dev *dev, struct pciserial_board *board) | 2673 | serial_pci_guess_board(struct pci_dev *dev, struct pciserial_board *board) |
2652 | { | 2674 | { |
2653 | const struct pci_device_id *blacklist; | 2675 | const struct pci_device_id *bldev; |
2654 | int num_iomem, num_port, first_port = -1, i; | 2676 | int num_iomem, num_port, first_port = -1, i; |
2655 | 2677 | ||
2656 | /* | 2678 | /* |
@@ -2667,13 +2689,13 @@ serial_pci_guess_board(struct pci_dev *dev, struct pciserial_board *board) | |||
2667 | 2689 | ||
2668 | /* | 2690 | /* |
2669 | * Do not access blacklisted devices that are known not to | 2691 | * Do not access blacklisted devices that are known not to |
2670 | * feature serial ports. | 2692 | * feature serial ports or are handled by other modules. |
2671 | */ | 2693 | */ |
2672 | for (blacklist = softmodem_blacklist; | 2694 | for (bldev = blacklist; |
2673 | blacklist < softmodem_blacklist + ARRAY_SIZE(softmodem_blacklist); | 2695 | bldev < blacklist + ARRAY_SIZE(blacklist); |
2674 | blacklist++) { | 2696 | bldev++) { |
2675 | if (dev->vendor == blacklist->vendor && | 2697 | if (dev->vendor == bldev->vendor && |
2676 | dev->device == blacklist->device) | 2698 | dev->device == bldev->device) |
2677 | return -ENODEV; | 2699 | return -ENODEV; |
2678 | } | 2700 | } |
2679 | 2701 | ||