sound/pci/oxygen/oxygen_pcm.c
Source file repositories/reference/linux-study-clean/sound/pci/oxygen/oxygen_pcm.c
File Facts
- System
- Linux kernel
- Corpus path
sound/pci/oxygen/oxygen_pcm.c- Extension
.c- Size
- 22144 bytes
- Lines
- 773
- 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/pci.hsound/control.hsound/core.hsound/pcm.hsound/pcm_params.hoxygen.h
Detected Declarations
function oxygen_substream_channelfunction oxygen_openfunction oxygen_rec_a_openfunction oxygen_rec_b_openfunction oxygen_rec_c_openfunction oxygen_spdif_openfunction oxygen_multich_openfunction oxygen_ac97_openfunction oxygen_closefunction oxygen_formatfunction oxygen_ratefunction oxygen_i2s_bitsfunction oxygen_play_channelsfunction oxygen_hw_paramsfunction get_mclkfunction oxygen_rec_a_hw_paramsfunction scoped_guardfunction oxygen_rec_b_hw_paramsfunction scoped_guardfunction oxygen_rec_c_hw_paramsfunction scoped_guardfunction oxygen_spdif_hw_paramsfunction oxygen_multich_hw_paramsfunction oxygen_hw_freefunction oxygen_spdif_hw_freefunction scoped_guardfunction oxygen_preparefunction oxygen_triggerfunction snd_pcm_group_for_each_entryfunction oxygen_pointerfunction oxygen_pcm_init
Annotated Snippet
if (chip->model.device_config & CAPTURE_1_FROM_SPDIF) {
runtime->hw.rates &= ~(SNDRV_PCM_RATE_32000 |
SNDRV_PCM_RATE_64000);
runtime->hw.rate_min = 44100;
}
fallthrough;
case PCM_A:
case PCM_B:
runtime->hw.fifo_size = 0;
break;
case PCM_MULTICH:
runtime->hw.channels_max = chip->model.dac_channels_pcm;
break;
}
if (chip->model.pcm_hardware_filter)
chip->model.pcm_hardware_filter(channel, &runtime->hw);
err = snd_pcm_hw_constraint_step(runtime, 0,
SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 32);
if (err < 0)
return err;
err = snd_pcm_hw_constraint_step(runtime, 0,
SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 32);
if (err < 0)
return err;
if (runtime->hw.formats & SNDRV_PCM_FMTBIT_S32_LE) {
err = snd_pcm_hw_constraint_msbits(runtime, 0, 32, 24);
if (err < 0)
return err;
}
if (runtime->hw.channels_max > 2) {
err = snd_pcm_hw_constraint_step(runtime, 0,
SNDRV_PCM_HW_PARAM_CHANNELS,
2);
if (err < 0)
return err;
}
snd_pcm_set_sync(substream);
chip->streams[channel] = substream;
guard(mutex)(&chip->mutex);
chip->pcm_active |= 1 << channel;
if (channel == PCM_SPDIF) {
chip->spdif_pcm_bits = chip->spdif_bits;
chip->controls[CONTROL_SPDIF_PCM]->vd[0].access &=
~SNDRV_CTL_ELEM_ACCESS_INACTIVE;
snd_ctl_notify(chip->card, SNDRV_CTL_EVENT_MASK_VALUE |
SNDRV_CTL_EVENT_MASK_INFO,
&chip->controls[CONTROL_SPDIF_PCM]->id);
}
return 0;
}
static int oxygen_rec_a_open(struct snd_pcm_substream *substream)
{
return oxygen_open(substream, PCM_A);
}
static int oxygen_rec_b_open(struct snd_pcm_substream *substream)
{
return oxygen_open(substream, PCM_B);
}
static int oxygen_rec_c_open(struct snd_pcm_substream *substream)
{
return oxygen_open(substream, PCM_C);
}
static int oxygen_spdif_open(struct snd_pcm_substream *substream)
{
return oxygen_open(substream, PCM_SPDIF);
}
static int oxygen_multich_open(struct snd_pcm_substream *substream)
{
return oxygen_open(substream, PCM_MULTICH);
}
static int oxygen_ac97_open(struct snd_pcm_substream *substream)
{
return oxygen_open(substream, PCM_AC97);
}
static int oxygen_close(struct snd_pcm_substream *substream)
{
struct oxygen *chip = snd_pcm_substream_chip(substream);
unsigned int channel = oxygen_substream_channel(substream);
guard(mutex)(&chip->mutex);
chip->pcm_active &= ~(1 << channel);
Annotation
- Immediate include surface: `linux/pci.h`, `sound/control.h`, `sound/core.h`, `sound/pcm.h`, `sound/pcm_params.h`, `oxygen.h`.
- Detected declarations: `function oxygen_substream_channel`, `function oxygen_open`, `function oxygen_rec_a_open`, `function oxygen_rec_b_open`, `function oxygen_rec_c_open`, `function oxygen_spdif_open`, `function oxygen_multich_open`, `function oxygen_ac97_open`, `function oxygen_close`, `function oxygen_format`.
- 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.