drivers/media/usb/go7007/go7007-usb.c

Source file repositories/reference/linux-study-clean/drivers/media/usb/go7007/go7007-usb.c

File Facts

System
Linux kernel
Corpus path
drivers/media/usb/go7007/go7007-usb.c
Extension
.c
Size
35324 bytes
Lines
1357
Domain
Driver Families
Bucket
drivers/media
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 go7007_usb_board {
	unsigned int flags;
	struct go7007_board_info main_info;
};

struct go7007_usb {
	const struct go7007_usb_board *board;
	struct mutex i2c_lock;
	struct usb_device *usbdev;
	struct urb *video_urbs[8];
	struct urb *audio_urbs[8];
	struct urb *intr_urb;
};

/*********************** Product specification data ***********************/

static const struct go7007_usb_board board_matrix_ii = {
	.flags		= GO7007_USB_EZUSB,
	.main_info	= {
		.flags		 = GO7007_BOARD_HAS_AUDIO |
					GO7007_BOARD_USE_ONBOARD_I2C,
		.audio_flags	 = GO7007_AUDIO_I2S_MODE_1 |
					GO7007_AUDIO_WORD_16,
		.audio_rate	 = 48000,
		.audio_bclk_div	 = 8,
		.audio_main_div	 = 2,
		.hpi_buffer_cap  = 7,
		.sensor_flags	 = GO7007_SENSOR_656 |
					GO7007_SENSOR_VALID_ENABLE |
					GO7007_SENSOR_TV |
					GO7007_SENSOR_SAA7115 |
					GO7007_SENSOR_VBI |
					GO7007_SENSOR_SCALING,
		.num_i2c_devs	 = 1,
		.i2c_devs	 = {
			{
				.type	= "saa7115",
				.addr	= 0x20,
				.is_video = 1,
			},
		},
		.num_inputs	 = 2,
		.inputs		 = {
			{
				.video_input	= 0,
				.name		= "Composite",
			},
			{
				.video_input	= 9,
				.name		= "S-Video",
			},
		},
		.video_config	= SAA7115_IDQ_IS_DEFAULT,
	},
};

static const struct go7007_usb_board board_matrix_reload = {
	.flags		= GO7007_USB_EZUSB,
	.main_info	= {
		.flags		 = GO7007_BOARD_HAS_AUDIO |
					GO7007_BOARD_USE_ONBOARD_I2C,
		.audio_flags	 = GO7007_AUDIO_I2S_MODE_1 |
					GO7007_AUDIO_I2S_MASTER |
					GO7007_AUDIO_WORD_16,
		.audio_rate	 = 48000,
		.audio_bclk_div	 = 8,
		.audio_main_div	 = 2,
		.hpi_buffer_cap  = 7,
		.sensor_flags	 = GO7007_SENSOR_656 |
					GO7007_SENSOR_TV,
		.num_i2c_devs	 = 1,
		.i2c_devs	 = {
			{
				.type	= "saa7113",
				.addr	= 0x25,
				.is_video = 1,
			},
		},
		.num_inputs	 = 2,
		.inputs		 = {
			{
				.video_input	= 0,
				.name		= "Composite",
			},
			{
				.video_input	= 9,
				.name		= "S-Video",
			},
		},
		.video_config	= SAA7115_IDQ_IS_DEFAULT,

Annotation

Implementation Notes