Lines Matching +full:pci +full:- +full:dev

1 // SPDX-License-Identifier: GPL-2.0+
3 * AMD RPL ACP PCI Driver
8 #include <linux/pci.h>
40 return -ETIMEDOUT; in rpl_power_on()
64 return -ETIMEDOUT; in rpl_reset()
103 static int snd_rpl_probe(struct pci_dev *pci, in snd_rpl_probe() argument
111 switch (pci->revision) { in snd_rpl_probe()
115 dev_dbg(&pci->dev, "acp6x pci device not found\n"); in snd_rpl_probe()
116 return -ENODEV; in snd_rpl_probe()
118 if (pci_enable_device(pci)) { in snd_rpl_probe()
119 dev_err(&pci->dev, "pci_enable_device failed\n"); in snd_rpl_probe()
120 return -ENODEV; in snd_rpl_probe()
123 ret = pci_request_regions(pci, "AMD ACP6x audio"); in snd_rpl_probe()
125 dev_err(&pci->dev, "pci_request_regions failed\n"); in snd_rpl_probe()
129 adata = devm_kzalloc(&pci->dev, sizeof(struct rpl_dev_data), in snd_rpl_probe()
132 ret = -ENOMEM; in snd_rpl_probe()
136 addr = pci_resource_start(pci, 0); in snd_rpl_probe()
137 adata->acp6x_base = devm_ioremap(&pci->dev, addr, in snd_rpl_probe()
138 pci_resource_len(pci, 0)); in snd_rpl_probe()
139 if (!adata->acp6x_base) { in snd_rpl_probe()
140 ret = -ENOMEM; in snd_rpl_probe()
143 pci_set_master(pci); in snd_rpl_probe()
144 pci_set_drvdata(pci, adata); in snd_rpl_probe()
145 ret = rpl_init(adata->acp6x_base); in snd_rpl_probe()
148 pm_runtime_set_autosuspend_delay(&pci->dev, ACP_SUSPEND_DELAY_MS); in snd_rpl_probe()
149 pm_runtime_use_autosuspend(&pci->dev); in snd_rpl_probe()
150 pm_runtime_put_noidle(&pci->dev); in snd_rpl_probe()
151 pm_runtime_allow(&pci->dev); in snd_rpl_probe()
155 pci_release_regions(pci); in snd_rpl_probe()
157 pci_disable_device(pci); in snd_rpl_probe()
162 static int __maybe_unused snd_rpl_suspend(struct device *dev) in snd_rpl_suspend() argument
167 adata = dev_get_drvdata(dev); in snd_rpl_suspend()
168 ret = rpl_deinit(adata->acp6x_base); in snd_rpl_suspend()
170 dev_err(dev, "ACP de-init failed\n"); in snd_rpl_suspend()
174 static int __maybe_unused snd_rpl_resume(struct device *dev) in snd_rpl_resume() argument
179 adata = dev_get_drvdata(dev); in snd_rpl_resume()
180 ret = rpl_init(adata->acp6x_base); in snd_rpl_resume()
182 dev_err(dev, "ACP init failed\n"); in snd_rpl_resume()
191 static void snd_rpl_remove(struct pci_dev *pci) in snd_rpl_remove() argument
196 adata = pci_get_drvdata(pci); in snd_rpl_remove()
197 ret = rpl_deinit(adata->acp6x_base); in snd_rpl_remove()
199 dev_err(&pci->dev, "ACP de-init failed\n"); in snd_rpl_remove()
200 pm_runtime_forbid(&pci->dev); in snd_rpl_remove()
201 pm_runtime_get_noresume(&pci->dev); in snd_rpl_remove()
202 pci_release_regions(pci); in snd_rpl_remove()
203 pci_disable_device(pci); in snd_rpl_remove()
212 MODULE_DEVICE_TABLE(pci, snd_rpl_ids);
226 MODULE_DESCRIPTION("AMD ACP RPL PCI driver");