sound/isa/sc6000.c

Source file repositories/reference/linux-study-clean/sound/isa/sc6000.c

File Facts

System
Linux kernel
Corpus path
sound/isa/sc6000.c
Extension
.c
Size
18924 bytes
Lines
755
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.

Dependency Surface

Detected Declarations

Annotated Snippet

struct snd_sc6000 {
	char __iomem *vport;
	char __iomem *vmss_port;
	struct snd_wss *chip;
	u8 mss_config;
	u8 config;
	u8 hw_cfg[2];
	bool old_dsp;
};

/* hardware dependent functions */

/*
 * sc6000_irq_to_softcfg - Decode irq number into cfg code.
 */
static unsigned char sc6000_irq_to_softcfg(int irq)
{
	unsigned char val = 0;

	switch (irq) {
	case 5:
		val = 0x28;
		break;
	case 7:
		val = 0x8;
		break;
	case 9:
		val = 0x10;
		break;
	case 10:
		val = 0x18;
		break;
	case 11:
		val = 0x20;
		break;
	default:
		break;
	}
	return val;
}

/*
 * sc6000_dma_to_softcfg - Decode dma number into cfg code.
 */
static unsigned char sc6000_dma_to_softcfg(int dma)
{
	unsigned char val = 0;

	switch (dma) {
	case 0:
		val = 1;
		break;
	case 1:
		val = 2;
		break;
	case 3:
		val = 3;
		break;
	default:
		break;
	}
	return val;
}

/*
 * sc6000_mpu_irq_to_softcfg - Decode MPU-401 irq number into cfg code.
 */
static unsigned char sc6000_mpu_irq_to_softcfg(int mpu_irq)
{
	unsigned char val = 0;

	switch (mpu_irq) {
	case 5:
		val = 4;
		break;
	case 7:
		val = 0x44;
		break;
	case 9:
		val = 0x84;
		break;
	case 10:
		val = 0xc4;
		break;
	default:
		break;
	}
	return val;
}

Annotation

Implementation Notes