From b9b24558f7d36c550b5cf0b550a8926f8c03cdbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Bri=C3=A8re?= Date: Sun, 29 May 2011 15:08:04 -0400 Subject: parport/serial: add support for Timedia/SUNIX cards to parport_serial MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Timedia/SUNIX PCI cards with both serial and parallel ports are currently supported by 8250_pci and parport_pc individually. Moving that support into parport_serial allows using both types of ports at the same time. This was successfully tested with a SUNIX 4079T. Signed-off-by: Frédéric Brière Acked-by: Alan Cox Cc: linux-serial@vger.kernel.org Cc: linux-parport@lists.infradead.org Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/8250_pci.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/8250_pci.c b/drivers/tty/serial/8250_pci.c index 9b119fe9257f..e1d4668f86ae 100644 --- a/drivers/tty/serial/8250_pci.c +++ b/drivers/tty/serial/8250_pci.c @@ -575,6 +575,28 @@ static const struct timedia_struct { { 8, timedia_eight_port } }; +/* + * There are nearly 70 different Timedia/SUNIX PCI serial devices. Instead of + * listing them individually, this driver merely grabs them all with + * PCI_ANY_ID. Some of these devices, however, also feature a parallel port, + * and should be left free to be claimed by parport_serial instead. + */ +static int pci_timedia_probe(struct pci_dev *dev) +{ + /* + * Check the third digit of the subdevice ID + * (0,2,3,5,6: serial only -- 7,8,9: serial + parallel) + */ + if ((dev->subsystem_device & 0x00f0) >= 0x70) { + dev_info(&dev->dev, + "ignoring Timedia subdevice %04x for parport_serial\n", + dev->subsystem_device); + return -ENODEV; + } + + return 0; +} + static int pci_timedia_init(struct pci_dev *dev) { const unsigned short *ids; @@ -1463,6 +1485,7 @@ static struct pci_serial_quirk pci_serial_quirks[] __refdata = { .device = PCI_DEVICE_ID_TIMEDIA_1889, .subvendor = PCI_VENDOR_ID_TIMEDIA, .subdevice = PCI_ANY_ID, + .probe = pci_timedia_probe, .init = pci_timedia_init, .setup = pci_timedia_setup, }, -- cgit v1.2.3