sound/pci/pcxhr/pcxhr_mix22.c
Source file repositories/reference/linux-study-clean/sound/pci/pcxhr/pcxhr_mix22.c
File Facts
- System
- Linux kernel
- Corpus path
sound/pci/pcxhr/pcxhr_mix22.c- Extension
.c- Size
- 26986 bytes
- Lines
- 826
- 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/io.hlinux/pci.hsound/core.hsound/control.hsound/tlv.hsound/asoundef.hpcxhr.hpcxhr_core.hpcxhr_mix22.h
Detected Declarations
function hr222_config_akmfunction hr222_set_hw_playback_levelfunction hr222_set_hw_capture_levelfunction hr222_sub_initfunction hr222_sub_set_clockfunction hr222_get_external_clockfunction hr222_read_gpiofunction hr222_write_gpofunction hr222_manage_timecodefunction hr222_update_analog_audio_levelfunction hr222_set_audio_sourcefunction hr222_iec958_capture_bytefunction hr222_iec958_update_bytefunction hr222_micro_boostfunction hr222_phantom_powerfunction hr222_mic_vol_infofunction hr222_mic_vol_getfunction hr222_mic_vol_putfunction hr222_mic_boost_infofunction hr222_mic_boost_getfunction hr222_mic_boost_putfunction hr222_phantom_power_getfunction hr222_phantom_power_putfunction hr222_add_mic_controls
Annotated Snippet
if (chip->analog_capture_active) {
level_l = chip->analog_capture_volume[0];
level_r = chip->analog_capture_volume[1];
} else {
level_l = HR222_LINE_CAPTURE_LEVEL_MIN;
level_r = HR222_LINE_CAPTURE_LEVEL_MIN;
}
if (chip->mic_active)
level_mic = chip->mic_volume;
else
level_mic = HR222_MICRO_CAPTURE_LEVEL_MIN;
return hr222_set_hw_capture_level(chip->mgr,
level_l, level_r, level_mic);
} else {
int vol;
if (chip->analog_playback_active[channel])
vol = chip->analog_playback_volume[channel];
else
vol = HR222_LINE_PLAYBACK_LEVEL_MIN;
return hr222_set_hw_playback_level(chip->mgr, channel, vol);
}
}
/*texts[5] = {"Line", "Digital", "Digi+SRC", "Mic", "Line+Mic"}*/
#define SOURCE_LINE 0
#define SOURCE_DIGITAL 1
#define SOURCE_DIGISRC 2
#define SOURCE_MIC 3
#define SOURCE_LINEMIC 4
int hr222_set_audio_source(struct snd_pcxhr *chip)
{
int digital = 0;
/* default analog source */
chip->mgr->xlx_cfg &= ~(PCXHR_CFG_SRC_MASK |
PCXHR_CFG_DATAIN_SEL_MASK |
PCXHR_CFG_DATA_UER1_SEL_MASK);
if (chip->audio_capture_source == SOURCE_DIGISRC) {
chip->mgr->xlx_cfg |= PCXHR_CFG_SRC_MASK;
digital = 1;
} else {
if (chip->audio_capture_source == SOURCE_DIGITAL)
digital = 1;
}
if (digital) {
chip->mgr->xlx_cfg |= PCXHR_CFG_DATAIN_SEL_MASK;
if (chip->mgr->board_has_aes1) {
/* get data from the AES1 plug */
chip->mgr->xlx_cfg |= PCXHR_CFG_DATA_UER1_SEL_MASK;
}
/* chip->mic_active = 0; */
/* chip->analog_capture_active = 0; */
} else {
int update_lvl = 0;
chip->analog_capture_active = 0;
chip->mic_active = 0;
if (chip->audio_capture_source == SOURCE_LINE ||
chip->audio_capture_source == SOURCE_LINEMIC) {
if (chip->analog_capture_active == 0)
update_lvl = 1;
chip->analog_capture_active = 1;
}
if (chip->audio_capture_source == SOURCE_MIC ||
chip->audio_capture_source == SOURCE_LINEMIC) {
if (chip->mic_active == 0)
update_lvl = 1;
chip->mic_active = 1;
}
if (update_lvl) {
/* capture: update all 3 mutes/unmutes with one call */
hr222_update_analog_audio_level(chip, 1, 0);
}
}
/* set the source infos (max 3 bits modified) */
PCXHR_OUTPB(chip->mgr, PCXHR_XLX_CFG, chip->mgr->xlx_cfg);
return 0;
}
int hr222_iec958_capture_byte(struct snd_pcxhr *chip,
int aes_idx, unsigned char *aes_bits)
{
unsigned char idx = (unsigned char)(aes_idx * 8);
unsigned char temp = 0;
unsigned char mask = chip->mgr->board_has_aes1 ?
PCXHR_SUER1_BIT_C_READ_MASK : PCXHR_SUER_BIT_C_READ_MASK;
int i;
for (i = 0; i < 8; i++) {
Annotation
- Immediate include surface: `linux/delay.h`, `linux/io.h`, `linux/pci.h`, `sound/core.h`, `sound/control.h`, `sound/tlv.h`, `sound/asoundef.h`, `pcxhr.h`.
- Detected declarations: `function hr222_config_akm`, `function hr222_set_hw_playback_level`, `function hr222_set_hw_capture_level`, `function hr222_sub_init`, `function hr222_sub_set_clock`, `function hr222_get_external_clock`, `function hr222_read_gpio`, `function hr222_write_gpo`, `function hr222_manage_timecode`, `function hr222_update_analog_audio_level`.
- 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.