sound/pci/ice1712/prodigy_hifi.c
Source file repositories/reference/linux-study-clean/sound/pci/ice1712/prodigy_hifi.c
File Facts
- System
- Linux kernel
- Corpus path
sound/pci/ice1712/prodigy_hifi.c- Extension
.c- Size
- 31443 bytes
- Lines
- 1250
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/delay.hlinux/interrupt.hlinux/init.hlinux/slab.hlinux/mutex.hsound/core.hsound/info.hsound/tlv.hice1712.henvy24ht.hprodigy_hifi.h
Detected Declarations
struct prodigy_hifi_specfunction wm_getfunction wm_put_nocachefunction wm_putfunction set_gpio_bitfunction wm8766_spi_send_wordfunction wm8766_spi_writefunction ak4396_send_wordfunction ak4396_writefunction controlfunction ak4396_dac_vol_getfunction ak4396_dac_vol_putfunction wm_set_volfunction wm8766_set_volfunction controlfunction wm_dac_vol_getfunction wm_dac_vol_putfunction wm8766_vol_infofunction wm8766_vol_getfunction wm8766_vol_putfunction wm_master_vol_infofunction wm_master_vol_getfunction wm_master_vol_putfunction wm_adc_mux_enum_infofunction wm_adc_mux_enum_getfunction wm_adc_mux_enum_putfunction controlfunction wm_adc_vol_getfunction wm_adc_vol_putfunction wm_adc_mux_getfunction wm_adc_mux_putfunction bypassfunction wm_bypass_putfunction wm_chswap_getfunction wm_chswap_putfunction wm_proc_regs_writefunction wm_proc_regs_readfunction wm_proc_initfunction prodigy_hifi_add_controlsfunction prodigy_hd2_add_controlsfunction wm8766_initfunction wm8776_initfunction prodigy_hifi_resumefunction prodigy_hifi_initfunction ak4396_initfunction prodigy_hd2_resumefunction prodigy_hd2_init
Annotated Snippet
struct prodigy_hifi_spec {
unsigned short master[2];
unsigned short vol[8];
};
/* I2C addresses */
#define WM_DEV 0x34
/* WM8776 registers */
#define WM_HP_ATTEN_L 0x00 /* headphone left attenuation */
#define WM_HP_ATTEN_R 0x01 /* headphone left attenuation */
#define WM_HP_MASTER 0x02 /* headphone master (both channels),
override LLR */
#define WM_DAC_ATTEN_L 0x03 /* digital left attenuation */
#define WM_DAC_ATTEN_R 0x04
#define WM_DAC_MASTER 0x05
#define WM_PHASE_SWAP 0x06 /* DAC phase swap */
#define WM_DAC_CTRL1 0x07
#define WM_DAC_MUTE 0x08
#define WM_DAC_CTRL2 0x09
#define WM_DAC_INT 0x0a
#define WM_ADC_INT 0x0b
#define WM_MASTER_CTRL 0x0c
#define WM_POWERDOWN 0x0d
#define WM_ADC_ATTEN_L 0x0e
#define WM_ADC_ATTEN_R 0x0f
#define WM_ALC_CTRL1 0x10
#define WM_ALC_CTRL2 0x11
#define WM_ALC_CTRL3 0x12
#define WM_NOISE_GATE 0x13
#define WM_LIMITER 0x14
#define WM_ADC_MUX 0x15
#define WM_OUT_MUX 0x16
#define WM_RESET 0x17
/* Analog Recording Source :- Mic, LineIn, CD/Video, */
/* implement capture source select control for WM8776 */
#define WM_AIN1 "AIN1"
#define WM_AIN2 "AIN2"
#define WM_AIN3 "AIN3"
#define WM_AIN4 "AIN4"
#define WM_AIN5 "AIN5"
/* GPIO pins of envy24ht connected to wm8766 */
#define WM8766_SPI_CLK (1<<17) /* CLK, Pin97 on ICE1724 */
#define WM8766_SPI_MD (1<<16) /* DATA VT1724 -> WM8766, Pin96 */
#define WM8766_SPI_ML (1<<18) /* Latch, Pin98 */
/* WM8766 registers */
#define WM8766_DAC_CTRL 0x02 /* DAC Control */
#define WM8766_INT_CTRL 0x03 /* Interface Control */
#define WM8766_DAC_CTRL2 0x09
#define WM8766_DAC_CTRL3 0x0a
#define WM8766_RESET 0x1f
#define WM8766_LDA1 0x00
#define WM8766_LDA2 0x04
#define WM8766_LDA3 0x06
#define WM8766_RDA1 0x01
#define WM8766_RDA2 0x05
#define WM8766_RDA3 0x07
#define WM8766_MUTE1 0x0C
#define WM8766_MUTE2 0x0F
/*
* Prodigy HD2
*/
#define AK4396_ADDR 0x00
#define AK4396_CSN (1 << 8) /* CSN->GPIO8, pin 75 */
#define AK4396_CCLK (1 << 9) /* CCLK->GPIO9, pin 76 */
#define AK4396_CDTI (1 << 10) /* CDTI->GPIO10, pin 77 */
/* ak4396 registers */
#define AK4396_CTRL1 0x00
#define AK4396_CTRL2 0x01
#define AK4396_CTRL3 0x02
#define AK4396_LCH_ATT 0x03
#define AK4396_RCH_ATT 0x04
/*
* get the current register value of WM codec
*/
static unsigned short wm_get(struct snd_ice1712 *ice, int reg)
{
reg <<= 1;
return ((unsigned short)ice->akm[0].images[reg] << 8) |
ice->akm[0].images[reg + 1];
Annotation
- Immediate include surface: `linux/delay.h`, `linux/interrupt.h`, `linux/init.h`, `linux/slab.h`, `linux/mutex.h`, `sound/core.h`, `sound/info.h`, `sound/tlv.h`.
- Detected declarations: `struct prodigy_hifi_spec`, `function wm_get`, `function wm_put_nocache`, `function wm_put`, `function set_gpio_bit`, `function wm8766_spi_send_word`, `function wm8766_spi_write`, `function ak4396_send_word`, `function ak4396_write`, `function control`.
- 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.