sound/isa/galaxy/galaxy.c
Source file repositories/reference/linux-study-clean/sound/isa/galaxy/galaxy.c
File Facts
- System
- Linux kernel
- Corpus path
sound/isa/galaxy/galaxy.c- Extension
.c- Size
- 13831 bytes
- Lines
- 616
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/module.hlinux/isa.hlinux/delay.hlinux/io.hasm/processor.hsound/core.hsound/initval.hsound/wss.hsound/mpu401.hsound/opl3.h
Detected Declarations
struct snd_galaxyfunction dsp_get_bytefunction dsp_resetfunction dsp_commandfunction dsp_get_versionfunction wss_detectfunction wss_set_configfunction snd_galaxy_matchfunction galaxy_initfunction galaxy_set_modefunction galaxy_set_configfunction galaxy_configfunction galaxy_wss_configfunction snd_galaxy_freefunction __snd_galaxy_probefunction snd_galaxy_probe
Annotated Snippet
struct snd_galaxy {
void __iomem *port;
void __iomem *config_port;
void __iomem *wss_port;
u32 config;
struct resource *res_port;
struct resource *res_config_port;
struct resource *res_wss_port;
};
static u32 config[SNDRV_CARDS];
static u8 wss_config[SNDRV_CARDS];
static int snd_galaxy_match(struct device *dev, unsigned int n)
{
if (!enable[n])
return 0;
switch (port[n]) {
case SNDRV_AUTO_PORT:
dev_err(dev, "please specify port\n");
return 0;
case 0x220:
config[n] |= GALAXY_CONFIG_SBA_220;
break;
case 0x240:
config[n] |= GALAXY_CONFIG_SBA_240;
break;
case 0x260:
config[n] |= GALAXY_CONFIG_SBA_260;
break;
case 0x280:
config[n] |= GALAXY_CONFIG_SBA_280;
break;
default:
dev_err(dev, "invalid port %#lx\n", port[n]);
return 0;
}
switch (wss_port[n]) {
case SNDRV_AUTO_PORT:
dev_err(dev, "please specify wss_port\n");
return 0;
case 0x530:
config[n] |= GALAXY_CONFIG_WSS_ENABLE | GALAXY_CONFIG_WSSA_530;
break;
case 0x604:
config[n] |= GALAXY_CONFIG_WSS_ENABLE | GALAXY_CONFIG_WSSA_604;
break;
case 0xe80:
config[n] |= GALAXY_CONFIG_WSS_ENABLE | GALAXY_CONFIG_WSSA_E80;
break;
case 0xf40:
config[n] |= GALAXY_CONFIG_WSS_ENABLE | GALAXY_CONFIG_WSSA_F40;
break;
default:
dev_err(dev, "invalid WSS port %#lx\n", wss_port[n]);
return 0;
}
switch (irq[n]) {
case SNDRV_AUTO_IRQ:
dev_err(dev, "please specify irq\n");
return 0;
case 7:
wss_config[n] |= WSS_CONFIG_IRQ_7;
break;
case 2:
irq[n] = 9;
fallthrough;
case 9:
wss_config[n] |= WSS_CONFIG_IRQ_9;
break;
case 10:
wss_config[n] |= WSS_CONFIG_IRQ_10;
break;
case 11:
wss_config[n] |= WSS_CONFIG_IRQ_11;
break;
default:
dev_err(dev, "invalid IRQ %d\n", irq[n]);
return 0;
}
switch (dma1[n]) {
case SNDRV_AUTO_DMA:
dev_err(dev, "please specify dma1\n");
return 0;
case 0:
wss_config[n] |= WSS_CONFIG_DMA_0;
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/module.h`, `linux/isa.h`, `linux/delay.h`, `linux/io.h`, `asm/processor.h`, `sound/core.h`, `sound/initval.h`.
- Detected declarations: `struct snd_galaxy`, `function dsp_get_byte`, `function dsp_reset`, `function dsp_command`, `function dsp_get_version`, `function wss_detect`, `function wss_set_config`, `function snd_galaxy_match`, `function galaxy_init`, `function galaxy_set_mode`.
- Atlas domain: Driver Families / sound/isa.
- 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.