Lines Matching refs:ipd

49 	struct ioc3_priv_data *ipd = irq_data_get_irq_chip_data(d);  in ioc3_irq_ack()  local
52 writel(BIT(hwirq), &ipd->regs->sio_ir); in ioc3_irq_ack()
57 struct ioc3_priv_data *ipd = irq_data_get_irq_chip_data(d); in ioc3_irq_mask() local
60 writel(BIT(hwirq), &ipd->regs->sio_iec); in ioc3_irq_mask()
65 struct ioc3_priv_data *ipd = irq_data_get_irq_chip_data(d); in ioc3_irq_unmask() local
68 writel(BIT(hwirq), &ipd->regs->sio_ies); in ioc3_irq_unmask()
105 struct ioc3_priv_data *ipd = domain->host_data; in ioc3_irq_handler() local
106 struct ioc3 __iomem *regs = ipd->regs; in ioc3_irq_handler()
132 static int ioc3_irq_domain_setup(struct ioc3_priv_data *ipd, int irq) in ioc3_irq_domain_setup() argument
141 domain = irq_domain_create_linear(fn, 24, &ioc3_irq_domain_ops, ipd); in ioc3_irq_domain_setup()
147 ipd->domain = domain; in ioc3_irq_domain_setup()
150 ipd->domain_irq = irq; in ioc3_irq_domain_setup()
154 dev_err(&ipd->pdev->dev, "irq domain setup failed\n"); in ioc3_irq_domain_setup()
183 static int ioc3_serial_setup(struct ioc3_priv_data *ipd) in ioc3_serial_setup() argument
189 &ipd->regs->gpcr_s); in ioc3_serial_setup()
191 writel(0, &ipd->regs->gppr[6]); in ioc3_serial_setup()
193 writel(0, &ipd->regs->gppr[7]); in ioc3_serial_setup()
196 writel(readl(&ipd->regs->port_a.sscr) & ~SSCR_DMA_EN, in ioc3_serial_setup()
197 &ipd->regs->port_a.sscr); in ioc3_serial_setup()
198 writel(readl(&ipd->regs->port_b.sscr) & ~SSCR_DMA_EN, in ioc3_serial_setup()
199 &ipd->regs->port_b.sscr); in ioc3_serial_setup()
202 ret = mfd_add_devices(&ipd->pdev->dev, PLATFORM_DEVID_AUTO, in ioc3_serial_setup()
204 &ipd->pdev->resource[0], 0, ipd->domain); in ioc3_serial_setup()
206 dev_err(&ipd->pdev->dev, "Failed to add 16550 subdevs\n"); in ioc3_serial_setup()
227 static int ioc3_kbd_setup(struct ioc3_priv_data *ipd) in ioc3_kbd_setup() argument
231 ret = mfd_add_devices(&ipd->pdev->dev, PLATFORM_DEVID_AUTO, in ioc3_kbd_setup()
233 &ipd->pdev->resource[0], 0, ipd->domain); in ioc3_kbd_setup()
235 dev_err(&ipd->pdev->dev, "Failed to add 16550 subdevs\n"); in ioc3_kbd_setup()
271 static int ioc3_eth_setup(struct ioc3_priv_data *ipd) in ioc3_eth_setup() argument
276 writel(GPCR_MLAN_EN, &ipd->regs->gpcr_s); in ioc3_eth_setup()
281 ipd->pdev->resource->start); in ioc3_eth_setup()
283 ret = mfd_add_devices(&ipd->pdev->dev, PLATFORM_DEVID_AUTO, in ioc3_eth_setup()
285 &ipd->pdev->resource[0], ipd->pdev->irq, NULL); in ioc3_eth_setup()
287 dev_err(&ipd->pdev->dev, "Failed to add ETH/W1 subdev\n"); in ioc3_eth_setup()
306 static int ioc3_m48t35_setup(struct ioc3_priv_data *ipd) in ioc3_m48t35_setup() argument
310 ret = mfd_add_devices(&ipd->pdev->dev, PLATFORM_DEVID_AUTO, in ioc3_m48t35_setup()
312 &ipd->pdev->resource[0], 0, ipd->domain); in ioc3_m48t35_setup()
314 dev_err(&ipd->pdev->dev, "Failed to add M48T35 subdev\n"); in ioc3_m48t35_setup()
343 static int ioc3_ds1685_setup(struct ioc3_priv_data *ipd) in ioc3_ds1685_setup() argument
347 irq = ioc3_map_irq(ipd->pdev, 6, 0); in ioc3_ds1685_setup()
349 ret = mfd_add_devices(&ipd->pdev->dev, 0, ioc3_ds1685_cells, in ioc3_ds1685_setup()
351 &ipd->pdev->resource[0], irq, NULL); in ioc3_ds1685_setup()
353 dev_err(&ipd->pdev->dev, "Failed to add DS1685 subdev\n"); in ioc3_ds1685_setup()
375 static int ioc3_led_setup(struct ioc3_priv_data *ipd) in ioc3_led_setup() argument
379 ret = mfd_add_devices(&ipd->pdev->dev, 0, ioc3_led_cells, in ioc3_led_setup()
381 &ipd->pdev->resource[0], 0, ipd->domain); in ioc3_led_setup()
383 dev_err(&ipd->pdev->dev, "Failed to add LED subdev\n"); in ioc3_led_setup()
388 static int ip27_baseio_setup(struct ioc3_priv_data *ipd) in ip27_baseio_setup() argument
392 io_irq = ioc3_map_irq(ipd->pdev, PCI_SLOT(ipd->pdev->devfn), in ip27_baseio_setup()
394 ret = ioc3_irq_domain_setup(ipd, io_irq); in ip27_baseio_setup()
398 ret = ioc3_eth_setup(ipd); in ip27_baseio_setup()
402 ret = ioc3_serial_setup(ipd); in ip27_baseio_setup()
406 return ioc3_m48t35_setup(ipd); in ip27_baseio_setup()
409 static int ip27_baseio6g_setup(struct ioc3_priv_data *ipd) in ip27_baseio6g_setup() argument
413 io_irq = ioc3_map_irq(ipd->pdev, PCI_SLOT(ipd->pdev->devfn), in ip27_baseio6g_setup()
415 ret = ioc3_irq_domain_setup(ipd, io_irq); in ip27_baseio6g_setup()
419 ret = ioc3_eth_setup(ipd); in ip27_baseio6g_setup()
423 ret = ioc3_serial_setup(ipd); in ip27_baseio6g_setup()
427 ret = ioc3_m48t35_setup(ipd); in ip27_baseio6g_setup()
431 return ioc3_kbd_setup(ipd); in ip27_baseio6g_setup()
434 static int ip27_mio_setup(struct ioc3_priv_data *ipd) in ip27_mio_setup() argument
438 ret = ioc3_irq_domain_setup(ipd, ipd->pdev->irq); in ip27_mio_setup()
442 ret = ioc3_serial_setup(ipd); in ip27_mio_setup()
446 return ioc3_kbd_setup(ipd); in ip27_mio_setup()
449 static int ip30_sysboard_setup(struct ioc3_priv_data *ipd) in ip30_sysboard_setup() argument
453 io_irq = ioc3_map_irq(ipd->pdev, PCI_SLOT(ipd->pdev->devfn), in ip30_sysboard_setup()
455 ret = ioc3_irq_domain_setup(ipd, io_irq); in ip30_sysboard_setup()
459 ret = ioc3_eth_setup(ipd); in ip30_sysboard_setup()
463 ret = ioc3_serial_setup(ipd); in ip30_sysboard_setup()
467 ret = ioc3_kbd_setup(ipd); in ip30_sysboard_setup()
471 ret = ioc3_ds1685_setup(ipd); in ip30_sysboard_setup()
475 return ioc3_led_setup(ipd); in ip30_sysboard_setup()
478 static int ioc3_menet_setup(struct ioc3_priv_data *ipd) in ioc3_menet_setup() argument
482 io_irq = ioc3_map_irq(ipd->pdev, PCI_SLOT(ipd->pdev->devfn), in ioc3_menet_setup()
484 ret = ioc3_irq_domain_setup(ipd, io_irq); in ioc3_menet_setup()
488 ret = ioc3_eth_setup(ipd); in ioc3_menet_setup()
492 return ioc3_serial_setup(ipd); in ioc3_menet_setup()
495 static int ioc3_menet4_setup(struct ioc3_priv_data *ipd) in ioc3_menet4_setup() argument
497 return ioc3_eth_setup(ipd); in ioc3_menet4_setup()
500 static int ioc3_cad_duo_setup(struct ioc3_priv_data *ipd) in ioc3_cad_duo_setup() argument
504 io_irq = ioc3_map_irq(ipd->pdev, PCI_SLOT(ipd->pdev->devfn), in ioc3_cad_duo_setup()
506 ret = ioc3_irq_domain_setup(ipd, io_irq); in ioc3_cad_duo_setup()
510 ret = ioc3_eth_setup(ipd); in ioc3_cad_duo_setup()
514 return ioc3_kbd_setup(ipd); in ioc3_cad_duo_setup()
528 int (*setup)(struct ioc3_priv_data *ipd);
540 static int ioc3_setup(struct ioc3_priv_data *ipd) in ioc3_setup() argument
546 writel(~0, &ipd->regs->sio_iec); in ioc3_setup()
547 writel(~0, &ipd->regs->sio_ir); in ioc3_setup()
548 writel(0, &ipd->regs->eth.eier); in ioc3_setup()
549 writel(~0, &ipd->regs->eth.eisr); in ioc3_setup()
552 pci_read_config_dword(ipd->pdev, PCI_SUBSYSTEM_VENDOR_ID, &sid); in ioc3_setup()
557 return ioc3_infos[i].setup(ipd); in ioc3_setup()
562 return ioc3_cad_duo_setup(ipd); in ioc3_setup()
568 struct ioc3_priv_data *ipd; in ioc3_mfd_probe() local
587 ipd = devm_kzalloc(&pdev->dev, sizeof(struct ioc3_priv_data), in ioc3_mfd_probe()
589 if (!ipd) { in ioc3_mfd_probe()
593 ipd->pdev = pdev; in ioc3_mfd_probe()
606 ipd->regs = regs; in ioc3_mfd_probe()
609 pci_set_drvdata(pdev, ipd); in ioc3_mfd_probe()
611 ret = ioc3_setup(ipd); in ioc3_mfd_probe()
614 mfd_remove_devices(&ipd->pdev->dev); in ioc3_mfd_probe()
615 if (ipd->domain) { in ioc3_mfd_probe()
616 struct fwnode_handle *fn = ipd->domain->fwnode; in ioc3_mfd_probe()
618 irq_domain_remove(ipd->domain); in ioc3_mfd_probe()
620 free_irq(ipd->domain_irq, (void *)ipd); in ioc3_mfd_probe()
635 struct ioc3_priv_data *ipd; in ioc3_mfd_remove() local
637 ipd = pci_get_drvdata(pdev); in ioc3_mfd_remove()
640 writel(~0, &ipd->regs->sio_iec); in ioc3_mfd_remove()
641 writel(~0, &ipd->regs->sio_ir); in ioc3_mfd_remove()
644 mfd_remove_devices(&ipd->pdev->dev); in ioc3_mfd_remove()
645 if (ipd->domain) { in ioc3_mfd_remove()
646 struct fwnode_handle *fn = ipd->domain->fwnode; in ioc3_mfd_remove()
648 irq_domain_remove(ipd->domain); in ioc3_mfd_remove()
650 free_irq(ipd->domain_irq, (void *)ipd); in ioc3_mfd_remove()
652 pci_iounmap(pdev, ipd->regs); in ioc3_mfd_remove()