drivers/media/pci/cx88/cx88-cards.c

Source file repositories/reference/linux-study-clean/drivers/media/pci/cx88/cx88-cards.c

File Facts

System
Linux kernel
Corpus path
drivers/media/pci/cx88/cx88-cards.c
Extension
.c
Size
99227 bytes
Lines
3857
Domain
Driver Families
Bucket
drivers/media
Inferred role
Driver Families: exported/initcall integration point
Status
integration 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

switch (core->boardnr) {
		case CX88_BOARD_DVICO_FUSIONHDTV_5_PCI_NANO:
			/* GPIO-4 xc3028 tuner */

			cx_set(MO_GP0_IO, 0x00001000);
			cx_clear(MO_GP0_IO, 0x00000010);
			msleep(100);
			cx_set(MO_GP0_IO, 0x00000010);
			msleep(100);
			break;
		default:
			cx_write(MO_GP0_IO, 0x101000);
			mdelay(5);
			cx_set(MO_GP0_IO, 0x101010);
		}
		break;
	default:
		return -EINVAL;
	}

	return 0;
}

/*
 * some Geniatech specific stuff
 */

static int cx88_xc3028_geniatech_tuner_callback(struct cx88_core *core,
						int command, int mode)
{
	switch (command) {
	case XC2028_TUNER_RESET:
		switch (INPUT(core->input).type) {
		case CX88_RADIO:
			break;
		case CX88_VMUX_DVB:
			cx_write(MO_GP1_IO, 0x030302);
			mdelay(50);
			break;
		default:
			cx_write(MO_GP1_IO, 0x030301);
			mdelay(50);
		}
		cx_write(MO_GP1_IO, 0x101010);
		mdelay(50);
		cx_write(MO_GP1_IO, 0x101000);
		mdelay(50);
		cx_write(MO_GP1_IO, 0x101010);
		mdelay(50);
		return 0;
	}
	return -EINVAL;
}

static int cx88_xc3028_winfast1800h_callback(struct cx88_core *core,
					     int command, int arg)
{
	switch (command) {
	case XC2028_TUNER_RESET:
		/* GPIO 12 (xc3028 tuner reset) */
		cx_set(MO_GP1_IO, 0x1010);
		mdelay(50);
		cx_clear(MO_GP1_IO, 0x10);
		mdelay(75);
		cx_set(MO_GP1_IO, 0x10);
		mdelay(75);
		return 0;
	}
	return -EINVAL;
}

static int cx88_xc4000_winfast2000h_plus_callback(struct cx88_core *core,
						  int command, int arg)
{
	switch (command) {
	case XC4000_TUNER_RESET:
		/* GPIO 12 (xc4000 tuner reset) */
		cx_set(MO_GP1_IO, 0x1010);
		mdelay(50);
		cx_clear(MO_GP1_IO, 0x10);
		mdelay(75);
		cx_set(MO_GP1_IO, 0x10);
		mdelay(75);
		return 0;
	}
	return -EINVAL;
}

/*
 * some Divco specific stuff

Annotation

Implementation Notes