sound/soc/codecs/tas2783-sdw.c
Source file repositories/reference/linux-study-clean/sound/soc/codecs/tas2783-sdw.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/codecs/tas2783-sdw.c- Extension
.c- Size
- 44387 bytes
- Lines
- 1367
- 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.
- 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/unaligned.hlinux/crc32.hlinux/efi.hlinux/err.hlinux/firmware.hlinux/init.hlinux/module.hsound/pcm_params.hlinux/pm.hlinux/pm_runtime.hlinux/regmap.hlinux/wait.hlinux/soundwire/sdw.hlinux/soundwire/sdw_registers.hlinux/soundwire/sdw_type.hlinux/pci.hsound/sdw.hsound/soc.hsound/tlv.hsound/tas2781-tlv.hsound/sdca_function.hsound/sdca_regmap.htas2783.h
Detected Declarations
struct tas_fw_hdrstruct tas_fw_filestruct calibration_datastruct tas2783_prvfunction tas2783_sdca_mbq_sizefunction tas2783_readable_registerfunction tas2783_volatile_registerfunction tas2783_digital_getvolfunction tas2783_digital_putvolfunction tas2783_amp_getvolfunction tas2783_amp_putvolfunction tas2783_validate_calibdatafunction tas2783_set_calib_params_to_devicefunction tas2783_update_calibdatafunction tas_fw_read_hdrfunction tas_fw_get_next_filefunction tas2783_fw_readyfunction tas_clear_latchfunction tas_fu21_eventfunction tas_fu23_eventfunction tas_set_sdw_streamfunction tas_sdw_shutdownfunction tas_sdw_hw_paramsfunction tas_sdw_pcm_hw_freefunction tas_component_probefunction tas_component_removefunction tas_initfunction tas2783_sdca_dev_suspendfunction tas2783_sdca_dev_system_suspendfunction tas2783_sdca_dev_resumefunction tas_generate_fw_namefunction tas_io_initfunction tas_update_statusfunction tas_port_prepfunction tas_removefunction tas_sdw_probefunction tas_sdw_remove
Annotated Snippet
struct tas_fw_hdr {
u32 size;
u32 version_offset;
u32 plt_id;
u32 ppc3_ver;
u32 timestamp;
u8 ddc_name[64];
};
struct tas_fw_file {
u32 vendor_id;
u32 file_id;
u32 version;
u32 length;
u32 dest_addr;
u8 *fw_data;
};
struct calibration_data {
u32 is_valid;
unsigned long read_sz;
u8 data[TAS2783_CALIB_DATA_SZ];
};
struct tas2783_prv {
struct snd_soc_component *component;
struct calibration_data cali_data;
struct sdw_slave *sdw_peripheral;
struct sdca_function_data *sa_func_data;
enum sdw_slave_status status;
/* calibration */
struct mutex calib_lock;
/* pde and firmware download */
struct mutex pde_lock;
struct regmap *regmap;
struct device *dev;
struct class *class;
struct attribute_group *cal_attr_groups;
struct tm tm;
u8 rca_binaryname[64];
u8 dev_name[32];
bool hw_init;
/* wq for firmware download */
wait_queue_head_t fw_wait;
bool fw_dl_task_done;
bool fw_dl_success;
};
static const struct reg_default tas2783_reg_default[] = {
{TAS2783_AMP_LEVEL, 0x28},
{TASDEV_REG_SDW(0, 0, 0x03), 0x28},
{TASDEV_REG_SDW(0, 0, 0x04), 0x21},
{TASDEV_REG_SDW(0, 0, 0x05), 0x41},
{TASDEV_REG_SDW(0, 0, 0x06), 0x00},
{TASDEV_REG_SDW(0, 0, 0x07), 0x20},
{TASDEV_REG_SDW(0, 0, 0x08), 0x09},
{TASDEV_REG_SDW(0, 0, 0x09), 0x02},
{TASDEV_REG_SDW(0, 0, 0x0a), 0x0a},
{TASDEV_REG_SDW(0, 0, 0x0c), 0x10},
{TASDEV_REG_SDW(0, 0, 0x0d), 0x13},
{TASDEV_REG_SDW(0, 0, 0x0e), 0xc2},
{TASDEV_REG_SDW(0, 0, 0x0f), 0x40},
{TASDEV_REG_SDW(0, 0, 0x10), 0x04},
{TASDEV_REG_SDW(0, 0, 0x13), 0x13},
{TASDEV_REG_SDW(0, 0, 0x14), 0x12},
{TASDEV_REG_SDW(0, 0, 0x15), 0x00},
{TASDEV_REG_SDW(0, 0, 0x16), 0x12},
{TASDEV_REG_SDW(0, 0, 0x17), 0x80},
{TAS2783_DVC_LVL, 0x00},
{TASDEV_REG_SDW(0, 0, 0x1b), 0x61},
{TASDEV_REG_SDW(0, 0, 0x1c), 0x36},
{TASDEV_REG_SDW(0, 0, 0x1d), 0x00},
{TASDEV_REG_SDW(0, 0, 0x1f), 0x01},
{TASDEV_REG_SDW(0, 0, 0x20), 0x2e},
{TASDEV_REG_SDW(0, 0, 0x21), 0x00},
{TASDEV_REG_SDW(0, 0, 0x34), 0x06},
{TASDEV_REG_SDW(0, 0, 0x35), 0xbd},
{TASDEV_REG_SDW(0, 0, 0x36), 0xad},
{TASDEV_REG_SDW(0, 0, 0x37), 0xa8},
{TASDEV_REG_SDW(0, 0, 0x38), 0x00},
{TASDEV_REG_SDW(0, 0, 0x3b), 0xfc},
{TASDEV_REG_SDW(0, 0, 0x3d), 0xdd},
{TASDEV_REG_SDW(0, 0, 0x40), 0xf6},
{TASDEV_REG_SDW(0, 0, 0x41), 0x14},
{TASDEV_REG_SDW(0, 0, 0x5c), 0x19},
{TASDEV_REG_SDW(0, 0, 0x5d), 0x80},
{TASDEV_REG_SDW(0, 0, 0x63), 0x48},
{TASDEV_REG_SDW(0, 0, 0x65), 0x08},
{TASDEV_REG_SDW(0, 0, 0x66), 0xb2},
{TASDEV_REG_SDW(0, 0, 0x67), 0x00},
Annotation
- Immediate include surface: `linux/unaligned.h`, `linux/crc32.h`, `linux/efi.h`, `linux/err.h`, `linux/firmware.h`, `linux/init.h`, `linux/module.h`, `sound/pcm_params.h`.
- Detected declarations: `struct tas_fw_hdr`, `struct tas_fw_file`, `struct calibration_data`, `struct tas2783_prv`, `function tas2783_sdca_mbq_size`, `function tas2783_readable_register`, `function tas2783_volatile_register`, `function tas2783_digital_getvol`, `function tas2783_digital_putvol`, `function tas2783_amp_getvol`.
- Atlas domain: Driver Families / sound/soc.
- Implementation status: source 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.