Lines Matching refs:pdev

85 static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent);
90 static void ahci_mcp89_apple_enable(struct pci_dev *pdev);
91 static bool is_mcp89_apple(struct pci_dev *pdev);
95 static int ahci_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg);
96 static int ahci_pci_device_resume(struct pci_dev *pdev);
591 static void ahci_pci_save_initial_config(struct pci_dev *pdev, in ahci_pci_save_initial_config() argument
594 if (pdev->vendor == PCI_VENDOR_ID_JMICRON && pdev->device == 0x2361) { in ahci_pci_save_initial_config()
595 dev_info(&pdev->dev, "JMB361 has only one port\n"); in ahci_pci_save_initial_config()
605 if (pdev->device == 0x6121) in ahci_pci_save_initial_config()
609 dev_info(&pdev->dev, in ahci_pci_save_initial_config()
613 ahci_save_initial_config(&pdev->dev, hpriv); in ahci_pci_save_initial_config()
618 struct pci_dev *pdev = to_pci_dev(host->dev); in ahci_pci_reset_controller() local
622 if (pdev->vendor == PCI_VENDOR_ID_INTEL) { in ahci_pci_reset_controller()
627 pci_read_config_word(pdev, 0x92, &tmp16); in ahci_pci_reset_controller()
630 pci_write_config_word(pdev, 0x92, tmp16); in ahci_pci_reset_controller()
640 struct pci_dev *pdev = to_pci_dev(host->dev); in ahci_pci_init_controller() local
646 if (pdev->device == 0x6121) in ahci_pci_init_controller()
771 struct pci_dev *pdev = to_pci_dev(host->dev); in ahci_avn_hardreset() local
788 pci_read_config_word(pdev, 0x92, &val); in ahci_avn_hardreset()
790 pci_write_config_word(pdev, 0x92, val); in ahci_avn_hardreset()
793 pci_write_config_word(pdev, 0x92, val); in ahci_avn_hardreset()
808 static int ahci_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg) in ahci_pci_device_suspend() argument
810 struct ata_host *host = pci_get_drvdata(pdev); in ahci_pci_device_suspend()
817 dev_err(&pdev->dev, in ahci_pci_device_suspend()
833 return ata_pci_device_suspend(pdev, mesg); in ahci_pci_device_suspend()
836 static int ahci_pci_device_resume(struct pci_dev *pdev) in ahci_pci_device_resume() argument
838 struct ata_host *host = pci_get_drvdata(pdev); in ahci_pci_device_resume()
841 rc = ata_pci_device_do_resume(pdev); in ahci_pci_device_resume()
846 if (is_mcp89_apple(pdev)) in ahci_pci_device_resume()
847 ahci_mcp89_apple_enable(pdev); in ahci_pci_device_resume()
849 if (pdev->dev.power.power_state.event == PM_EVENT_SUSPEND) { in ahci_pci_device_resume()
863 static int ahci_configure_dma_masks(struct pci_dev *pdev, int using_dac) in ahci_configure_dma_masks() argument
871 if (pdev->dma_mask && pdev->dma_mask < DMA_BIT_MASK(32)) in ahci_configure_dma_masks()
875 !dma_set_mask(&pdev->dev, DMA_BIT_MASK(64))) { in ahci_configure_dma_masks()
876 rc = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64)); in ahci_configure_dma_masks()
878 rc = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)); in ahci_configure_dma_masks()
880 dev_err(&pdev->dev, in ahci_configure_dma_masks()
886 rc = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32)); in ahci_configure_dma_masks()
888 dev_err(&pdev->dev, "32-bit DMA enable failed\n"); in ahci_configure_dma_masks()
891 rc = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)); in ahci_configure_dma_masks()
893 dev_err(&pdev->dev, in ahci_configure_dma_masks()
903 struct pci_dev *pdev = to_pci_dev(host->dev); in ahci_pci_print_info() local
907 pci_read_config_word(pdev, 0x0a, &cc); in ahci_pci_print_info()
951 struct pci_dev *pdev = to_pci_dev(host->dev); in ahci_p5wdh_workaround() local
953 if (pdev->bus->number == 0 && pdev->devfn == PCI_DEVFN(0x1f, 2) && in ahci_p5wdh_workaround()
957 dev_info(&pdev->dev, in ahci_p5wdh_workaround()
969 static void ahci_mcp89_apple_enable(struct pci_dev *pdev) in ahci_mcp89_apple_enable() argument
975 pci_read_config_dword(pdev, 0xf8, &val); in ahci_mcp89_apple_enable()
979 pci_write_config_dword(pdev, 0xf8, val); in ahci_mcp89_apple_enable()
981 pci_read_config_dword(pdev, 0x54c, &val); in ahci_mcp89_apple_enable()
983 pci_write_config_dword(pdev, 0x54c, val); in ahci_mcp89_apple_enable()
985 pci_read_config_dword(pdev, 0x4a4, &val); in ahci_mcp89_apple_enable()
988 pci_write_config_dword(pdev, 0x4a4, val); in ahci_mcp89_apple_enable()
990 pci_read_config_dword(pdev, 0x54c, &val); in ahci_mcp89_apple_enable()
992 pci_write_config_dword(pdev, 0x54c, val); in ahci_mcp89_apple_enable()
994 pci_read_config_dword(pdev, 0xf8, &val); in ahci_mcp89_apple_enable()
996 pci_write_config_dword(pdev, 0xf8, val); in ahci_mcp89_apple_enable()
999 static bool is_mcp89_apple(struct pci_dev *pdev) in is_mcp89_apple() argument
1001 return pdev->vendor == PCI_VENDOR_ID_NVIDIA && in is_mcp89_apple()
1002 pdev->device == PCI_DEVICE_ID_NVIDIA_NFORCE_MCP89_SATA && in is_mcp89_apple()
1003 pdev->subsystem_vendor == PCI_VENDOR_ID_APPLE && in is_mcp89_apple()
1004 pdev->subsystem_device == 0xcb89; in is_mcp89_apple()
1008 static bool ahci_sb600_enable_64bit(struct pci_dev *pdev) in ahci_sb600_enable_64bit() argument
1086 if (pdev->bus->number != 0 || pdev->devfn != PCI_DEVFN(0x12, 0) || in ahci_sb600_enable_64bit()
1099 dev_warn(&pdev->dev, in ahci_sb600_enable_64bit()
1106 dev_warn(&pdev->dev, "%s: enabling 64bit DMA\n", match->ident); in ahci_sb600_enable_64bit()
1110 static bool ahci_broken_system_poweroff(struct pci_dev *pdev) in ahci_broken_system_poweroff() argument
1139 return slot == PCI_SLOT(pdev->devfn); in ahci_broken_system_poweroff()
1145 static bool ahci_broken_suspend(struct pci_dev *pdev) in ahci_broken_suspend() argument
1220 if (!dmi || pdev->bus->number || pdev->devfn != PCI_DEVFN(0x1f, 2)) in ahci_broken_suspend()
1229 static bool ahci_broken_online(struct pci_dev *pdev) in ahci_broken_online() argument
1276 return pdev->bus->number == (val >> 8) && pdev->devfn == (val & 0xff); in ahci_broken_online()
1279 static bool ahci_broken_devslp(struct pci_dev *pdev) in ahci_broken_devslp() argument
1287 return pci_match_id(ids, pdev); in ahci_broken_devslp()
1338 static int ahci_init_interrupts(struct pci_dev *pdev, unsigned int n_ports, in ahci_init_interrupts() argument
1346 nvec = pci_msi_vec_count(pdev); in ahci_init_interrupts()
1358 rc = pci_enable_msi_exact(pdev, nvec); in ahci_init_interrupts()
1366 pci_disable_msi(pdev); in ahci_init_interrupts()
1377 if (pci_enable_msi(pdev)) in ahci_init_interrupts()
1382 pci_intx(pdev, 1); in ahci_init_interrupts()
1386 static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) in ahci_init_one() argument
1391 struct device *dev = &pdev->dev; in ahci_init_one()
1401 ata_print_version_once(&pdev->dev, DRV_VERSION); in ahci_init_one()
1406 if (pdev->vendor == PCI_VENDOR_ID_MARVELL && !marvell_enable) in ahci_init_one()
1410 if (is_mcp89_apple(pdev)) in ahci_init_one()
1411 ahci_mcp89_apple_enable(pdev); in ahci_init_one()
1417 if (pdev->vendor == PCI_VENDOR_ID_PROMISE) in ahci_init_one()
1418 dev_info(&pdev->dev, in ahci_init_one()
1422 if (pdev->vendor == PCI_VENDOR_ID_STMICRO && pdev->device == 0xCC06) in ahci_init_one()
1424 else if (pdev->vendor == 0x1c44 && pdev->device == 0x8000) in ahci_init_one()
1428 rc = pcim_enable_device(pdev); in ahci_init_one()
1432 if (pdev->vendor == PCI_VENDOR_ID_INTEL && in ahci_init_one()
1433 (pdev->device == 0x2652 || pdev->device == 0x2653)) { in ahci_init_one()
1440 pci_read_config_byte(pdev, ICH_MAP, &map); in ahci_init_one()
1442 dev_info(&pdev->dev, in ahci_init_one()
1451 rc = pcim_iomap_regions_request_all(pdev, 1 << ahci_pci_bar, DRV_NAME); in ahci_init_one()
1453 pcim_pin_device(pdev); in ahci_init_one()
1464 (pdev->revision == 0xa1 || pdev->revision == 0xa2)) in ahci_init_one()
1468 if (board_id == board_ahci_sb700 && pdev->revision >= 0x40) in ahci_init_one()
1472 if (ahci_sb600_enable_64bit(pdev)) in ahci_init_one()
1475 hpriv->mmio = pcim_iomap_table(pdev)[ahci_pci_bar]; in ahci_init_one()
1478 if (ahci_broken_devslp(pdev)) in ahci_init_one()
1482 ahci_pci_save_initial_config(pdev, hpriv); in ahci_init_one()
1510 if (ahci_broken_system_poweroff(pdev)) { in ahci_init_one()
1512 dev_info(&pdev->dev, in ahci_init_one()
1516 if (ahci_broken_suspend(pdev)) { in ahci_init_one()
1518 dev_warn(&pdev->dev, in ahci_init_one()
1522 if (ahci_broken_online(pdev)) { in ahci_init_one()
1524 dev_info(&pdev->dev, in ahci_init_one()
1535 ahci_init_interrupts(pdev, n_ports, hpriv); in ahci_init_one()
1537 host = ata_host_alloc_pinfo(&pdev->dev, ppi, n_ports); in ahci_init_one()
1545 dev_info(&pdev->dev, "SSS flag set, parallel bus scan disabled\n"); in ahci_init_one()
1574 rc = ahci_configure_dma_masks(pdev, hpriv->cap & HOST_CAP_64); in ahci_init_one()
1585 pci_set_master(pdev); in ahci_init_one()
1587 return ahci_host_activate(host, pdev->irq, &ahci_sht); in ahci_init_one()