Lines Matching refs:pdev

26 	struct pci_dev *pdev;  member
36 static int ath9k_pci_fixup(struct pci_dev *pdev, const u16 *cal_data, in ath9k_pci_fixup() argument
52 dev_err(&pdev->dev, "eeprom has an invalid size.\n"); in ath9k_pci_fixup()
58 dev_err(&pdev->dev, "invalid calibration data\n"); in ath9k_pci_fixup()
62 dev_dbg(&pdev->dev, "calibration data needs swapping\n"); in ath9k_pci_fixup()
66 dev_info(&pdev->dev, "fixup device configuration\n"); in ath9k_pci_fixup()
68 mem = pcim_iomap(pdev, 0, 0); in ath9k_pci_fixup()
70 dev_err(&pdev->dev, "ioremap error\n"); in ath9k_pci_fixup()
74 pci_read_config_dword(pdev, PCI_BASE_ADDRESS_0, &bar0); in ath9k_pci_fixup()
75 pci_write_config_dword(pdev, PCI_BASE_ADDRESS_0, in ath9k_pci_fixup()
76 pci_resource_start(pdev, 0)); in ath9k_pci_fixup()
77 pci_read_config_word(pdev, PCI_COMMAND, &cmd); in ath9k_pci_fixup()
79 pci_write_config_word(pdev, PCI_COMMAND, cmd); in ath9k_pci_fixup()
101 pci_read_config_word(pdev, PCI_COMMAND, &cmd); in ath9k_pci_fixup()
103 pci_write_config_word(pdev, PCI_COMMAND, cmd); in ath9k_pci_fixup()
105 pci_write_config_dword(pdev, PCI_BASE_ADDRESS_0, bar0); in ath9k_pci_fixup()
106 pcim_iounmap(pdev, mem); in ath9k_pci_fixup()
108 pci_disable_device(pdev); in ath9k_pci_fixup()
113 static void owl_rescan(struct pci_dev *pdev) in owl_rescan() argument
115 struct pci_bus *bus = pdev->bus; in owl_rescan()
118 pci_stop_and_remove_bus_device(pdev); in owl_rescan()
133 ath9k_pci_fixup(ctx->pdev, (const u16 *)fw->data, fw->size); in owl_fw_cb()
134 owl_rescan(ctx->pdev); in owl_fw_cb()
136 dev_err(&ctx->pdev->dev, "no eeprom data received.\n"); in owl_fw_cb()
141 static const char *owl_get_eeprom_name(struct pci_dev *pdev) in owl_get_eeprom_name() argument
143 struct device *dev = &pdev->dev; in owl_get_eeprom_name()
169 ath9k_pci_fixup(ctx->pdev, buf, len); in owl_nvmem_work()
171 owl_rescan(ctx->pdev); in owl_nvmem_work()
173 dev_err(&ctx->pdev->dev, "no nvmem data received.\n"); in owl_nvmem_work()
181 ctx->cell = devm_nvmem_cell_get(&ctx->pdev->dev, "calibration"); in owl_nvmem_probe()
196 static int owl_probe(struct pci_dev *pdev, in owl_probe() argument
203 if (pcim_enable_device(pdev)) in owl_probe()
206 pcim_pin_device(pdev); in owl_probe()
208 ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); in owl_probe()
213 ctx->pdev = pdev; in owl_probe()
215 pci_set_drvdata(pdev, ctx); in owl_probe()
221 eeprom_name = owl_get_eeprom_name(pdev); in owl_probe()
223 dev_err(&pdev->dev, "no eeprom filename found.\n"); in owl_probe()
228 &pdev->dev, GFP_KERNEL, ctx, owl_fw_cb); in owl_probe()
230 dev_err(&pdev->dev, "failed to request caldata (%d).\n", err); in owl_probe()
235 static void owl_remove(struct pci_dev *pdev) in owl_remove() argument
237 struct owl_ctx *ctx = pci_get_drvdata(pdev); in owl_remove()
241 pci_set_drvdata(pdev, NULL); in owl_remove()