sound/soc/intel/catpt/device.c
Source file repositories/reference/linux-study-clean/sound/soc/intel/catpt/device.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/intel/catpt/device.c- Extension
.c- Size
- 9961 bytes
- Lines
- 404
- Domain
- Driver Families
- Bucket
- sound/soc
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/acpi.hlinux/dma-mapping.hlinux/interrupt.hlinux/module.hlinux/pci.hlinux/platform_device.hlinux/pm_runtime.hsound/intel-dsp-config.hsound/soc.hsound/soc-acpi.hcore.hregisters.h
Detected Declarations
function catpt_do_suspendfunction catpt_suspendfunction catpt_resumefunction catpt_runtime_suspendfunction catpt_runtime_resumefunction board_pdev_unregisterfunction catpt_register_boardfunction catpt_probe_componentsfunction catpt_dev_initfunction catpt_acpi_probefunction catpt_acpi_remove
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
//
// Copyright(c) 2020 Intel Corporation
//
// Author: Cezary Rojewski <cezary.rojewski@intel.com>
//
// Special thanks to:
// Marcin Barlik <marcin.barlik@intel.com>
// Piotr Papierkowski <piotr.papierkowski@intel.com>
//
// for sharing LPT-LP and WTP-LP AudioDSP architecture expertise and
// helping backtrack its historical background
//
#include <linux/acpi.h>
#include <linux/dma-mapping.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <sound/intel-dsp-config.h>
#include <sound/soc.h>
#include <sound/soc-acpi.h>
#include "core.h"
#include "registers.h"
static int catpt_do_suspend(struct device *dev)
{
struct catpt_dev *cdev = dev_get_drvdata(dev);
struct dma_chan *chan;
int ret;
chan = catpt_dma_request_config_chan(cdev);
if (IS_ERR(chan))
return PTR_ERR(chan);
memset(&cdev->dx_ctx, 0, sizeof(cdev->dx_ctx));
ret = catpt_ipc_enter_dxstate(cdev, CATPT_DX_STATE_D3, &cdev->dx_ctx);
if (ret) {
ret = CATPT_IPC_RET(ret);
goto release_dma_chan;
}
ret = catpt_dsp_stall(cdev, true);
if (ret)
goto release_dma_chan;
ret = catpt_store_memdumps(cdev, chan);
if (ret) {
dev_err(cdev->dev, "store memdumps failed: %d\n", ret);
goto release_dma_chan;
}
ret = catpt_store_module_states(cdev, chan);
if (ret) {
dev_err(cdev->dev, "store module states failed: %d\n", ret);
goto release_dma_chan;
}
ret = catpt_store_streams_context(cdev, chan);
if (ret)
dev_err(cdev->dev, "store streams ctx failed: %d\n", ret);
release_dma_chan:
dma_release_channel(chan);
if (ret)
return ret;
return catpt_dsp_power_down(cdev);
}
/* Do not block the system from suspending, recover on resume() if needed. */
static int catpt_suspend(struct device *dev)
{
catpt_do_suspend(dev);
return 0;
}
static int catpt_resume(struct device *dev)
{
struct catpt_dev *cdev = dev_get_drvdata(dev);
int ret, i;
ret = catpt_dsp_power_up(cdev);
if (ret)
return ret;
if (!try_module_get(dev->driver->owner)) {
dev_info(dev, "module unloading, skipping fw boot\n");
return 0;
Annotation
- Immediate include surface: `linux/acpi.h`, `linux/dma-mapping.h`, `linux/interrupt.h`, `linux/module.h`, `linux/pci.h`, `linux/platform_device.h`, `linux/pm_runtime.h`, `sound/intel-dsp-config.h`.
- Detected declarations: `function catpt_do_suspend`, `function catpt_suspend`, `function catpt_resume`, `function catpt_runtime_suspend`, `function catpt_runtime_resume`, `function board_pdev_unregister`, `function catpt_register_board`, `function catpt_probe_components`, `function catpt_dev_init`, `function catpt_acpi_probe`.
- Atlas domain: Driver Families / sound/soc.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.