sound/pcmcia/vx/vxp_ops.c
Source file repositories/reference/linux-study-clean/sound/pcmcia/vx/vxp_ops.c
File Facts
- System
- Linux kernel
- Corpus path
sound/pcmcia/vx/vxp_ops.c- Extension
.c- Size
- 14822 bytes
- Lines
- 602
- Domain
- Driver Families
- Bucket
- sound/pcmcia
- 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/device.hlinux/firmware.hlinux/io.hsound/core.hvxpocket.h
Detected Declarations
function vxp_reg_addrfunction vxp_inbfunction vxp_outbfunction vx_check_magicfunction vxp_reset_dspfunction vxp_reset_codecfunction vxp_load_xilinx_binaryfunction vxp_load_dspfunction vxp_test_and_ackfunction vxp_validate_irqfunction vx_setup_pseudo_dmafunction vx_release_pseudo_dmafunction vxp_dma_writefunction vxp_dma_readfunction datafunction vx_set_mic_boostfunction valuefunction vx_set_mic_levelfunction vxp_change_audio_sourcefunction vxp_set_clock_sourcefunction vxp_reset_board
Annotated Snippet
if (boost) {
/* boost: 38 dB */
pchip->regCDSP &= ~P24_CDSP_MIC20_SEL_MASK;
pchip->regCDSP |= P24_CDSP_MIC38_SEL_MASK;
} else {
/* minimum value: 20 dB */
pchip->regCDSP |= P24_CDSP_MIC20_SEL_MASK;
pchip->regCDSP &= ~P24_CDSP_MIC38_SEL_MASK;
}
vx_outb(chip, CDSP, pchip->regCDSP);
}
}
/*
* remap the linear value (0-8) to the actual value (0-15)
*/
static int vx_compute_mic_level(int level)
{
switch (level) {
case 5: level = 6 ; break;
case 6: level = 8 ; break;
case 7: level = 11; break;
case 8: level = 15; break;
default: break ;
}
return level;
}
/*
* vx_set_mic_level - set mic level (on vxpocket only)
* @level: the mic level = 0 - 8 (max)
*/
void vx_set_mic_level(struct vx_core *chip, int level)
{
struct snd_vxpocket *pchip = to_vxpocket(chip);
if (chip->chip_status & VX_STAT_IS_STALE)
return;
guard(mutex)(&chip->lock);
if (pchip->regCDSP & VXP_CDSP_MIC_SEL_MASK) {
level = vx_compute_mic_level(level);
vx_outb(chip, MICRO, level);
}
}
/*
* change the input audio source
*/
static void vxp_change_audio_source(struct vx_core *_chip, int src)
{
struct snd_vxpocket *chip = to_vxpocket(_chip);
switch (src) {
case VX_AUDIO_SRC_DIGITAL:
chip->regCDSP |= VXP_CDSP_DATAIN_SEL_MASK;
vx_outb(chip, CDSP, chip->regCDSP);
break;
case VX_AUDIO_SRC_LINE:
chip->regCDSP &= ~VXP_CDSP_DATAIN_SEL_MASK;
if (_chip->type == VX_TYPE_VXP440)
chip->regCDSP &= ~P24_CDSP_MICS_SEL_MASK;
else
chip->regCDSP &= ~VXP_CDSP_MIC_SEL_MASK;
vx_outb(chip, CDSP, chip->regCDSP);
break;
case VX_AUDIO_SRC_MIC:
chip->regCDSP &= ~VXP_CDSP_DATAIN_SEL_MASK;
/* reset mic levels */
if (_chip->type == VX_TYPE_VXP440) {
chip->regCDSP &= ~P24_CDSP_MICS_SEL_MASK;
if (chip->mic_level)
chip->regCDSP |= P24_CDSP_MIC38_SEL_MASK;
else
chip->regCDSP |= P24_CDSP_MIC20_SEL_MASK;
vx_outb(chip, CDSP, chip->regCDSP);
} else {
chip->regCDSP |= VXP_CDSP_MIC_SEL_MASK;
vx_outb(chip, CDSP, chip->regCDSP);
vx_outb(chip, MICRO, vx_compute_mic_level(chip->mic_level));
}
break;
}
}
/*
* change the clock source
* source = INTERNAL_QUARTZ or UER_SYNC
*/
Annotation
- Immediate include surface: `linux/delay.h`, `linux/device.h`, `linux/firmware.h`, `linux/io.h`, `sound/core.h`, `vxpocket.h`.
- Detected declarations: `function vxp_reg_addr`, `function vxp_inb`, `function vxp_outb`, `function vx_check_magic`, `function vxp_reset_dsp`, `function vxp_reset_codec`, `function vxp_load_xilinx_binary`, `function vxp_load_dsp`, `function vxp_test_and_ack`, `function vxp_validate_irq`.
- Atlas domain: Driver Families / sound/pcmcia.
- 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.