sound/soc/amd/ps/ps-common.c
Source file repositories/reference/linux-study-clean/sound/soc/amd/ps/ps-common.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/amd/ps/ps-common.c- Extension
.c- Size
- 12622 bytes
- Lines
- 494
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/bitops.hlinux/delay.hlinux/export.hlinux/io.hlinux/iopoll.hlinux/pci.hlinux/platform_device.hlinux/pm_runtime.hsound/pcm_params.hacp63.h
Detected Declarations
function acp63_power_onfunction acp63_resetfunction acp63_enable_interruptsfunction acp63_disable_interruptsfunction acp63_initfunction acp63_deinitfunction acp63_get_configfunction check_acp_sdw_enable_statusfunction handle_acp63_sdw_pme_eventfunction snd_acp63_suspendfunction snd_acp63_runtime_resumefunction snd_acp63_resumefunction acp63_sdw_dma_irq_threadfunction acp63_hw_init_opsfunction acp70_power_onfunction acp70_resetfunction acp70_enable_sdw_host_wake_interruptsfunction acp70_enable_interruptsfunction acp70_disable_interruptsfunction acp70_initfunction acp70_deinitfunction acp70_get_configfunction acp70_sdw_dma_irq_threadfunction snd_acp70_suspendfunction snd_acp70_runtime_resumefunction snd_acp70_resumefunction acp70_hw_init_ops
Annotated Snippet
if (adata->sdw_en_stat) {
writel(1, adata->acp63_base + ACP_ZSC_DSP_CTRL);
return 0;
}
}
ret = acp_hw_deinit(adata, dev);
if (ret)
dev_err(dev, "ACP de-init failed\n");
return ret;
}
static int __maybe_unused snd_acp63_runtime_resume(struct device *dev)
{
struct acp63_dev_data *adata;
int ret;
adata = dev_get_drvdata(dev);
if (adata->sdw_en_stat) {
writel(0, adata->acp63_base + ACP_ZSC_DSP_CTRL);
return 0;
}
ret = acp_hw_init(adata, dev);
if (ret) {
dev_err(dev, "ACP init failed\n");
return ret;
}
if (!adata->sdw_en_stat)
handle_acp63_sdw_pme_event(adata);
return 0;
}
static int __maybe_unused snd_acp63_resume(struct device *dev)
{
struct acp63_dev_data *adata;
u32 acp_sw_pad_keeper_en;
int ret;
adata = dev_get_drvdata(dev);
if (adata->sdw_en_stat) {
writel(0, adata->acp63_base + ACP_ZSC_DSP_CTRL);
return 0;
}
ret = acp_hw_init(adata, dev);
if (ret)
dev_err(dev, "ACP init failed\n");
acp_sw_pad_keeper_en = readl(adata->acp63_base + ACP_SW0_PAD_KEEPER_EN);
dev_dbg(dev, "ACP_SW0_PAD_KEEPER_EN:0x%x\n", acp_sw_pad_keeper_en);
if (!acp_sw_pad_keeper_en) {
writel(adata->acp_sw_pad_keeper_en, adata->acp63_base + ACP_SW0_PAD_KEEPER_EN);
writel(adata->acp_pad_pulldown_ctrl, adata->acp63_base + ACP_PAD_PULLDOWN_CTRL);
}
return ret;
}
static void acp63_sdw_dma_irq_thread(struct acp63_dev_data *adata)
{
struct sdw_dma_dev_data *sdw_data;
u32 stream_id;
sdw_data = dev_get_drvdata(&adata->sdw_dma_dev->dev);
for (stream_id = 0; stream_id < ACP63_SDW0_DMA_MAX_STREAMS; stream_id++) {
if (adata->acp63_sdw0_dma_intr_stat[stream_id]) {
if (sdw_data->acp63_sdw0_dma_stream[stream_id])
snd_pcm_period_elapsed(sdw_data->acp63_sdw0_dma_stream[stream_id]);
adata->acp63_sdw0_dma_intr_stat[stream_id] = 0;
}
}
for (stream_id = 0; stream_id < ACP63_SDW1_DMA_MAX_STREAMS; stream_id++) {
if (adata->acp63_sdw1_dma_intr_stat[stream_id]) {
if (sdw_data->acp63_sdw1_dma_stream[stream_id])
snd_pcm_period_elapsed(sdw_data->acp63_sdw1_dma_stream[stream_id]);
adata->acp63_sdw1_dma_intr_stat[stream_id] = 0;
}
}
}
void acp63_hw_init_ops(struct acp_hw_ops *hw_ops)
{
hw_ops->acp_init = acp63_init;
hw_ops->acp_deinit = acp63_deinit;
hw_ops->acp_get_config = acp63_get_config;
hw_ops->acp_sdw_dma_irq_thread = acp63_sdw_dma_irq_thread;
hw_ops->acp_suspend = snd_acp63_suspend;
hw_ops->acp_resume = snd_acp63_resume;
hw_ops->acp_suspend_runtime = snd_acp63_suspend;
Annotation
- Immediate include surface: `linux/bitops.h`, `linux/delay.h`, `linux/export.h`, `linux/io.h`, `linux/iopoll.h`, `linux/pci.h`, `linux/platform_device.h`, `linux/pm_runtime.h`.
- Detected declarations: `function acp63_power_on`, `function acp63_reset`, `function acp63_enable_interrupts`, `function acp63_disable_interrupts`, `function acp63_init`, `function acp63_deinit`, `function acp63_get_config`, `function check_acp_sdw_enable_status`, `function handle_acp63_sdw_pme_event`, `function snd_acp63_suspend`.
- 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.