Lines Matching full:pci
3 * AMD Pink Sardine ACP PCI Driver
8 #include <linux/pci.h>
142 static int snd_acp62_probe(struct pci_dev *pci, in snd_acp62_probe() argument
156 switch (pci->revision) { in snd_acp62_probe()
160 dev_dbg(&pci->dev, "acp62 pci device not found\n"); in snd_acp62_probe()
163 if (pci_enable_device(pci)) { in snd_acp62_probe()
164 dev_err(&pci->dev, "pci_enable_device failed\n"); in snd_acp62_probe()
168 ret = pci_request_regions(pci, "AMD ACP6.2 audio"); in snd_acp62_probe()
170 dev_err(&pci->dev, "pci_request_regions failed\n"); in snd_acp62_probe()
173 adata = devm_kzalloc(&pci->dev, sizeof(struct acp62_dev_data), in snd_acp62_probe()
180 addr = pci_resource_start(pci, 0); in snd_acp62_probe()
181 adata->acp62_base = devm_ioremap(&pci->dev, addr, in snd_acp62_probe()
182 pci_resource_len(pci, 0)); in snd_acp62_probe()
187 pci_set_master(pci); in snd_acp62_probe()
188 pci_set_drvdata(pci, adata); in snd_acp62_probe()
189 ret = acp62_init(adata->acp62_base, &pci->dev); in snd_acp62_probe()
200 dev_info(&pci->dev, "Audio Mode %d\n", val); in snd_acp62_probe()
205 adev = acpi_find_child_device(ACPI_COMPANION(&pci->dev), 0x02, 0); in snd_acp62_probe()
213 adata->res = devm_kzalloc(&pci->dev, sizeof(struct resource), GFP_KERNEL); in snd_acp62_probe()
228 pdevinfo[0].parent = &pci->dev; in snd_acp62_probe()
234 pdevinfo[1].parent = &pci->dev; in snd_acp62_probe()
238 pdevinfo[2].parent = &pci->dev; in snd_acp62_probe()
245 dev_err(&pci->dev, in snd_acp62_probe()
251 ret = devm_request_irq(&pci->dev, pci->irq, acp62_irq_handler, in snd_acp62_probe()
254 dev_err(&pci->dev, "ACP PCI IRQ request failed\n"); in snd_acp62_probe()
261 pm_runtime_set_autosuspend_delay(&pci->dev, ACP_SUSPEND_DELAY_MS); in snd_acp62_probe()
262 pm_runtime_use_autosuspend(&pci->dev); in snd_acp62_probe()
263 pm_runtime_put_noidle(&pci->dev); in snd_acp62_probe()
264 pm_runtime_allow(&pci->dev); in snd_acp62_probe()
270 if (acp62_deinit(adata->acp62_base, &pci->dev)) in snd_acp62_probe()
271 dev_err(&pci->dev, "ACP de-init failed\n"); in snd_acp62_probe()
273 pci_release_regions(pci); in snd_acp62_probe()
275 pci_disable_device(pci); in snd_acp62_probe()
309 static void snd_acp62_remove(struct pci_dev *pci) in snd_acp62_remove() argument
314 adata = pci_get_drvdata(pci); in snd_acp62_remove()
319 ret = acp62_deinit(adata->acp62_base, &pci->dev); in snd_acp62_remove()
321 dev_err(&pci->dev, "ACP de-init failed\n"); in snd_acp62_remove()
322 pm_runtime_forbid(&pci->dev); in snd_acp62_remove()
323 pm_runtime_get_noresume(&pci->dev); in snd_acp62_remove()
324 pci_release_regions(pci); in snd_acp62_remove()
325 pci_disable_device(pci); in snd_acp62_remove()
334 MODULE_DEVICE_TABLE(pci, snd_acp62_ids);
350 MODULE_DESCRIPTION("AMD ACP Pink Sardine PCI driver");