Lines Matching refs:pcidev

232 	int (*register_gpio)(struct pci_dev *pcidev, struct uart_8250_port *port);
246 int (*setup)(struct exar8250 *priv, struct pci_dev *pcidev,
248 void (*exit)(struct pci_dev *pcidev);
552 static int default_setup(struct exar8250 *priv, struct pci_dev *pcidev, in default_setup() argument
560 err = serial8250_pci_setup_port(pcidev, port, 0, offset, board->reg_shift); in default_setup()
590 pci_fastcom335_setup(struct exar8250 *priv, struct pci_dev *pcidev, in pci_fastcom335_setup() argument
600 err = default_setup(priv, pcidev, idx, offset, port); in pci_fastcom335_setup()
618 switch (pcidev->device) { in pci_fastcom335_setup()
726 struct pci_dev *pcidev, in cti_get_port_type_xr17c15x_xr17v25x() argument
729 switch (pcidev->subsystem_device) { in cti_get_port_type_xr17c15x_xr17v25x()
786 dev_err(&pcidev->dev, "unknown/unsupported device\n"); in cti_get_port_type_xr17c15x_xr17v25x()
802 struct pci_dev *pcidev, in cti_get_port_type_fpga() argument
805 switch (pcidev->device) { in cti_get_port_type_fpga()
811 dev_err(&pcidev->dev, "unknown/unsupported device\n"); in cti_get_port_type_fpga()
828 struct pci_dev *pcidev, in cti_get_port_type_xr17v35x() argument
849 dev_warn(&pcidev->dev, "failed to get port %d type from EEPROM\n", port_num); in cti_get_port_type_xr17v35x()
869 static void cti_board_init_osc_freq(struct exar8250 *priv, struct pci_dev *pcidev, u8 eeprom_offset) in cti_board_init_osc_freq() argument
875 dev_warn(&pcidev->dev, "failed to read OSC freq from EEPROM, using default\n"); in cti_board_init_osc_freq()
883 struct pci_dev *pcidev, in cti_port_setup_common() argument
892 ret = serial8250_pci_setup_port(pcidev, port, 0, offset, 0); in cti_port_setup_common()
903 static int cti_board_init_fpga(struct exar8250 *priv, struct pci_dev *pcidev) in cti_board_init_fpga() argument
912 ret = pci_read_config_word(pcidev, CTI_FPGA_CFG_INT_EN_REG, &cfg_val); in cti_board_init_fpga()
917 ret = pci_write_config_word(pcidev, CTI_FPGA_CFG_INT_EN_REG, cfg_val); in cti_board_init_fpga()
928 struct pci_dev *pcidev, in cti_port_setup_fpga() argument
937 ret = cti_board_init_fpga(priv, pcidev); in cti_port_setup_fpga()
942 port_type = cti_get_port_type_fpga(priv, pcidev, idx); in cti_port_setup_fpga()
957 return cti_port_setup_common(priv, pcidev, idx, offset, port); in cti_port_setup_fpga()
960 static void cti_board_init_xr17v35x(struct exar8250 *priv, struct pci_dev *pcidev) in cti_board_init_xr17v35x() argument
967 struct pci_dev *pcidev, in cti_port_setup_xr17v35x() argument
976 cti_board_init_xr17v35x(priv, pcidev); in cti_port_setup_xr17v35x()
978 port_type = cti_get_port_type_xr17v35x(priv, pcidev, idx); in cti_port_setup_xr17v35x()
1003 ret = cti_port_setup_common(priv, pcidev, idx, offset, port); in cti_port_setup_xr17v35x()
1015 static void cti_board_init_xr17v25x(struct exar8250 *priv, struct pci_dev *pcidev) in cti_board_init_xr17v25x() argument
1017 cti_board_init_osc_freq(priv, pcidev, CTI_EE_OFF_XR17V25X_OSC_FREQ); in cti_board_init_xr17v25x()
1020 switch (pcidev->subsystem_device) { in cti_board_init_xr17v25x()
1032 struct pci_dev *pcidev, in cti_port_setup_xr17v25x() argument
1041 cti_board_init_xr17v25x(priv, pcidev); in cti_port_setup_xr17v25x()
1043 port_type = cti_get_port_type_xr17c15x_xr17v25x(priv, pcidev, idx); in cti_port_setup_xr17v25x()
1054 switch (pcidev->subsystem_device) { in cti_port_setup_xr17v25x()
1078 ret = cti_port_setup_common(priv, pcidev, idx, offset, port); in cti_port_setup_xr17v25x()
1090 static void cti_board_init_xr17c15x(struct exar8250 *priv, struct pci_dev *pcidev) in cti_board_init_xr17c15x() argument
1092 cti_board_init_osc_freq(priv, pcidev, CTI_EE_OFF_XR17C15X_OSC_FREQ); in cti_board_init_xr17c15x()
1095 switch (pcidev->subsystem_device) { in cti_board_init_xr17c15x()
1110 struct pci_dev *pcidev, in cti_port_setup_xr17c15x() argument
1118 cti_board_init_xr17c15x(priv, pcidev); in cti_port_setup_xr17c15x()
1120 port_type = cti_get_port_type_xr17c15x_xr17v25x(priv, pcidev, idx); in cti_port_setup_xr17c15x()
1126 switch (pcidev->subsystem_device) { in cti_port_setup_xr17c15x()
1150 return cti_port_setup_common(priv, pcidev, idx, offset, port); in cti_port_setup_xr17c15x()
1154 pci_xr17c154_setup(struct exar8250 *priv, struct pci_dev *pcidev, in pci_xr17c154_setup() argument
1161 return default_setup(priv, pcidev, idx, offset, port); in pci_xr17c154_setup()
1164 static void setup_gpio(struct pci_dev *pcidev, u8 __iomem *p) in setup_gpio() argument
1173 if ((pcidev->vendor == PCI_VENDOR_ID_EXAR) && in setup_gpio()
1174 (pcidev->subsystem_vendor != PCI_VENDOR_ID_SEALEVEL)) { in setup_gpio()
1196 static struct platform_device *__xr17v35x_register_gpio(struct pci_dev *pcidev, in __xr17v35x_register_gpio() argument
1205 pdev->dev.parent = &pcidev->dev; in __xr17v35x_register_gpio()
1206 device_set_node(&pdev->dev, dev_fwnode(&pcidev->dev)); in __xr17v35x_register_gpio()
1233 static int xr17v35x_register_gpio(struct pci_dev *pcidev, struct uart_8250_port *port) in xr17v35x_register_gpio() argument
1235 if (pcidev->vendor == PCI_VENDOR_ID_EXAR) in xr17v35x_register_gpio()
1237 __xr17v35x_register_gpio(pcidev, &exar_gpio_node); in xr17v35x_register_gpio()
1345 static int iot2040_register_gpio(struct pci_dev *pcidev, in iot2040_register_gpio() argument
1356 __xr17v35x_register_gpio(pcidev, &iot2040_gpio_node); in iot2040_register_gpio()
1395 pci_xr17v35x_setup(struct exar8250 *priv, struct pci_dev *pcidev, in pci_xr17v35x_setup() argument
1408 if (pcidev->subsystem_vendor == PCI_VENDOR_ID_SEALEVEL) in pci_xr17v35x_setup()
1418 ret = default_setup(priv, pcidev, idx, offset, port); in pci_xr17v35x_setup()
1431 setup_gpio(pcidev, p); in pci_xr17v35x_setup()
1433 ret = platform->register_gpio(pcidev, port); in pci_xr17v35x_setup()
1439 static void pci_xr17v35x_exit(struct pci_dev *pcidev) in pci_xr17v35x_exit() argument
1442 struct exar8250 *priv = pci_get_drvdata(pcidev); in pci_xr17v35x_exit()
1474 static unsigned int exar_get_nr_ports(struct exar8250_board *board, struct pci_dev *pcidev) in exar_get_nr_ports() argument
1476 if (pcidev->vendor == PCI_VENDOR_ID_ACCESSIO) in exar_get_nr_ports()
1477 return BIT(((pcidev->device & 0x38) >> 3) - 1); in exar_get_nr_ports()
1484 if (pcidev->vendor == PCI_VENDOR_ID_EXAR) in exar_get_nr_ports()
1485 return pcidev->device & 0x0f; in exar_get_nr_ports()
1488 if (pcidev->vendor == PCI_VENDOR_ID_CONNECT_TECH) { in exar_get_nr_ports()
1489 switch (pcidev->device) { in exar_get_nr_ports()
1504 exar_pci_probe(struct pci_dev *pcidev, const struct pci_device_id *ent) in exar_pci_probe() argument
1516 rc = pcim_enable_device(pcidev); in exar_pci_probe()
1520 maxnr = pci_resource_len(pcidev, bar) >> (board->reg_shift + 3); in exar_pci_probe()
1522 nr_ports = exar_get_nr_ports(board, pcidev); in exar_pci_probe()
1524 return dev_err_probe(&pcidev->dev, -ENODEV, "failed to get number of ports\n"); in exar_pci_probe()
1526 priv = devm_kzalloc(&pcidev->dev, struct_size(priv, line, nr_ports), GFP_KERNEL); in exar_pci_probe()
1531 priv->virt = pcim_iomap(pcidev, bar, 0); in exar_pci_probe()
1535 pci_set_master(pcidev); in exar_pci_probe()
1537 rc = pci_alloc_irq_vectors(pcidev, 1, 1, PCI_IRQ_ALL_TYPES); in exar_pci_probe()
1543 uart.port.irq = pci_irq_vector(pcidev, 0); in exar_pci_probe()
1544 uart.port.dev = &pcidev->dev; in exar_pci_probe()
1549 rc = devm_request_irq(&pcidev->dev, uart.port.irq, exar_misc_handler, in exar_pci_probe()
1555 rc = board->setup(priv, pcidev, &uart, i); in exar_pci_probe()
1557 dev_err_probe(&pcidev->dev, rc, "Failed to setup port %u\n", i); in exar_pci_probe()
1561 dev_dbg(&pcidev->dev, "Setup PCI port: port %lx, irq %d, type %d\n", in exar_pci_probe()
1566 dev_err_probe(&pcidev->dev, priv->line[i], in exar_pci_probe()
1573 pci_set_drvdata(pcidev, priv); in exar_pci_probe()
1577 static void exar_pci_remove(struct pci_dev *pcidev) in exar_pci_remove() argument
1579 struct exar8250 *priv = pci_get_drvdata(pcidev); in exar_pci_remove()
1587 priv->board->exit(pcidev); in exar_pci_remove()