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.

Dependency Surface

Detected Declarations

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

Implementation Notes