Lines Matching refs:pdev

57 static struct sta2x11_mfd *sta2x11_mfd_find(struct pci_dev *pdev)  in sta2x11_mfd_find()  argument
62 if (!pdev && !list_empty(&sta2x11_mfd_list)) { in sta2x11_mfd_find()
69 instance = sta2x11_get_instance(pdev); in sta2x11_mfd_find()
79 static int sta2x11_mfd_add(struct pci_dev *pdev, gfp_t flags) in sta2x11_mfd_add() argument
82 struct sta2x11_mfd *mfd = sta2x11_mfd_find(pdev); in sta2x11_mfd_add()
87 instance = sta2x11_get_instance(pdev); in sta2x11_mfd_add()
102 u32 __sta2x11_mfd_mask(struct pci_dev *pdev, u32 reg, u32 mask, u32 val, in __sta2x11_mfd_mask() argument
105 struct sta2x11_mfd *mfd = sta2x11_mfd_find(pdev); in __sta2x11_mfd_mask()
111 dev_warn(&pdev->dev, ": can't access sctl regs\n"); in __sta2x11_mfd_mask()
117 dev_warn(&pdev->dev, ": system ctl not initialized\n"); in __sta2x11_mfd_mask()
136 struct pci_dev *pdev = *(struct pci_dev **)dev_get_platdata(&dev->dev); in sta2x11_mfd_get_regs_data() local
139 if (!pdev) in sta2x11_mfd_get_regs_data()
141 mfd = sta2x11_mfd_find(pdev); in sta2x11_mfd_get_regs_data()
309 struct pci_dev **pdev; in sta2x11_mfd_platform_probe() local
315 pdev = dev_get_platdata(&dev->dev); in sta2x11_mfd_platform_probe()
316 mfd = sta2x11_mfd_find(*pdev); in sta2x11_mfd_platform_probe()
515 static int sta2x11_mfd_suspend(struct pci_dev *pdev, pm_message_t state) in sta2x11_mfd_suspend() argument
517 pci_save_state(pdev); in sta2x11_mfd_suspend()
518 pci_disable_device(pdev); in sta2x11_mfd_suspend()
519 pci_set_power_state(pdev, pci_choose_state(pdev, state)); in sta2x11_mfd_suspend()
524 static int sta2x11_mfd_resume(struct pci_dev *pdev) in sta2x11_mfd_resume() argument
528 pci_set_power_state(pdev, PCI_D0); in sta2x11_mfd_resume()
529 err = pci_enable_device(pdev); in sta2x11_mfd_resume()
532 pci_restore_state(pdev); in sta2x11_mfd_resume()
578 static void sta2x11_mfd_setup(struct pci_dev *pdev, in sta2x11_mfd_setup() argument
584 sd->bars[i].cells[j].pdata_size = sizeof(pdev); in sta2x11_mfd_setup()
585 sd->bars[i].cells[j].platform_data = &pdev; in sta2x11_mfd_setup()
589 static int sta2x11_mfd_probe(struct pci_dev *pdev, in sta2x11_mfd_probe() argument
595 dev_info(&pdev->dev, "%s\n", __func__); in sta2x11_mfd_probe()
597 err = pci_enable_device(pdev); in sta2x11_mfd_probe()
599 dev_err(&pdev->dev, "Can't enable device.\n"); in sta2x11_mfd_probe()
603 err = pci_enable_msi(pdev); in sta2x11_mfd_probe()
605 dev_info(&pdev->dev, "Enable msi failed\n"); in sta2x11_mfd_probe()
612 sta2x11_mfd_setup(pdev, setup_data); in sta2x11_mfd_probe()
615 if (!sta2x11_mfd_find(pdev)) in sta2x11_mfd_probe()
616 sta2x11_mfd_add(pdev, GFP_ATOMIC); in sta2x11_mfd_probe()
620 err = mfd_add_devices(&pdev->dev, -1, in sta2x11_mfd_probe()
623 &pdev->resource[i], in sta2x11_mfd_probe()
626 dev_err(&pdev->dev, in sta2x11_mfd_probe()
635 mfd_remove_devices(&pdev->dev); in sta2x11_mfd_probe()
636 pci_disable_device(pdev); in sta2x11_mfd_probe()
637 pci_disable_msi(pdev); in sta2x11_mfd_probe()