Lines Matching +full:serial +full:- +full:id
1 // SPDX-License-Identifier: GPL-2.0+
3 * Support for common PCI multi-I/O cards (which is most of them)
7 * Multi-function PCI cards are supposed to present separate logical
10 * parallel ports and serial ports. This driver is for dealing with
80 int hi; /* -1 if not there, >6 for offset-method (max
85 * If it returns non-zero, no probing will take place and the
91 * is non-zero we couldn't use any of the ports. */
100 if (dev->device == PCI_DEVICE_ID_NETMOS_9835 && in netmos_parallel_init()
101 dev->subsystem_vendor == PCI_VENDOR_ID_IBM && in netmos_parallel_init()
102 dev->subsystem_device == 0x0299) in netmos_parallel_init()
103 return -ENODEV; in netmos_parallel_init()
105 if (dev->device == PCI_DEVICE_ID_NETMOS_9912) { in netmos_parallel_init()
106 par->numports = 1; in netmos_parallel_init()
109 * Netmos uses the subdevice ID to indicate the number of parallel in netmos_parallel_init()
110 * and serial ports. The form is 0x00PS, where <P> is the number of in netmos_parallel_init()
111 * parallel ports and <S> is the number of serial ports. in netmos_parallel_init()
113 par->numports = (dev->subsystem_device & 0xf0) >> 4; in netmos_parallel_init()
114 if (par->numports > ARRAY_SIZE(par->addr)) in netmos_parallel_init()
115 par->numports = ARRAY_SIZE(par->addr); in netmos_parallel_init()
122 /* titan_110l */ { 1, { { 3, -1 }, } },
123 /* titan_210l */ { 1, { { 3, -1 }, } },
124 /* netmos_9xx5_combo */ { 1, { { 2, -1 }, }, netmos_parallel_init },
125 /* netmos_9855 */ { 1, { { 0, -1 }, }, netmos_parallel_init },
126 /* netmos_9855_2p */ { 2, { { 0, -1 }, { 2, -1 }, } },
138 /* timedia_4078a */ { 1, { { 2, -1 }, } },
140 /* timedia_4085h */ { 2, { { 2, -1 }, { 4, -1 }, } },
145 /* timedia_4078u */ { 1, { { 2, -1 }, } },
147 /* timedia_4085u */ { 2, { { 2, -1 }, { 4, -1 }, } },
156 /* wch_ch353_1s1p*/ { 1, { { 1, -1}, } },
157 /* wch_ch353_2s1p*/ { 1, { { 2, -1}, } },
158 /* wch_ch382_0s1p*/ { 1, { { 2, -1}, } },
159 /* wch_ch382_2s1p*/ { 1, { { 2, -1}, } },
160 /* brainboxes_5s1p */ { 1, { { 3, -1 }, } },
165 /* brainboxes_uc257 */ { 1, { { 3, -1 }, } },
166 /* brainboxes_is300 */ { 1, { { 3, -1 }, } },
167 /* brainboxes_uc414 */ { 1, { { 3, -1 }, } },
168 /* brainboxes_px263 */ { 1, { { 3, -1 }, } },
288 /* Brainboxes UC-203 */
294 /* Brainboxes UC-257 */
302 /* Brainboxes UC-414 */
306 /* Brainboxes UC-475 */
312 /* Brainboxes IS-300/IS-500 */
316 /* Brainboxes PX-263/PX-295 */
325 * This table describes the serial "geometry" of these boards. Any
326 * quirks for these can be found in drivers/serial/8250_pci.c
612 struct serial_private *serial; member
618 /* Register the serial port(s) of a PCI card. */
619 static int serial_register(struct pci_dev *dev, const struct pci_device_id *id) in serial_register() argument
623 struct serial_private *serial; in serial_register() local
625 board = &pci_parport_serial_boards[id->driver_data]; in serial_register()
626 if (board->num_ports == 0) in serial_register()
629 serial = pciserial_init_ports(dev, board); in serial_register()
630 if (IS_ERR(serial)) in serial_register()
631 return PTR_ERR(serial); in serial_register()
633 priv->serial = serial; in serial_register()
638 static int parport_register(struct pci_dev *dev, const struct pci_device_id *id) in parport_register() argument
644 priv->par = cards[id->driver_data]; in parport_register()
645 card = &priv->par; in parport_register()
646 if (card->preinit_hook && in parport_register()
647 card->preinit_hook (dev, card, PARPORT_IRQ_NONE, PARPORT_DMA_NONE)) in parport_register()
648 return -ENODEV; in parport_register()
650 for (n = 0; n < card->numports; n++) { in parport_register()
652 int lo = card->addr[n].lo; in parport_register()
653 int hi = card->addr[n].hi; in parport_register()
657 if (priv->num_par == ARRAY_SIZE (priv->port)) { in parport_register()
658 dev_warn(&dev->dev, in parport_register()
660 ARRAY_SIZE(priv->port), card->numports); in parport_register()
679 dev_dbg(&dev->dev, in parport_register()
683 dev_dbg(&dev->dev, in parport_register()
688 PARPORT_DMA_NONE, &dev->dev, IRQF_SHARED); in parport_register()
690 priv->port[priv->num_par++] = port; in parport_register()
695 if (card->postinit_hook) in parport_register()
696 card->postinit_hook (dev, card, !success); in parport_register()
702 const struct pci_device_id *id) in parport_serial_pci_probe() argument
707 priv = devm_kzalloc(&dev->dev, sizeof(*priv), GFP_KERNEL); in parport_serial_pci_probe()
709 return -ENOMEM; in parport_serial_pci_probe()
717 err = parport_register(dev, id); in parport_serial_pci_probe()
721 err = serial_register(dev, id); in parport_serial_pci_probe()
724 for (i = 0; i < priv->num_par; i++) in parport_serial_pci_probe()
725 parport_pc_unregister_port (priv->port[i]); in parport_serial_pci_probe()
737 // Serial ports in parport_serial_pci_remove()
738 if (priv->serial) in parport_serial_pci_remove()
739 pciserial_remove_ports(priv->serial); in parport_serial_pci_remove()
742 for (i = 0; i < priv->num_par; i++) in parport_serial_pci_remove()
743 parport_pc_unregister_port (priv->port[i]); in parport_serial_pci_remove()
752 if (priv->serial) in parport_serial_pci_suspend()
753 pciserial_suspend_ports(priv->serial); in parport_serial_pci_suspend()
763 if (priv->serial) in parport_serial_pci_resume()
764 pciserial_resume_ports(priv->serial); in parport_serial_pci_resume()
785 MODULE_DESCRIPTION("Driver for common parallel+serial multi-I/O PCI cards");