sound/isa/sb/jazz16.c
Source file repositories/reference/linux-study-clean/sound/isa/sb/jazz16.c
File Facts
- System
- Linux kernel
- Corpus path
sound/isa/sb/jazz16.c- Extension
.c- Size
- 9917 bytes
- Lines
- 368
- Domain
- Driver Families
- Bucket
- sound/isa
- 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
linux/init.hlinux/module.hlinux/io.hlinux/delay.hlinux/string.hasm/dma.hlinux/isa.hsound/core.hsound/mpu401.hsound/opl3.hsound/sb.hsound/initval.h
Detected Declarations
struct snd_card_jazz16function jazz16_interruptfunction jazz16_configure_portsfunction jazz16_detect_boardfunction jazz16_configure_boardfunction snd_jazz16_matchfunction snd_jazz16_probefunction snd_jazz16_suspendfunction snd_jazz16_resume
Annotated Snippet
struct snd_card_jazz16 {
struct snd_sb *chip;
};
static irqreturn_t jazz16_interrupt(int irq, void *chip)
{
return snd_sb8dsp_interrupt(chip);
}
static int jazz16_configure_ports(struct snd_card *card,
unsigned long port,
unsigned long mpu_port, int idx)
{
unsigned char val;
if (!request_region(0x201, 1, "jazz16 config")) {
dev_err(card->dev, "config port region is already in use.\n");
return -EBUSY;
}
outb(SB_JAZZ16_WAKEUP - idx, 0x201);
udelay(100);
outb(SB_JAZZ16_SET_PORTS + idx, 0x201);
udelay(100);
val = port & 0x70;
val |= (mpu_port & 0x30) >> 4;
outb(val, 0x201);
release_region(0x201, 1);
return 0;
}
static int jazz16_detect_board(struct snd_card *card, unsigned long port,
unsigned long mpu_port)
{
int err;
int val;
struct snd_sb chip = {};
if (!request_region(port, 0x10, "jazz16")) {
dev_err(card->dev, "I/O port region is already in use.\n");
return -EBUSY;
}
/* just to call snd_sbdsp_command/reset/get_byte() */
chip.port = port;
err = snd_sbdsp_reset(&chip);
if (err < 0)
for (val = 0; val < 4; val++) {
err = jazz16_configure_ports(card, port, mpu_port, val);
if (err < 0)
break;
err = snd_sbdsp_reset(&chip);
if (!err)
break;
}
if (err < 0) {
err = -ENODEV;
goto err_unmap;
}
if (!snd_sbdsp_command(&chip, SB_DSP_GET_JAZZ_BRD_REV)) {
err = -EBUSY;
goto err_unmap;
}
val = snd_sbdsp_get_byte(&chip);
if (val >= 0x30)
snd_sbdsp_get_byte(&chip);
if ((val & 0xf0) != 0x10) {
err = -ENODEV;
goto err_unmap;
}
if (!snd_sbdsp_command(&chip, SB_DSP_GET_JAZZ_MODEL)) {
err = -EBUSY;
goto err_unmap;
}
snd_sbdsp_get_byte(&chip);
err = snd_sbdsp_get_byte(&chip);
dev_dbg(card->dev, "Media Vision Jazz16 board detected: rev 0x%x, model 0x%x\n",
val, err);
err = 0;
err_unmap:
release_region(port, 0x10);
return err;
}
static int jazz16_configure_board(struct snd_sb *chip, int mpu_irq)
{
Annotation
- Immediate include surface: `linux/init.h`, `linux/module.h`, `linux/io.h`, `linux/delay.h`, `linux/string.h`, `asm/dma.h`, `linux/isa.h`, `sound/core.h`.
- Detected declarations: `struct snd_card_jazz16`, `function jazz16_interrupt`, `function jazz16_configure_ports`, `function jazz16_detect_board`, `function jazz16_configure_board`, `function snd_jazz16_match`, `function snd_jazz16_probe`, `function snd_jazz16_suspend`, `function snd_jazz16_resume`.
- Atlas domain: Driver Families / sound/isa.
- 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.