Lines Matching refs:pdev
197 struct pci_dev *pdev = to_pci_dev(dev);
199 pci_read_config_word(pdev, 0x50, &misc);
201 pci_write_config_word(pdev, 0x50, misc & 0xfcff);
203 pci_write_config_word(pdev, 0x50, misc | 0x0300);
289 int usb_hcd_amd_remote_wakeup_quirk(struct pci_dev *pdev)
295 dev_dbg(&pdev->dev, "QUIRK: Enable AMD remote wakeup fix\n");
463 static int usb_asmedia_wait_write(struct pci_dev *pdev)
470 pci_read_config_byte(pdev, ASMT_CONTROL_REG, &value);
473 dev_err(&pdev->dev, "%s: check_ready ERROR", __func__);
483 dev_warn(&pdev->dev, "%s: check_write_ready timeout", __func__);
487 void usb_asmedia_modifyflowcontrol(struct pci_dev *pdev)
489 if (usb_asmedia_wait_write(pdev) != 0)
493 pci_write_config_dword(pdev, ASMT_DATA_WRITE0_REG, ASMT_WRITEREG_CMD);
494 pci_write_config_dword(pdev, ASMT_DATA_WRITE1_REG, ASMT_FLOWCTL_ADDR);
495 pci_write_config_byte(pdev, ASMT_CONTROL_REG, ASMT_CONTROL_WRITE_BIT);
497 if (usb_asmedia_wait_write(pdev) != 0)
501 pci_write_config_dword(pdev, ASMT_DATA_WRITE0_REG, ASMT_FLOWCTL_DATA);
502 pci_write_config_dword(pdev, ASMT_DATA_WRITE1_REG, ASMT_PSEUDO_DATA);
503 pci_write_config_byte(pdev, ASMT_CONTROL_REG, ASMT_CONTROL_WRITE_BIT);
553 struct pci_dev *pdev;
556 pdev = to_pci_dev(device);
557 pci_write_config_word(pdev, PT_ADDR_INDX, PT_SIG_1_ADDR);
559 pci_read_config_byte(pdev, PT_READ_INDX, &value);
563 pci_write_config_word(pdev, PT_ADDR_INDX, PT_SIG_2_ADDR);
565 pci_read_config_byte(pdev, PT_READ_INDX, &value);
569 pci_write_config_word(pdev, PT_ADDR_INDX, PT_SIG_3_ADDR);
571 pci_read_config_byte(pdev, PT_READ_INDX, &value);
575 pci_write_config_word(pdev, PT_ADDR_INDX, PT_SIG_4_ADDR);
577 pci_read_config_byte(pdev, PT_READ_INDX, &value);
582 switch (pdev->device) {
629 pci_write_config_word(pdev, PT_ADDR_INDX, reg);
630 pci_read_config_byte(pdev, PT_READ_INDX, &value);
640 void uhci_reset_hc(struct pci_dev *pdev, unsigned long base)
645 pci_write_config_word(pdev, UHCI_USBLEGSUP, UHCI_USBLEGSUP_RWC);
656 dev_warn(&pdev->dev, "HCRESET not completed yet!\n");
672 int uhci_check_and_reset_hc(struct pci_dev *pdev, unsigned long base)
687 pci_read_config_word(pdev, UHCI_USBLEGSUP, &legsup);
689 dev_dbg(&pdev->dev, "%s: legsup = 0x%04x\n",
697 dev_dbg(&pdev->dev, "%s: cmd = 0x%04x\n",
704 dev_dbg(&pdev->dev, "%s: intr = 0x%04x\n",
711 dev_dbg(&pdev->dev, "Performing full reset\n");
712 uhci_reset_hc(pdev, base);
717 static inline int io_type_enabled(struct pci_dev *pdev, unsigned int mask)
720 return !pci_read_config_word(pdev, PCI_COMMAND, &cmd) && (cmd & mask);
726 static void quirk_usb_handoff_uhci(struct pci_dev *pdev)
731 if (!pio_enabled(pdev))
735 if ((pci_resource_flags(pdev, i) & IORESOURCE_IO)) {
736 base = pci_resource_start(pdev, i);
741 uhci_check_and_reset_hc(pdev, base);
744 static int mmio_resource_enabled(struct pci_dev *pdev, int idx)
746 return pci_resource_start(pdev, idx) && mmio_enabled(pdev);
749 static void quirk_usb_handoff_ohci(struct pci_dev *pdev)
757 if (!mmio_resource_enabled(pdev, 0))
760 base = pci_ioremap_bar(pdev, 0);
768 if (pdev->vendor == PCI_VENDOR_ID_AL && pdev->device == 0x5237)
789 dev_warn(&pdev->dev,
855 static void ehci_bios_handoff(struct pci_dev *pdev,
867 if (pdev->vendor == 0x8086 && (pdev->device == 0x283a ||
868 pdev->device == 0x27cc)) {
874 dev_dbg(&pdev->dev, "EHCI: BIOS handoff\n");
885 pci_read_config_dword(pdev, offset + EHCI_USBLEGCTLSTS, &val);
886 pci_write_config_dword(pdev, offset + EHCI_USBLEGCTLSTS,
894 pci_write_config_byte(pdev, offset + 3, 1);
904 pci_read_config_dword(pdev, offset, &cap);
913 dev_warn(&pdev->dev,
916 pci_write_config_byte(pdev, offset + 2, 0);
920 pci_write_config_dword(pdev, offset + EHCI_USBLEGCTLSTS, 0);
929 static void quirk_usb_disable_ehci(struct pci_dev *pdev)
936 if (!mmio_resource_enabled(pdev, 0))
939 base = pci_ioremap_bar(pdev, 0);
951 if (pdev->vendor == PCI_VENDOR_ID_LOONGSON &&
952 pdev->device == PCI_DEVICE_ID_LOONGSON_EHCI)
957 pci_read_config_dword(pdev, offset, &cap);
961 ehci_bios_handoff(pdev, op_reg_base, cap, offset);
967 dev_warn(&pdev->dev,
974 dev_printk(KERN_DEBUG, &pdev->dev, "EHCI: capability loop?\n");
1143 static void quirk_usb_handoff_xhci(struct pci_dev *pdev)
1150 int len = pci_resource_len(pdev, 0);
1152 if (!mmio_resource_enabled(pdev, 0))
1155 base = ioremap(pci_resource_start(pdev, 0), len);
1170 dev_warn(&pdev->dev, "xHCI controller failing to respond");
1176 if ((pdev->vendor == PCI_VENDOR_ID_TI && pdev->device == 0x8241) ||
1177 (pdev->vendor == PCI_VENDOR_ID_RENESAS
1178 && pdev->device == 0x0014)) {
1193 dev_warn(&pdev->dev,
1209 if (pdev->vendor == PCI_VENDOR_ID_INTEL)
1210 usb_enable_intel_xhci_ports(pdev);
1222 dev_warn(&pdev->dev,
1237 dev_warn(&pdev->dev,
1246 static void quirk_usb_early_handoff(struct pci_dev *pdev)
1254 if (pdev->vendor == 0x184e) /* vendor Netlogic */
1261 if (pdev->vendor == PCI_VENDOR_ID_VIA && pdev->device == 0x3483) {
1262 parent = of_get_parent(pdev->bus->dev.of_node);
1269 if (pdev->class != PCI_CLASS_SERIAL_USB_UHCI &&
1270 pdev->class != PCI_CLASS_SERIAL_USB_OHCI &&
1271 pdev->class != PCI_CLASS_SERIAL_USB_EHCI &&
1272 pdev->class != PCI_CLASS_SERIAL_USB_XHCI)
1275 if (pci_enable_device(pdev) < 0) {
1276 dev_warn(&pdev->dev,
1280 if (pdev->class == PCI_CLASS_SERIAL_USB_UHCI)
1281 quirk_usb_handoff_uhci(pdev);
1282 else if (pdev->class == PCI_CLASS_SERIAL_USB_OHCI)
1283 quirk_usb_handoff_ohci(pdev);
1284 else if (pdev->class == PCI_CLASS_SERIAL_USB_EHCI)
1285 quirk_usb_disable_ehci(pdev);
1286 else if (pdev->class == PCI_CLASS_SERIAL_USB_XHCI)
1287 quirk_usb_handoff_xhci(pdev);
1288 pci_disable_device(pdev);