sound/pci/ca0106/ca0106_mixer.c
Source file repositories/reference/linux-study-clean/sound/pci/ca0106/ca0106_mixer.c
File Facts
- System
- Linux kernel
- Corpus path
sound/pci/ca0106/ca0106_mixer.c- Extension
.c- Size
- 26716 bytes
- Lines
- 903
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/delay.hlinux/init.hlinux/interrupt.hlinux/moduleparam.hsound/core.hsound/initval.hsound/pcm.hsound/ac97_codec.hsound/info.hsound/tlv.hlinux/io.hca0106.h
Detected Declarations
struct ca0106_vol_tblfunction Copyrightfunction ca0106_set_capture_sourcefunction ca0106_set_i2c_capture_sourcefunction ca0106_set_capture_mic_line_infunction ca0106_set_spdif_bitsfunction snd_ca0106_shared_spdif_getfunction snd_ca0106_shared_spdif_putfunction snd_ca0106_capture_source_infofunction snd_ca0106_capture_source_getfunction snd_ca0106_capture_source_putfunction snd_ca0106_i2c_capture_source_infofunction snd_ca0106_i2c_capture_source_getfunction snd_ca0106_i2c_capture_source_putfunction snd_ca0106_capture_line_in_side_out_infofunction snd_ca0106_capture_mic_line_in_infofunction snd_ca0106_capture_mic_line_in_getfunction snd_ca0106_capture_mic_line_in_putfunction snd_ca0106_spdif_infofunction decode_spdif_bitsfunction snd_ca0106_spdif_get_defaultfunction snd_ca0106_spdif_get_streamfunction snd_ca0106_spdif_get_maskfunction encode_spdif_bitsfunction snd_ca0106_spdif_put_defaultfunction snd_ca0106_spdif_put_streamfunction snd_ca0106_volume_infofunction snd_ca0106_volume_getfunction snd_ca0106_volume_putfunction snd_ca0106_i2c_volume_infofunction snd_ca0106_i2c_volume_getfunction snd_ca0106_i2c_volume_putfunction spi_mute_getfunction spi_mute_putfunction snd_ca0106_volume_spi_dac_ctlfunction remove_ctlfunction rename_ctlfunction snd_ca0106_mixerfunction snd_ca0106_mixer_suspendfunction snd_ca0106_mixer_resume
Annotated Snippet
struct ca0106_vol_tbl {
unsigned int channel_id;
unsigned int reg;
};
static const struct ca0106_vol_tbl saved_volumes[NUM_SAVED_VOLUMES] = {
{ CONTROL_FRONT_CHANNEL, PLAYBACK_VOLUME2 },
{ CONTROL_REAR_CHANNEL, PLAYBACK_VOLUME2 },
{ CONTROL_CENTER_LFE_CHANNEL, PLAYBACK_VOLUME2 },
{ CONTROL_UNKNOWN_CHANNEL, PLAYBACK_VOLUME2 },
{ CONTROL_FRONT_CHANNEL, PLAYBACK_VOLUME1 },
{ CONTROL_REAR_CHANNEL, PLAYBACK_VOLUME1 },
{ CONTROL_CENTER_LFE_CHANNEL, PLAYBACK_VOLUME1 },
{ CONTROL_UNKNOWN_CHANNEL, PLAYBACK_VOLUME1 },
{ 1, CAPTURE_CONTROL },
};
void snd_ca0106_mixer_suspend(struct snd_ca0106 *chip)
{
int i;
/* save volumes */
for (i = 0; i < NUM_SAVED_VOLUMES; i++)
chip->saved_vol[i] =
snd_ca0106_ptr_read(chip, saved_volumes[i].reg,
saved_volumes[i].channel_id);
}
void snd_ca0106_mixer_resume(struct snd_ca0106 *chip)
{
int i;
for (i = 0; i < NUM_SAVED_VOLUMES; i++)
snd_ca0106_ptr_write(chip, saved_volumes[i].reg,
saved_volumes[i].channel_id,
chip->saved_vol[i]);
ca0106_spdif_enable(chip);
ca0106_set_capture_source(chip);
ca0106_set_i2c_capture_source(chip, chip->i2c_capture_source, 1);
for (i = 0; i < 4; i++)
ca0106_set_spdif_bits(chip, i);
if (chip->details->i2c_adc)
ca0106_set_capture_mic_line_in(chip);
}
#endif /* CONFIG_PM_SLEEP */
Annotation
- Immediate include surface: `linux/delay.h`, `linux/init.h`, `linux/interrupt.h`, `linux/moduleparam.h`, `sound/core.h`, `sound/initval.h`, `sound/pcm.h`, `sound/ac97_codec.h`.
- Detected declarations: `struct ca0106_vol_tbl`, `function Copyright`, `function ca0106_set_capture_source`, `function ca0106_set_i2c_capture_source`, `function ca0106_set_capture_mic_line_in`, `function ca0106_set_spdif_bits`, `function snd_ca0106_shared_spdif_get`, `function snd_ca0106_shared_spdif_put`, `function snd_ca0106_capture_source_info`, `function snd_ca0106_capture_source_get`.
- 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.