sound/pci/oxygen/oxygen.h
Source file repositories/reference/linux-study-clean/sound/pci/oxygen/oxygen.h
File Facts
- System
- Linux kernel
- Corpus path
sound/pci/oxygen/oxygen.h- Extension
.h- Size
- 7426 bytes
- Lines
- 258
- 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/mutex.hlinux/spinlock.hlinux/wait.hlinux/workqueue.hoxygen_regs.h
Detected Declarations
struct pci_devstruct pci_device_idstruct snd_cardstruct snd_pcm_substreamstruct snd_pcm_hardwarestruct snd_pcm_hw_paramsstruct snd_kcontrol_newstruct snd_rawmidistruct snd_info_bufferstruct oxygenstruct oxygen_modelstruct oxygenfunction oxygen_set_bits8function oxygen_set_bits16function oxygen_set_bits32function oxygen_clear_bits8function oxygen_clear_bits16function oxygen_clear_bits32function oxygen_ac97_set_bitsfunction oxygen_ac97_clear_bits
Annotated Snippet
struct oxygen_model {
const char *shortname;
const char *longname;
const char *chip;
void (*init)(struct oxygen *chip);
int (*control_filter)(struct snd_kcontrol_new *template);
int (*mixer_init)(struct oxygen *chip);
void (*cleanup)(struct oxygen *chip);
void (*suspend)(struct oxygen *chip);
void (*resume)(struct oxygen *chip);
void (*pcm_hardware_filter)(unsigned int channel,
struct snd_pcm_hardware *hardware);
void (*set_dac_params)(struct oxygen *chip,
struct snd_pcm_hw_params *params);
void (*set_adc_params)(struct oxygen *chip,
struct snd_pcm_hw_params *params);
void (*update_dac_volume)(struct oxygen *chip);
void (*update_dac_mute)(struct oxygen *chip);
void (*update_center_lfe_mix)(struct oxygen *chip, bool mixed);
unsigned int (*adjust_dac_routing)(struct oxygen *chip,
unsigned int play_routing);
void (*gpio_changed)(struct oxygen *chip);
void (*uart_input)(struct oxygen *chip);
void (*ac97_switch)(struct oxygen *chip,
unsigned int reg, unsigned int mute);
void (*dump_registers)(struct oxygen *chip,
struct snd_info_buffer *buffer);
const unsigned int *dac_tlv;
size_t model_data_size;
unsigned int device_config;
u8 dac_channels_pcm;
u8 dac_channels_mixer;
u8 dac_volume_min;
u8 dac_volume_max;
u8 misc_flags;
u8 function_flags;
u8 dac_mclks;
u8 adc_mclks;
u16 dac_i2s_format;
u16 adc_i2s_format;
};
struct oxygen {
unsigned long addr;
spinlock_t reg_lock;
struct mutex mutex;
struct snd_card *card;
struct pci_dev *pci;
struct snd_rawmidi *midi;
int irq;
void *model_data;
unsigned int interrupt_mask;
u8 dac_volume[8];
u8 dac_mute;
u8 pcm_active;
u8 pcm_running;
u8 dac_routing;
u8 spdif_playback_enable;
u8 has_ac97_0;
u8 has_ac97_1;
u32 spdif_bits;
u32 spdif_pcm_bits;
struct snd_pcm_substream *streams[PCM_COUNT];
struct snd_kcontrol *controls[CONTROL_COUNT];
struct work_struct spdif_input_bits_work;
struct work_struct gpio_work;
wait_queue_head_t ac97_waitqueue;
union {
u8 _8[OXYGEN_IO_SIZE];
__le16 _16[OXYGEN_IO_SIZE / 2];
__le32 _32[OXYGEN_IO_SIZE / 4];
} saved_registers;
u16 saved_ac97_registers[2][0x40];
unsigned int uart_input_count;
u8 uart_input[32];
struct oxygen_model model;
};
/* oxygen_lib.c */
int oxygen_pci_probe(struct pci_dev *pci, int index, char *id,
struct module *owner,
const struct pci_device_id *ids,
int (*get_model)(struct oxygen *chip,
const struct pci_device_id *id
)
);
extern const struct dev_pm_ops oxygen_pci_pm;
void oxygen_pci_shutdown(struct pci_dev *pci);
Annotation
- Immediate include surface: `linux/mutex.h`, `linux/spinlock.h`, `linux/wait.h`, `linux/workqueue.h`, `oxygen_regs.h`.
- Detected declarations: `struct pci_dev`, `struct pci_device_id`, `struct snd_card`, `struct snd_pcm_substream`, `struct snd_pcm_hardware`, `struct snd_pcm_hw_params`, `struct snd_kcontrol_new`, `struct snd_rawmidi`, `struct snd_info_buffer`, `struct oxygen`.
- 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.