Lines Matching +full:board +full:- +full:id

1 // SPDX-License-Identifier: GPL-2.0-only
11 // for sharing LPT-LP and WTP-LP AudioDSP architecture expertise and
16 #include <linux/dma-mapping.h>
22 #include <sound/intel-dsp-config.h>
24 #include <sound/soc-acpi.h>
41 memset(&cdev->dx_ctx, 0, sizeof(cdev->dx_ctx)); in catpt_suspend()
42 ret = catpt_ipc_enter_dxstate(cdev, CATPT_DX_STATE_D3, &cdev->dx_ctx); in catpt_suspend()
54 dev_err(cdev->dev, "store memdumps failed: %d\n", ret); in catpt_suspend()
60 dev_err(cdev->dev, "store module states failed: %d\n", ret); in catpt_suspend()
66 dev_err(cdev->dev, "store streams ctx failed: %d\n", ret); in catpt_suspend()
84 if (!try_module_get(dev->driver->owner)) { in catpt_resume()
88 module_put(dev->driver->owner); in catpt_resume()
92 dev_err(cdev->dev, "boot firmware failed: %d\n", ret); in catpt_resume()
98 if (cdev->devfmt[i].iface == UINT_MAX) in catpt_resume()
101 ret = catpt_ipc_set_device_format(cdev, &cdev->devfmt[i]); in catpt_resume()
111 if (!try_module_get(dev->driver->owner)) { in catpt_runtime_suspend()
115 module_put(dev->driver->owner); in catpt_runtime_suspend()
130 /* machine board owned by CATPT is removed with this hook */
138 const struct catpt_spec *spec = cdev->spec; in catpt_register_board()
140 struct platform_device *board; in catpt_register_board() local
142 mach = snd_soc_acpi_find_machine(spec->machines); in catpt_register_board()
144 dev_info(cdev->dev, "no machines present\n"); in catpt_register_board()
148 mach->mach_params.platform = "catpt-platform"; in catpt_register_board()
149 board = platform_device_register_data(NULL, mach->drv_name, in catpt_register_board()
152 if (IS_ERR(board)) { in catpt_register_board()
153 dev_err(cdev->dev, "board register failed\n"); in catpt_register_board()
154 return PTR_ERR(board); in catpt_register_board()
157 return devm_add_action_or_reset(cdev->dev, board_pdev_unregister, in catpt_register_board()
158 board); in catpt_register_board()
171 dev_err(cdev->dev, "DMAC probe failed: %d\n", ret); in catpt_probe_components()
177 dev_err(cdev->dev, "first fw boot failed: %d\n", ret); in catpt_probe_components()
183 dev_err(cdev->dev, "register plat comp failed: %d\n", ret); in catpt_probe_components()
189 dev_err(cdev->dev, "register board failed: %d\n", ret); in catpt_probe_components()
194 pm_runtime_set_active(cdev->dev); in catpt_probe_components()
196 pm_runtime_set_autosuspend_delay(cdev->dev, 2000); in catpt_probe_components()
197 pm_runtime_use_autosuspend(cdev->dev); in catpt_probe_components()
198 pm_runtime_mark_last_busy(cdev->dev); in catpt_probe_components()
199 pm_runtime_enable(cdev->dev); in catpt_probe_components()
203 snd_soc_unregister_component(cdev->dev); in catpt_probe_components()
215 cdev->dev = dev; in catpt_dev_init()
216 cdev->spec = spec; in catpt_dev_init()
217 init_completion(&cdev->fw_ready); in catpt_dev_init()
218 INIT_LIST_HEAD(&cdev->stream_list); in catpt_dev_init()
219 spin_lock_init(&cdev->list_lock); in catpt_dev_init()
220 mutex_init(&cdev->clk_mutex); in catpt_dev_init()
226 cdev->devfmt[CATPT_SSP_IFACE_0].iface = UINT_MAX; in catpt_dev_init()
227 cdev->devfmt[CATPT_SSP_IFACE_1].iface = UINT_MAX; in catpt_dev_init()
229 catpt_ipc_init(&cdev->ipc, dev); in catpt_dev_init()
231 catpt_sram_init(&cdev->dram, spec->host_dram_offset, in catpt_dev_init()
233 catpt_sram_init(&cdev->iram, spec->host_iram_offset, in catpt_dev_init()
241 struct device *dev = &pdev->dev; in catpt_acpi_probe()
242 const struct acpi_device_id *id; in catpt_acpi_probe() local
246 id = acpi_match_device(dev->driver->acpi_match_table, dev); in catpt_acpi_probe()
247 if (!id) in catpt_acpi_probe()
248 return -ENODEV; in catpt_acpi_probe()
250 ret = snd_intel_acpi_dsp_driver_probe(dev, id->id); in catpt_acpi_probe()
253 return -ENODEV; in catpt_acpi_probe()
258 return -ENOMEM; in catpt_acpi_probe()
260 spec = (const struct catpt_spec *)id->driver_data; in catpt_acpi_probe()
264 cdev->lpe_ba = devm_platform_get_and_ioremap_resource(pdev, 0, &res); in catpt_acpi_probe()
265 if (IS_ERR(cdev->lpe_ba)) in catpt_acpi_probe()
266 return PTR_ERR(cdev->lpe_ba); in catpt_acpi_probe()
267 cdev->lpe_base = res->start; in catpt_acpi_probe()
270 cdev->pci_ba = devm_platform_ioremap_resource(pdev, 1); in catpt_acpi_probe()
271 if (IS_ERR(cdev->pci_ba)) in catpt_acpi_probe()
272 return PTR_ERR(cdev->pci_ba); in catpt_acpi_probe()
275 cdev->dxbuf_vaddr = dmam_alloc_coherent(dev, catpt_dram_size(cdev), in catpt_acpi_probe()
276 &cdev->dxbuf_paddr, GFP_KERNEL); in catpt_acpi_probe()
277 if (!cdev->dxbuf_vaddr) in catpt_acpi_probe()
278 return -ENOMEM; in catpt_acpi_probe()
283 cdev->irq = ret; in catpt_acpi_probe()
287 ret = devm_request_threaded_irq(dev, cdev->irq, catpt_dsp_irq_handler, in catpt_acpi_probe()
300 pm_runtime_disable(cdev->dev); in catpt_acpi_remove()
302 snd_soc_unregister_component(cdev->dev); in catpt_acpi_remove()
306 catpt_sram_free(&cdev->iram); in catpt_acpi_remove()
307 catpt_sram_free(&cdev->dram); in catpt_acpi_remove()
312 .id = "INT33CA",
320 .id = "INT33CA",
324 .id = "INT343A",
328 .id = "10EC5650",
329 .drv_name = "bdw-rt5650",
332 .id = "RT5677CE",
333 .drv_name = "bdw-rt5677",