Lines Matching refs:pdev

70 	struct pci_dev *pdev = to_pci_dev(ap->host->dev);
72 if (pdev->subsystem_device & (1 << (ap->port_no + 14)))
105 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
109 if (cb->device == pdev->device &&
110 (cb->subvendor == pdev->subsystem_vendor ||
123 * @pdev: PCI device to check
129 static u8 serverworks_is_csb(struct pci_dev *pdev)
131 switch (pdev->device) {
203 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
206 pci_write_config_byte(pdev, 0x40 + offset, pio_mode[pio]);
210 if (serverworks_is_csb(pdev)) {
211 pci_read_config_word(pdev, 0x4A, &csb5_pio);
213 pci_write_config_word(pdev, 0x4A, csb5_pio | (pio << devbits));
234 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
236 pci_read_config_byte(pdev, 0x54, &ultra_cfg);
237 pci_read_config_byte(pdev, 0x56 + ap->port_no, &ultra);
241 pci_write_config_byte(pdev, 0x44 + offset, 0x20);
247 pci_write_config_byte(pdev, 0x44 + offset,
251 pci_write_config_byte(pdev, 0x56 + ap->port_no, ultra);
252 pci_write_config_byte(pdev, 0x54, ultra_cfg);
279 static int serverworks_fixup_osb4(struct pci_dev *pdev)
298 static int serverworks_fixup_csb(struct pci_dev *pdev)
303 if (!(PCI_FUNC(pdev->devfn) & 1)) {
338 pci_read_config_byte(pdev, 0x5A, &btr);
340 if (!(PCI_FUNC(pdev->devfn) & 1))
343 btr |= (pdev->revision >= SVWKS_CSB5_REVISION_NEW) ? 0x3 : 0x2;
344 pci_write_config_byte(pdev, 0x5A, btr);
349 static void serverworks_fixup_ht1000(struct pci_dev *pdev)
353 pci_read_config_byte(pdev, 0x5A, &btr);
356 pci_write_config_byte(pdev, 0x5A, btr);
359 static int serverworks_fixup(struct pci_dev *pdev)
364 pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 0x40);
366 switch (pdev->device) {
368 rc = serverworks_fixup_osb4(pdev);
371 ata_pci_bmdma_clear_simplex(pdev);
375 rc = serverworks_fixup_csb(pdev);
378 serverworks_fixup_ht1000(pdev);
385 static int serverworks_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
418 rc = pcim_enable_device(pdev);
422 rc = serverworks_fixup(pdev);
425 if (pdev->device == PCI_DEVICE_ID_SERVERWORKS_OSB4IDE) {
432 else if ((pdev->device == PCI_DEVICE_ID_SERVERWORKS_CSB5IDE) ||
433 (pdev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE) ||
434 (pdev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2)) {
442 if (pdev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2)
446 return ata_pci_bmdma_init_one(pdev, ppi, sht, NULL, 0);
450 static int serverworks_reinit_one(struct pci_dev *pdev)
452 struct ata_host *host = pci_get_drvdata(pdev);
455 rc = ata_pci_device_do_resume(pdev);
459 (void)serverworks_fixup(pdev);