sound/pci/cs46xx/dsp_spos_scb_lib.c
Source file repositories/reference/linux-study-clean/sound/pci/cs46xx/dsp_spos_scb_lib.c
File Facts
- System
- Linux kernel
- Corpus path
sound/pci/cs46xx/dsp_spos_scb_lib.c- Extension
.c- Size
- 47900 bytes
- Lines
- 1750
- Domain
- Driver Families
- Bucket
- sound/pci
- 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/io.hlinux/delay.hlinux/pm.hlinux/init.hlinux/slab.hlinux/mutex.hsound/core.hsound/control.hsound/info.hcs46xx.hcs46xx_lib.hdsp_spos.h
Detected Declarations
struct proc_scb_infofunction remove_symbolfunction cs46xx_dsp_proc_scb_info_readfunction _dsp_unlink_scbfunction _dsp_clear_sample_bufferfunction cs46xx_dsp_remove_scbfunction scoped_guardfunction cs46xx_dsp_proc_free_scb_descfunction cs46xx_dsp_proc_register_scb_descfunction _dsp_create_generic_scbfunction scoped_guardfunction cs46xx_dsp_create_generic_scbfunction cs46xx_dsp_create_timing_master_scbfunction cs46xx_dsp_create_codec_out_scbfunction cs46xx_dsp_create_codec_in_scbfunction cs46xx_dsp_create_pcm_reader_scbfunction cs46xx_dsp_create_src_task_scbfunction cs46xx_dsp_create_filter_scbfunction cs46xx_dsp_create_mix_only_scbfunction cs46xx_dsp_create_mix_to_ostream_scbfunction cs46xx_dsp_create_vari_decimate_scbfunction cs46xx_dsp_create_pcm_serial_input_scbfunction cs46xx_dsp_create_asynch_fg_tx_scbfunction cs46xx_dsp_create_asynch_fg_rx_scbfunction cs46xx_dsp_create_output_snoop_scbfunction cs46xx_dsp_create_spio_write_scbfunction cs46xx_dsp_create_magic_snoop_scbfunction find_next_free_scbfunction cs46xx_dsp_create_pcm_channelfunction Convertedfunction cs46xx_dsp_pcm_channel_set_periodfunction cs46xx_dsp_pcm_ostream_set_periodfunction cs46xx_dsp_destroy_pcm_channelfunction scoped_guardfunction cs46xx_dsp_pcm_unlinkfunction cs46xx_dsp_pcm_linkfunction cs46xx_add_record_sourcefunction cs46xx_src_unlinkfunction cs46xx_src_linkfunction cs46xx_dsp_enable_spdif_outfunction cs46xx_dsp_disable_spdif_outfunction cs46xx_iec958_pre_openfunction cs46xx_iec958_post_close
Annotated Snippet
struct proc_scb_info {
struct dsp_scb_descriptor * scb_desc;
struct snd_cs46xx *chip;
};
static void remove_symbol (struct snd_cs46xx * chip, struct dsp_symbol_entry * symbol)
{
struct dsp_spos_instance * ins = chip->dsp_spos_instance;
int symbol_index = (int)(symbol - ins->symbol_table.symbols);
if (snd_BUG_ON(ins->symbol_table.nsymbols <= 0))
return;
if (snd_BUG_ON(symbol_index < 0 ||
symbol_index >= ins->symbol_table.nsymbols))
return;
ins->symbol_table.symbols[symbol_index].deleted = 1;
if (symbol_index < ins->symbol_table.highest_frag_index) {
ins->symbol_table.highest_frag_index = symbol_index;
}
if (symbol_index == ins->symbol_table.nsymbols - 1)
ins->symbol_table.nsymbols --;
if (ins->symbol_table.highest_frag_index > ins->symbol_table.nsymbols) {
ins->symbol_table.highest_frag_index = ins->symbol_table.nsymbols;
}
}
#ifdef CONFIG_SND_PROC_FS
static void cs46xx_dsp_proc_scb_info_read (struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct proc_scb_info * scb_info = entry->private_data;
struct dsp_scb_descriptor * scb = scb_info->scb_desc;
struct snd_cs46xx *chip = scb_info->chip;
int j,col;
void __iomem *dst = chip->region.idx[1].remap_addr + DSP_PARAMETER_BYTE_OFFSET;
guard(mutex)(&chip->spos_mutex);
snd_iprintf(buffer,"%04x %s:\n",scb->address,scb->scb_name);
for (col = 0,j = 0;j < 0x10; j++,col++) {
if (col == 4) {
snd_iprintf(buffer,"\n");
col = 0;
}
snd_iprintf(buffer,"%08x ",readl(dst + (scb->address + j) * sizeof(u32)));
}
snd_iprintf(buffer,"\n");
if (scb->parent_scb_ptr != NULL) {
snd_iprintf(buffer,"parent [%s:%04x] ",
scb->parent_scb_ptr->scb_name,
scb->parent_scb_ptr->address);
} else snd_iprintf(buffer,"parent [none] ");
snd_iprintf(buffer,"sub_list_ptr [%s:%04x]\nnext_scb_ptr [%s:%04x] task_entry [%s:%04x]\n",
scb->sub_list_ptr->scb_name,
scb->sub_list_ptr->address,
scb->next_scb_ptr->scb_name,
scb->next_scb_ptr->address,
scb->task_entry->symbol_name,
scb->task_entry->address);
snd_iprintf(buffer,"index [%d] ref_count [%d]\n",scb->index,scb->ref_count);
}
#endif
static void _dsp_unlink_scb (struct snd_cs46xx *chip, struct dsp_scb_descriptor * scb)
{
struct dsp_spos_instance * ins = chip->dsp_spos_instance;
if ( scb->parent_scb_ptr ) {
/* unlink parent SCB */
if (snd_BUG_ON(scb->parent_scb_ptr->sub_list_ptr != scb &&
scb->parent_scb_ptr->next_scb_ptr != scb))
return;
if (scb->parent_scb_ptr->sub_list_ptr == scb) {
if (scb->next_scb_ptr == ins->the_null_scb) {
/* last and only node in parent sublist */
scb->parent_scb_ptr->sub_list_ptr = scb->sub_list_ptr;
if (scb->sub_list_ptr != ins->the_null_scb) {
scb->sub_list_ptr->parent_scb_ptr = scb->parent_scb_ptr;
Annotation
- Immediate include surface: `linux/io.h`, `linux/delay.h`, `linux/pm.h`, `linux/init.h`, `linux/slab.h`, `linux/mutex.h`, `sound/core.h`, `sound/control.h`.
- Detected declarations: `struct proc_scb_info`, `function remove_symbol`, `function cs46xx_dsp_proc_scb_info_read`, `function _dsp_unlink_scb`, `function _dsp_clear_sample_buffer`, `function cs46xx_dsp_remove_scb`, `function scoped_guard`, `function cs46xx_dsp_proc_free_scb_desc`, `function cs46xx_dsp_proc_register_scb_desc`, `function _dsp_create_generic_scb`.
- Atlas domain: Driver Families / sound/pci.
- 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.