sound/soc/intel/atom/sst/sst_pvt.c
Source file repositories/reference/linux-study-clean/sound/soc/intel/atom/sst/sst_pvt.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/intel/atom/sst/sst_pvt.c- Extension
.c- Size
- 9264 bytes
- Lines
- 373
- Domain
- Driver Families
- Bucket
- sound/soc
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/kobject.hlinux/pci.hlinux/fs.hlinux/firmware.hlinux/pm_runtime.hlinux/sched.hlinux/delay.hsound/asound.hsound/core.hsound/pcm.hsound/soc.hsound/compress_driver.hasm/platform_sst_audio.h../sst-mfld-platform.hsst.h
Detected Declarations
function Copyrightfunction sst_shim_readfunction sst_reg_read64function sst_shim_write64function sst_shim_read64function sst_set_fw_state_lockedfunction valuefunction msecs_to_jiffiesfunction sst_create_ipc_msgfunction sst_create_block_and_ipc_msgfunction sst_clean_streamfunction sst_prepare_and_post_msgfunction sst_pm_runtime_putfunction sst_fill_header_mrfldfunction sst_fill_header_dspfunction sst_assign_pvt_idfunction sst_validate_stridfunction get_stream_id_mrfldfunction relocate_imr_addr_mrfldfunction sst_add_to_dispatch_list_and_postexport relocate_imr_addr_mrfld
Annotated Snippet
msecs_to_jiffies(SST_BLOCK_TIMEOUT))) {
/* event wake */
dev_dbg(sst_drv_ctx->dev, "Event wake %x\n",
block->condition);
dev_dbg(sst_drv_ctx->dev, "message ret: %d\n",
block->ret_code);
retval = -block->ret_code;
} else {
block->on = false;
dev_err(sst_drv_ctx->dev,
"Wait timed-out condition:%#x, msg_id:%#x fw_state %#x\n",
block->condition, block->msg_id, sst_drv_ctx->sst_state);
sst_drv_ctx->sst_state = SST_RESET;
retval = -EBUSY;
}
return retval;
}
/*
* sst_create_ipc_msg - create a IPC message
*
* @arg: ipc message
* @large: large or short message
*
* this function allocates structures to send a large or short
* message to the firmware
*/
int sst_create_ipc_msg(struct ipc_post **arg, bool large)
{
struct ipc_post *msg;
msg = kzalloc_obj(*msg, GFP_ATOMIC);
if (!msg)
return -ENOMEM;
if (large) {
msg->mailbox_data = kzalloc(SST_MAILBOX_SIZE, GFP_ATOMIC);
if (!msg->mailbox_data) {
kfree(msg);
return -ENOMEM;
}
} else {
msg->mailbox_data = NULL;
}
msg->is_large = large;
*arg = msg;
return 0;
}
/*
* sst_create_block_and_ipc_msg - Creates IPC message and sst block
* @arg: passed to sst_create_ipc_message API
* @large: large or short message
* @sst_drv_ctx: sst driver context
* @block: return block allocated
* @msg_id: IPC
* @drv_id: stream id or private id
*/
int sst_create_block_and_ipc_msg(struct ipc_post **arg, bool large,
struct intel_sst_drv *sst_drv_ctx, struct sst_block **block,
u32 msg_id, u32 drv_id)
{
int retval;
retval = sst_create_ipc_msg(arg, large);
if (retval)
return retval;
*block = sst_create_block(sst_drv_ctx, msg_id, drv_id);
if (*block == NULL) {
kfree(*arg);
return -ENOMEM;
}
return 0;
}
/*
* sst_clean_stream - clean the stream context
*
* @stream: stream structure
*
* this function resets the stream contexts
* should be called in free
*/
void sst_clean_stream(struct stream_info *stream)
{
stream->status = STREAM_UN_INIT;
stream->prev = STREAM_UN_INIT;
mutex_lock(&stream->lock);
stream->cumm_bytes = 0;
mutex_unlock(&stream->lock);
Annotation
- Immediate include surface: `linux/kobject.h`, `linux/pci.h`, `linux/fs.h`, `linux/firmware.h`, `linux/pm_runtime.h`, `linux/sched.h`, `linux/delay.h`, `sound/asound.h`.
- Detected declarations: `function Copyright`, `function sst_shim_read`, `function sst_reg_read64`, `function sst_shim_write64`, `function sst_shim_read64`, `function sst_set_fw_state_locked`, `function value`, `function msecs_to_jiffies`, `function sst_create_ipc_msg`, `function sst_create_block_and_ipc_msg`.
- Atlas domain: Driver Families / sound/soc.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.