sound/soc/codecs/sigmadsp.c
Source file repositories/reference/linux-study-clean/sound/soc/codecs/sigmadsp.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/codecs/sigmadsp.c- Extension
.c- Size
- 19812 bytes
- Lines
- 809
- 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/crc32.hlinux/firmware.hlinux/kernel.hlinux/i2c.hlinux/regmap.hlinux/module.hlinux/slab.hsound/control.hsound/soc.hsigmadsp.h
Detected Declarations
struct sigmadsp_controlstruct sigmadsp_datastruct sigma_fw_chunkstruct sigma_fw_chunk_datastruct sigma_fw_chunk_controlstruct sigma_fw_chunk_sampleratestruct sigma_firmware_headerstruct sigma_actionfunction sigmadsp_writefunction sigmadsp_readfunction sigmadsp_ctrl_infofunction sigmadsp_ctrl_writefunction sigmadsp_ctrl_putfunction sigmadsp_ctrl_getfunction sigmadsp_control_freefunction sigma_fw_validate_control_namefunction sigma_fw_load_controlfunction sigma_fw_load_datafunction sigma_fw_load_sampleratesfunction sigmadsp_fw_load_v2function sigma_action_lenfunction sigma_action_sizefunction process_sigma_actionfunction sigmadsp_fw_load_v1function sigmadsp_firmware_releasefunction list_for_each_entry_safefunction devm_sigmadsp_releasefunction sigmadsp_firmware_loadfunction sigmadsp_initfunction devm_sigmadsp_initfunction sigmadsp_rate_to_indexfunction sigmadsp_get_samplerate_maskfunction sigmadsp_samplerate_validfunction sigmadsp_alloc_controlfunction sigmadsp_activate_ctrlfunction sigmadsp_attachfunction list_for_each_entryfunction sigmadsp_setupfunction list_for_each_entryfunction sigmadsp_resetfunction sigmadsp_restrict_paramsexport devm_sigmadsp_initexport sigmadsp_attachexport sigmadsp_setupexport sigmadsp_resetexport sigmadsp_restrict_params
Annotated Snippet
struct sigmadsp_control {
struct list_head head;
uint32_t samplerates;
unsigned int addr;
unsigned int num_bytes;
const char *name;
struct snd_kcontrol *kcontrol;
bool is_readback;
bool cached;
u8 cache[] __counted_by(num_bytes);
};
struct sigmadsp_data {
struct list_head head;
uint32_t samplerates;
unsigned int addr;
unsigned int length;
uint8_t data[] __counted_by(length);
};
struct sigma_fw_chunk {
__le32 length;
__le32 tag;
__le32 samplerates;
} __packed;
struct sigma_fw_chunk_data {
struct sigma_fw_chunk chunk;
__le16 addr;
uint8_t data[];
} __packed;
struct sigma_fw_chunk_control {
struct sigma_fw_chunk chunk;
__le16 type;
__le16 addr;
__le16 num_bytes;
const char name[];
} __packed;
struct sigma_fw_chunk_samplerate {
struct sigma_fw_chunk chunk;
__le32 samplerates[];
} __packed;
struct sigma_firmware_header {
unsigned char magic[7];
u8 version;
__le32 crc;
} __packed;
enum {
SIGMA_ACTION_WRITEXBYTES = 0,
SIGMA_ACTION_WRITESINGLE,
SIGMA_ACTION_WRITESAFELOAD,
SIGMA_ACTION_END,
};
struct sigma_action {
u8 instr;
u8 len_hi;
__le16 len;
__be16 addr;
unsigned char payload[];
} __packed;
static int sigmadsp_write(struct sigmadsp *sigmadsp, unsigned int addr,
const uint8_t data[], size_t len)
{
return sigmadsp->write(sigmadsp->control_data, addr, data, len);
}
static int sigmadsp_read(struct sigmadsp *sigmadsp, unsigned int addr,
uint8_t data[], size_t len)
{
return sigmadsp->read(sigmadsp->control_data, addr, data, len);
}
static int sigmadsp_ctrl_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *info)
{
struct sigmadsp_control *ctrl = (void *)kcontrol->private_value;
info->type = SNDRV_CTL_ELEM_TYPE_BYTES;
info->count = ctrl->num_bytes;
return 0;
}
static int sigmadsp_ctrl_write(struct sigmadsp *sigmadsp,
Annotation
- Immediate include surface: `linux/crc32.h`, `linux/firmware.h`, `linux/kernel.h`, `linux/i2c.h`, `linux/regmap.h`, `linux/module.h`, `linux/slab.h`, `sound/control.h`.
- Detected declarations: `struct sigmadsp_control`, `struct sigmadsp_data`, `struct sigma_fw_chunk`, `struct sigma_fw_chunk_data`, `struct sigma_fw_chunk_control`, `struct sigma_fw_chunk_samplerate`, `struct sigma_firmware_header`, `struct sigma_action`, `function sigmadsp_write`, `function sigmadsp_read`.
- 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.