sound/pci/ac97/ac97_patch.c
Source file repositories/reference/linux-study-clean/sound/pci/ac97/ac97_patch.c
File Facts
- System
- Linux kernel
- Corpus path
sound/pci/ac97/ac97_patch.c- Extension
.c- Size
- 125879 bytes
- Lines
- 3916
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
ac97_local.hac97_patch.h
Detected Declarations
struct vt1618_uaj_itemfunction patch_build_controlsfunction reset_tlvfunction ac97_update_bits_pagefunction ac97_surround_jack_mode_infofunction ac97_surround_jack_mode_getfunction ac97_surround_jack_mode_putfunction ac97_channel_mode_infofunction ac97_channel_mode_getfunction ac97_channel_mode_putfunction is_surround_onfunction is_clfe_onfunction is_shared_surroutfunction is_shared_clfeoutfunction is_shared_lineinfunction is_shared_micinfunction alc850_is_aux_back_surroundfunction snd_ac97_ymf7x3_info_speakerfunction snd_ac97_ymf7x3_get_speakerfunction snd_ac97_ymf7x3_put_speakerfunction snd_ac97_ymf7x3_spdif_source_infofunction snd_ac97_ymf7x3_spdif_source_getfunction snd_ac97_ymf7x3_spdif_source_putfunction patch_yamaha_ymf7x3_3dfunction patch_yamaha_ymf743_build_spdiffunction patch_yamaha_ymf743function snd_ac97_ymf753_spdif_output_pin_infofunction snd_ac97_ymf753_spdif_output_pin_getfunction snd_ac97_ymf753_spdif_output_pin_putfunction patch_yamaha_ymf753_post_spdiffunction patch_yamaha_ymf753function patch_wolfson_wm9703_specificfunction patch_wolfson03function patch_wolfson_wm9704_specificfunction patch_wolfson04function patch_wolfson05function patch_wolfson_wm9711_specificfunction patch_wolfson11function patch_wolfson_wm9713_3dfunction patch_wolfson_wm9713_specificfunction patch_wolfson_wm9713_suspendfunction patch_wolfson_wm9713_resumefunction patch_wolfson13function patch_tritech_tr28028function patch_sigmatel_stac9700_3dfunction patch_sigmatel_stac9708_3dfunction patch_sigmatel_stac97xx_specificfunction patch_sigmatel_stac9700
Annotated Snippet
struct vt1618_uaj_item {
unsigned short mask;
unsigned short shift;
const char * const items[4];
};
/* This list reflects the vt1618 docs for Vendor Defined Register 0x60. */
static const struct vt1618_uaj_item vt1618_uaj[3] = {
{
/* speaker jack */
.mask = 0x03,
.shift = 0,
.items = {
"Speaker Out", "DAC Unmixed Out", "Line In", "Mic In"
}
},
{
/* line jack */
.mask = 0x0c,
.shift = 2,
.items = {
"Surround Out", "DAC Unmixed Out", "Line In", "Mic In"
}
},
{
/* mic jack */
.mask = 0x30,
.shift = 4,
.items = {
"Center LFE Out", "DAC Unmixed Out", "Line In", "Mic In"
},
},
};
static int snd_ac97_vt1618_UAJ_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{
return snd_ctl_enum_info(uinfo, 1, 4,
vt1618_uaj[kcontrol->private_value].items);
}
/* All of the vt1618 Universal Audio Jack twiddlers are on
* Vendor Defined Register 0x60, page 0. The bits, and thus
* the mask, are the only thing that changes
*/
static int snd_ac97_vt1618_UAJ_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
unsigned short datpag, uaj;
struct snd_ac97 *pac97 = snd_kcontrol_chip(kcontrol);
guard(mutex)(&pac97->page_mutex);
datpag = snd_ac97_read(pac97, AC97_INT_PAGING) & AC97_PAGE_MASK;
snd_ac97_update_bits(pac97, AC97_INT_PAGING, AC97_PAGE_MASK, 0);
uaj = snd_ac97_read(pac97, 0x60) &
vt1618_uaj[kcontrol->private_value].mask;
snd_ac97_update_bits(pac97, AC97_INT_PAGING, AC97_PAGE_MASK, datpag);
ucontrol->value.enumerated.item[0] = uaj >>
vt1618_uaj[kcontrol->private_value].shift;
return 0;
}
static int snd_ac97_vt1618_UAJ_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
return ac97_update_bits_page(snd_kcontrol_chip(kcontrol), 0x60,
vt1618_uaj[kcontrol->private_value].mask,
ucontrol->value.enumerated.item[0]<<
vt1618_uaj[kcontrol->private_value].shift,
0);
}
/* config aux in jack - not found on 3 jack motherboards or soundcards */
static int snd_ac97_vt1618_aux_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{
static const char * const txt_aux[] = {"Aux In", "Back Surr Out"};
return snd_ctl_enum_info(uinfo, 1, 2, txt_aux);
}
static int snd_ac97_vt1618_aux_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
Annotation
- Immediate include surface: `ac97_local.h`, `ac97_patch.h`.
- Detected declarations: `struct vt1618_uaj_item`, `function patch_build_controls`, `function reset_tlv`, `function ac97_update_bits_page`, `function ac97_surround_jack_mode_info`, `function ac97_surround_jack_mode_get`, `function ac97_surround_jack_mode_put`, `function ac97_channel_mode_info`, `function ac97_channel_mode_get`, `function ac97_channel_mode_put`.
- Atlas domain: Driver Families / sound/pci.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.