sound/ppc/burgundy.c
Source file repositories/reference/linux-study-clean/sound/ppc/burgundy.c
File Facts
- System
- Linux kernel
- Corpus path
sound/ppc/burgundy.c- Extension
.c- Size
- 24112 bytes
- Lines
- 715
- Domain
- Driver Families
- Bucket
- sound/ppc
- 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/io.hlinux/init.hlinux/delay.hlinux/of.hsound/core.hpmac.hburgundy.h
Detected Declarations
function Copyrightfunction snd_pmac_burgundy_extend_waitfunction snd_pmac_burgundy_wcwfunction snd_pmac_burgundy_rcwfunction snd_pmac_burgundy_wcbfunction snd_pmac_burgundy_rcbfunction snd_pmac_burgundy_write_volumefunction snd_pmac_burgundy_read_volumefunction snd_pmac_burgundy_info_volumefunction snd_pmac_burgundy_get_volumefunction snd_pmac_burgundy_put_volumefunction snd_pmac_burgundy_write_volume_2bfunction snd_pmac_burgundy_read_volume_2bfunction snd_pmac_burgundy_info_volume_2bfunction snd_pmac_burgundy_get_volume_2bfunction snd_pmac_burgundy_put_volume_2bfunction snd_pmac_burgundy_info_gainfunction snd_pmac_burgundy_get_gainfunction snd_pmac_burgundy_put_gainfunction snd_pmac_burgundy_info_switch_wfunction snd_pmac_burgundy_get_switch_wfunction snd_pmac_burgundy_put_switch_wfunction snd_pmac_burgundy_info_switch_bfunction snd_pmac_burgundy_get_switch_bfunction snd_pmac_burgundy_put_switch_bfunction snd_pmac_burgundy_detect_headphonefunction snd_pmac_burgundy_update_automutefunction snd_pmac_burgundy_init
Annotated Snippet
if (do_notify) {
snd_ctl_notify(chip->card, SNDRV_CTL_EVENT_MASK_VALUE,
&chip->master_sw_ctl->id);
snd_ctl_notify(chip->card, SNDRV_CTL_EVENT_MASK_VALUE,
&chip->speaker_sw_ctl->id);
snd_ctl_notify(chip->card, SNDRV_CTL_EVENT_MASK_VALUE,
&chip->hp_detect_ctl->id);
}
}
}
#endif /* PMAC_SUPPORT_AUTOMUTE */
/*
* initialize burgundy
*/
int snd_pmac_burgundy_init(struct snd_pmac *chip)
{
int imac = of_machine_is_compatible("iMac");
int i, err;
/* Checks to see the chip is alive and kicking */
if ((in_le32(&chip->awacs->codec_ctrl) & MASK_ERRCODE) == 0xf0000) {
printk(KERN_WARNING "pmac burgundy: disabled by MacOS :-(\n");
return 1;
}
snd_pmac_burgundy_wcw(chip, MASK_ADDR_BURGUNDY_OUTPUTENABLES,
DEF_BURGUNDY_OUTPUTENABLES);
snd_pmac_burgundy_wcb(chip, MASK_ADDR_BURGUNDY_MORE_OUTPUTENABLES,
DEF_BURGUNDY_MORE_OUTPUTENABLES);
snd_pmac_burgundy_wcw(chip, MASK_ADDR_BURGUNDY_OUTPUTSELECTS,
DEF_BURGUNDY_OUTPUTSELECTS);
snd_pmac_burgundy_wcb(chip, MASK_ADDR_BURGUNDY_INPSEL21,
DEF_BURGUNDY_INPSEL21);
snd_pmac_burgundy_wcb(chip, MASK_ADDR_BURGUNDY_INPSEL3,
imac ? DEF_BURGUNDY_INPSEL3_IMAC
: DEF_BURGUNDY_INPSEL3_PMAC);
snd_pmac_burgundy_wcb(chip, MASK_ADDR_BURGUNDY_GAINCD,
DEF_BURGUNDY_GAINCD);
snd_pmac_burgundy_wcb(chip, MASK_ADDR_BURGUNDY_GAINLINE,
DEF_BURGUNDY_GAINLINE);
snd_pmac_burgundy_wcb(chip, MASK_ADDR_BURGUNDY_GAINMIC,
DEF_BURGUNDY_GAINMIC);
snd_pmac_burgundy_wcb(chip, MASK_ADDR_BURGUNDY_GAINMODEM,
DEF_BURGUNDY_GAINMODEM);
snd_pmac_burgundy_wcb(chip, MASK_ADDR_BURGUNDY_ATTENSPEAKER,
DEF_BURGUNDY_ATTENSPEAKER);
snd_pmac_burgundy_wcb(chip, MASK_ADDR_BURGUNDY_ATTENLINEOUT,
DEF_BURGUNDY_ATTENLINEOUT);
snd_pmac_burgundy_wcb(chip, MASK_ADDR_BURGUNDY_ATTENHP,
DEF_BURGUNDY_ATTENHP);
snd_pmac_burgundy_wcw(chip, MASK_ADDR_BURGUNDY_MASTER_VOLUME,
DEF_BURGUNDY_MASTER_VOLUME);
snd_pmac_burgundy_wcw(chip, MASK_ADDR_BURGUNDY_VOLCD,
DEF_BURGUNDY_VOLCD);
snd_pmac_burgundy_wcw(chip, MASK_ADDR_BURGUNDY_VOLLINE,
DEF_BURGUNDY_VOLLINE);
snd_pmac_burgundy_wcw(chip, MASK_ADDR_BURGUNDY_VOLMIC,
DEF_BURGUNDY_VOLMIC);
if (chip->hp_stat_mask == 0) {
/* set headphone-jack detection bit */
if (imac)
chip->hp_stat_mask = BURGUNDY_HPDETECT_IMAC_UPPER
| BURGUNDY_HPDETECT_IMAC_LOWER
| BURGUNDY_HPDETECT_IMAC_SIDE;
else
chip->hp_stat_mask = BURGUNDY_HPDETECT_PMAC_BACK;
}
/*
* build burgundy mixers
*/
strscpy(chip->card->mixername, "PowerMac Burgundy");
for (i = 0; i < ARRAY_SIZE(snd_pmac_burgundy_mixers); i++) {
err = snd_ctl_add(chip->card,
snd_ctl_new1(&snd_pmac_burgundy_mixers[i], chip));
if (err < 0)
return err;
}
for (i = 0; i < (imac ? ARRAY_SIZE(snd_pmac_burgundy_mixers_imac)
: ARRAY_SIZE(snd_pmac_burgundy_mixers_pmac)); i++) {
err = snd_ctl_add(chip->card,
snd_ctl_new1(imac ? &snd_pmac_burgundy_mixers_imac[i]
: &snd_pmac_burgundy_mixers_pmac[i], chip));
if (err < 0)
Annotation
- Immediate include surface: `linux/io.h`, `linux/init.h`, `linux/delay.h`, `linux/of.h`, `sound/core.h`, `pmac.h`, `burgundy.h`.
- Detected declarations: `function Copyright`, `function snd_pmac_burgundy_extend_wait`, `function snd_pmac_burgundy_wcw`, `function snd_pmac_burgundy_rcw`, `function snd_pmac_burgundy_wcb`, `function snd_pmac_burgundy_rcb`, `function snd_pmac_burgundy_write_volume`, `function snd_pmac_burgundy_read_volume`, `function snd_pmac_burgundy_info_volume`, `function snd_pmac_burgundy_get_volume`.
- Atlas domain: Driver Families / sound/ppc.
- 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.