sound/pci/ice1712/wm8776.h

Source file repositories/reference/linux-study-clean/sound/pci/ice1712/wm8776.h

File Facts

System
Linux kernel
Corpus path
sound/pci/ice1712/wm8776.h
Extension
.h
Size
6627 bytes
Lines
210
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 snd_wm8776_ops {
	void (*write)(struct snd_wm8776 *wm, u8 addr, u8 data);
};

enum snd_wm8776_ctl_id {
	WM8776_CTL_DAC_VOL,
	WM8776_CTL_DAC_SW,
	WM8776_CTL_DAC_ZC_SW,
	WM8776_CTL_HP_VOL,
	WM8776_CTL_HP_SW,
	WM8776_CTL_HP_ZC_SW,
	WM8776_CTL_AUX_SW,
	WM8776_CTL_BYPASS_SW,
	WM8776_CTL_DAC_IZD_SW,
	WM8776_CTL_PHASE_SW,
	WM8776_CTL_DEEMPH_SW,
	WM8776_CTL_ADC_VOL,
	WM8776_CTL_ADC_SW,
	WM8776_CTL_INPUT1_SW,
	WM8776_CTL_INPUT2_SW,
	WM8776_CTL_INPUT3_SW,
	WM8776_CTL_INPUT4_SW,
	WM8776_CTL_INPUT5_SW,
	WM8776_CTL_AGC_SEL,
	WM8776_CTL_LIM_THR,
	WM8776_CTL_LIM_ATK,
	WM8776_CTL_LIM_DCY,
	WM8776_CTL_LIM_TRANWIN,
	WM8776_CTL_LIM_MAXATTN,
	WM8776_CTL_ALC_TGT,
	WM8776_CTL_ALC_ATK,
	WM8776_CTL_ALC_DCY,
	WM8776_CTL_ALC_MAXGAIN,
	WM8776_CTL_ALC_MAXATTN,
	WM8776_CTL_ALC_HLD,
	WM8776_CTL_NGT_SW,
	WM8776_CTL_NGT_THR,

	WM8776_CTL_COUNT,
};

#define WM8776_ENUM_MAX		16

#define WM8776_FLAG_STEREO	(1 << 0)
#define WM8776_FLAG_VOL_UPDATE	(1 << 1)
#define WM8776_FLAG_INVERT	(1 << 2)
#define WM8776_FLAG_LIM		(1 << 3)
#define WM8776_FLAG_ALC		(1 << 4)

struct snd_wm8776_ctl {
	const char *name;
	snd_ctl_elem_type_t type;
	const char *const enum_names[WM8776_ENUM_MAX];
	const unsigned int *tlv;
	u16 reg1, reg2, mask1, mask2, min, max, flags;
	void (*set)(struct snd_wm8776 *wm, u16 ch1, u16 ch2);
	void (*get)(struct snd_wm8776 *wm, u16 *ch1, u16 *ch2);
};

enum snd_wm8776_agc_mode {
	WM8776_AGC_OFF,
	WM8776_AGC_LIM,
	WM8776_AGC_ALC_R,
	WM8776_AGC_ALC_L,
	WM8776_AGC_ALC_STEREO
};

struct snd_wm8776 {
	struct snd_card *card;
	struct snd_wm8776_ctl ctl[WM8776_CTL_COUNT];
	enum snd_wm8776_agc_mode agc_mode;
	struct snd_wm8776_ops ops;
	u16 regs[WM8776_REG_COUNT];	/* 9-bit registers */
};



void snd_wm8776_init(struct snd_wm8776 *wm);
void snd_wm8776_resume(struct snd_wm8776 *wm);
void snd_wm8776_set_power(struct snd_wm8776 *wm, u16 power);
void snd_wm8776_volume_restore(struct snd_wm8776 *wm);
int snd_wm8776_build_controls(struct snd_wm8776 *wm);

#endif /* __SOUND_WM8776_H */

Annotation

Implementation Notes