sound/pci/au88x0/au88x0_eq.c

Source file repositories/reference/linux-study-clean/sound/pci/au88x0/au88x0_eq.c

File Facts

System
Linux kernel
Corpus path
sound/pci/au88x0/au88x0_eq.c
Extension
.c
Size
22447 bytes
Lines
923
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.

Dependency Surface

Detected Declarations

Annotated Snippet

if (eqhw->this08 == 0) {
			hwwrite(vortex->mmio, 0x2b008 + n * 0x30, coefs[i + 2]);
			hwwrite(vortex->mmio, 0x2b00c + n * 0x30, coefs[i + 3]);
			hwwrite(vortex->mmio, 0x2b010 + n * 0x30, coefs[i + 4]);
		} else {
			hwwrite(vortex->mmio, 0x2b008 + n * 0x30, sign_invert(coefs[2 + i]));
			hwwrite(vortex->mmio, 0x2b00c + n * 0x30, sign_invert(coefs[3 + i]));
		        hwwrite(vortex->mmio, 0x2b010 + n * 0x30, sign_invert(coefs[4 + i]));
		}
		i += 5;
	}
}

static void vortex_EqHw_SetRightCoefs(vortex_t *vortex, const u16 coefs[])
{
	eqhw_t *eqhw = &(vortex->eq.this04);
	int i = 0, n /*esp2c */;

	for (n = 0; n < eqhw->this04; n++) {
		hwwrite(vortex->mmio, 0x2b1e0 + n * 0x30, coefs[0 + i]);
		hwwrite(vortex->mmio, 0x2b1e4 + n * 0x30, coefs[1 + i]);

		if (eqhw->this08 == 0) {
			hwwrite(vortex->mmio, 0x2b1e8 + n * 0x30, coefs[2 + i]);
			hwwrite(vortex->mmio, 0x2b1ec + n * 0x30, coefs[3 + i]);
			hwwrite(vortex->mmio, 0x2b1f0 + n * 0x30, coefs[4 + i]);
		} else {
			hwwrite(vortex->mmio, 0x2b1e8 + n * 0x30, sign_invert(coefs[2 + i]));
			hwwrite(vortex->mmio, 0x2b1ec + n * 0x30, sign_invert(coefs[3 + i]));
			hwwrite(vortex->mmio, 0x2b1f0 + n * 0x30, sign_invert(coefs[4 + i]));
		}
		i += 5;
	}

}

static void vortex_EqHw_SetLeftStates(vortex_t *vortex, const u16 a[], const u16 b[])
{
	eqhw_t *eqhw = &(vortex->eq.this04);
	int i = 0, ebx;

	hwwrite(vortex->mmio, 0x2b3fc, a[0]);
	hwwrite(vortex->mmio, 0x2b400, a[1]);

	for (ebx = 0; ebx < eqhw->this04; ebx++) {
		hwwrite(vortex->mmio, 0x2b014 + (i * 0xc), b[i]);
		hwwrite(vortex->mmio, 0x2b018 + (i * 0xc), b[1 + i]);
		hwwrite(vortex->mmio, 0x2b01c + (i * 0xc), b[2 + i]);
		hwwrite(vortex->mmio, 0x2b020 + (i * 0xc), b[3 + i]);
		i += 4;
	}
}

static void vortex_EqHw_SetRightStates(vortex_t *vortex, const u16 a[], const u16 b[])
{
	eqhw_t *eqhw = &(vortex->eq.this04);
	int i = 0, ebx;

	hwwrite(vortex->mmio, 0x2b404, a[0]);
	hwwrite(vortex->mmio, 0x2b408, a[1]);

	for (ebx = 0; ebx < eqhw->this04; ebx++) {
		hwwrite(vortex->mmio, 0x2b1f4 + (i * 0xc), b[i]);
		hwwrite(vortex->mmio, 0x2b1f8 + (i * 0xc), b[1 + i]);
		hwwrite(vortex->mmio, 0x2b1fc + (i * 0xc), b[2 + i]);
		hwwrite(vortex->mmio, 0x2b200 + (i * 0xc), b[3 + i]);
		i += 4;
	}
}

#if 0
static void vortex_EqHw_GetTimeConsts(vortex_t * vortex, u16 * a, u16 * b)
{
	*a = hwread(vortex->mmio, 0x2b3c4);
	*b = hwread(vortex->mmio, 0x2b3c8);
}

static void vortex_EqHw_GetLeftCoefs(vortex_t * vortex, u16 a[])
{

}

static void vortex_EqHw_GetRightCoefs(vortex_t * vortex, u16 a[])
{

}

static void vortex_EqHw_GetLeftStates(vortex_t * vortex, u16 * a, u16 b[])
{

Annotation

Implementation Notes