⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 spca508_init.h

📁 摄像头驱动
💻 H
📖 第 1 页 / 共 4 页
字号:
 /*590  */   {0, 0x0030, 0x8112 },#endif{0,0,0}};/* * Initialization data for Creative Webcam Vista */static __u16 spca508_vista_init_data[][3] ={  { 0, 0x0008, 0x8200 }, /* Clear register */  { 0, 0x0000, 0x870b }, /* Reset CTL3 */  { 0, 0x0020, 0x8112 }, /* Video Drop packet enable */  { 0, 0x0003, 0x8111 }, /* Soft Reset compression, memory, TG & CDSP */  { 0, 0x0000, 0x8110 }, /* Disable everything */  { 0, 0x0000, 0x8114 }, /* Software GPIO output data */  { 0, 0x0000, 0x8114 },  { 0, 0x0003, 0x8111 },  { 0, 0x0000, 0x8111 },  { 0, 0x0090, 0x8110 }, /* Enable: SSI output, External 2X clock output */  { 0, 0x0020, 0x8112 },  { 0, 0x0000, 0x8114 },  { 0, 0x0001, 0x8114 },  { 0, 0x0001, 0x8114 },  { 0, 0x0001, 0x8114 },  { 0, 0x0003, 0x8114 },  { 0, 0x000f, 0x8402 }, /* Memory bank Address */  { 0, 0x0000, 0x8403 }, /* Memory bank Address */  { 0, 0x00ba, 0x8804 }, /* SSI Slave address */  { 0, 0x0010, 0x8802 }, /* 93.75kHz SSI Clock Two DataByte */  /* READ { 0, 0x0001, 0x8803 } ->                0000: 00  */  /* READ { 0, 0x0001, 0x8802 } ->                0000: 10  */  { 0, 0x0010, 0x8802 }, /* Will write 2 bytes (DATA1+DATA2) */  { 0, 0x0020, 0x8801 }, /* Register address for SSI read/write */  { 0, 0x0044, 0x8805 }, /* DATA2 */  { 0, 0x0004, 0x8800 }, /* DATA1 -> write triggered */  /* READ { 0, 0x0001, 0x8803 } ->                0000: 00  */  /* READ { 0, 0x0001, 0x8803 } ->                0000: 00  */  /* READ { 0, 0x0001, 0x8802 } ->                0000: 10  */  { 0, 0x0010, 0x8802 },  { 0, 0x0009, 0x8801 },  { 0, 0x0042, 0x8805 },  { 0, 0x0001, 0x8800 },  /* READ { 0, 0x0001, 0x8803 } ->                0000: 00  */  /* READ { 0, 0x0001, 0x8803 } ->                0000: 00  */  /* READ { 0, 0x0001, 0x8802 } ->                0000: 10  */  { 0, 0x0010, 0x8802 },  { 0, 0x003c, 0x8801 },  { 0, 0x0001, 0x8805 },  { 0, 0x0000, 0x8800 },  /* READ { 0, 0x0001, 0x8803 } ->                0000: 00  */  /* READ { 0, 0x0001, 0x8803 } ->                0000: 00  */  /* READ { 0, 0x0001, 0x8802 } ->                0000: 10  */  { 0, 0x0010, 0x8802 },  { 0, 0x0001, 0x8801 },  { 0, 0x000a, 0x8805 },  { 0, 0x0000, 0x8800 },  /* READ { 0, 0x0001, 0x8803 } ->                0000: 00  */  /* READ { 0, 0x0001, 0x8803 } ->                0000: 00  */  /* READ { 0, 0x0001, 0x8802 } ->                0000: 10  */  { 0, 0x0010, 0x8802 },  { 0, 0x0002, 0x8801 },  { 0, 0x0000, 0x8805 },  { 0, 0x0000, 0x8800 },  /* READ { 0, 0x0001, 0x8803 } ->                0000: 00  */  /* READ { 0, 0x0001, 0x8803 } ->                0000: 00  */  /* READ { 0, 0x0001, 0x8802 } ->                0000: 10  */  { 0, 0x0010, 0x8802 },  { 0, 0x0003, 0x8801 },  { 0, 0x0027, 0x8805 },  { 0, 0x0001, 0x8800 },  /* READ { 0, 0x0001, 0x8803 } ->                0000: 00  */  /* READ { 0, 0x0001, 0x8803 } ->                0000: 00  */  /* READ { 0, 0x0001, 0x8802 } ->                0000: 10  */  { 0, 0x0010, 0x8802 },  { 0, 0x0004, 0x8801 },  { 0, 0x0065, 0x8805 },  { 0, 0x0001, 0x8800 },  /* READ { 0, 0x0001, 0x8803 } ->                0000: 00  */  /* READ { 0, 0x0001, 0x8803 } ->                0000: 00  */  /* READ { 0, 0x0001, 0x8802 } ->                0000: 10  */  { 0, 0x0010, 0x8802 },  { 0, 0x0005, 0x8801 },  { 0, 0x0003, 0x8805 },  { 0, 0x0000, 0x8800 },  /* READ { 0, 0x0001, 0x8803 } ->                0000: 00  */  /* READ { 0, 0x0001, 0x8803 } ->                0000: 00  */  /* READ { 0, 0x0001, 0x8802 } ->                0000: 10  */  { 0, 0x0010, 0x8802 },  { 0, 0x0006, 0x8801 },  { 0, 0x001c, 0x8805 },  { 0, 0x0000, 0x8800 },  /* READ { 0, 0x0001, 0x8803 } ->                0000: 00  */  /* READ { 0, 0x0001, 0x8803 } ->                0000: 00  */  /* READ { 0, 0x0001, 0x8802 } ->                0000: 10  */  { 0, 0x0010, 0x8802 },  { 0, 0x0007, 0x8801 },  { 0, 0x002a, 0x8805 },  { 0, 0x0000, 0x8800 },  /* READ { 0, 0x0001, 0x8803 } ->                0000: 00  */  /* READ { 0, 0x0001, 0x8803 } ->                0000: 00  */  /* READ { 0, 0x0001, 0x8802 } ->                0000: 10  */  { 0, 0x0010, 0x8802 },  { 0, 0x000e, 0x8801 },  { 0, 0x0000, 0x8805 },  { 0, 0x0000, 0x8800 },  /* READ { 0, 0x0001, 0x8803 } ->                0000: 00  */  /* READ { 0, 0x0001, 0x8803 } ->                0000: 00  */  /* READ { 0, 0x0001, 0x8802 } ->                0000: 10  */  { 0, 0x0010, 0x8802 },  { 0, 0x0028, 0x8801 },  { 0, 0x002e, 0x8805 },  { 0, 0x0000, 0x8800 },  /* READ { 0, 0x0001, 0x8803 } ->                0000: 00  */  /* READ { 0, 0x0001, 0x8803 } ->                0000: 00  */  /* READ { 0, 0x0001, 0x8802 } ->                0000: 10  */  { 0, 0x0010, 0x8802 },  { 0, 0x0039, 0x8801 },  { 0, 0x0013, 0x8805 },  { 0, 0x0000, 0x8800 },  /* READ { 0, 0x0001, 0x8803 } ->                0000: 00  */  /* READ { 0, 0x0001, 0x8803 } ->                0000: 00  */  /* READ { 0, 0x0001, 0x8802 } ->                0000: 10  */  { 0, 0x0010, 0x8802 },  { 0, 0x003b, 0x8801 },  { 0, 0x000c, 0x8805 },  { 0, 0x0000, 0x8800 },  /* READ { 0, 0x0001, 0x8803 } ->                0000: 00  */  /* READ { 0, 0x0001, 0x8803 } ->                0000: 00  */  /* READ { 0, 0x0001, 0x8802 } ->                0000: 10  */  { 0, 0x0010, 0x8802 },  { 0, 0x0035, 0x8801 },  { 0, 0x0028, 0x8805 },  { 0, 0x0000, 0x8800 },  /* READ { 0, 0x0001, 0x8803 } ->                0000: 00  */  /* READ { 0, 0x0001, 0x8803 } ->                0000: 00  */  /* READ { 0, 0x0001, 0x8802 } ->                0000: 10  */  { 0, 0x0010, 0x8802 },  { 0, 0x0009, 0x8801 },  { 0, 0x0042, 0x8805 },  { 0, 0x0001, 0x8800 },  /* READ { 0, 0x0001, 0x8803 } ->                0000: 00  */  { 0, 0x0050, 0x8703 },  { 0, 0x0002, 0x8704 }, /* External input CKIx1 */  { 0, 0x0001, 0x870C }, /* Select CKOx2 output */  { 0, 0x009A, 0x8600 }, /* Line memory Read Counter (L) */  { 0, 0x0001, 0x8606 }, /* 1 Line memory Read Counter (H) Result: (d)410 */	  { 0, 0x0023, 0x8601 },	  { 0, 0x0010, 0x8602 },	  { 0, 0x000A, 0x8603 },  { 0, 0x009A, 0x8600 },  { 0, 0x0001, 0x865B }, /* 1 Horizontal Offset for Valid Pixel(L) */  { 0, 0x0003, 0x865C }, /* Vertical offset for valid lines (L) */  { 0, 0x0058, 0x865D }, /* Horizontal valid pixels window (L) */  	{ 0, 0x0048, 0x865E }, /* Vertical valid lines window (L) */  	{ 0, 0x0000, 0x865F },  { 0, 0x0006, 0x8660 }, /* Enable nibble data input, select nibble input order */  { 0, 0x0013, 0x8608 }, /* A11 Coeficients for color correction */  { 0, 0x0028, 0x8609 }, /* Note: these values are confirmed at the end of array */  { 0, 0x0005, 0x860A }, /* ... */  { 0, 0x0025, 0x860B },  { 0, 0x00E1, 0x860C },  { 0, 0x00FA, 0x860D },  { 0, 0x00F4, 0x860E },  { 0, 0x00E8, 0x860F },  { 0, 0x0025, 0x8610 }, /* A33 Coef. */  { 0, 0x00FC, 0x8611 }, /* White balance offset: R */  { 0, 0x0001, 0x8612 }, /* White balance offset: Gr */  { 0, 0x00FE, 0x8613 }, /* White balance offset: B */  { 0, 0x0000, 0x8614 }, /* White balance offset: Gb */  { 0, 0x0064, 0x8651 }, /* R gain for white balance (L) */  { 0, 0x0040, 0x8652 }, /* Gr gain for white balance (L) */  { 0, 0x0066, 0x8653 }, /* B gain for white balance (L) */   { 0, 0x0040, 0x8654 }, /* Gb gain for white balance (L) */  { 0, 0x0001, 0x863F }, /* Enable fixed gamma correction */  { 0, 0x00A1, 0x8656 }, /* Size - Window1: 256x256, Window2: 128x128 */  			 /* UV division: UV no change, Enable New edge enhancement */  { 0, 0x0018, 0x8657 }, /* Edge gain high threshold */  { 0, 0x0020, 0x8658 }, /* Edge gain low threshold */  { 0, 0x000A, 0x8659 }, /* Edge bandwidth high threshold */  { 0, 0x0005, 0x865A }, /* Edge bandwidth low threshold */  { 0, 0x0064, 0x8607 }, /* UV filter enable */    { 0, 0x0016, 0x8660 },  { 0, 0x0000, 0x86B0 }, /* Bad pixels compensation address */  { 0, 0x00DC, 0x86B1 }, /* X coord for bad pixels compensation (L) */  { 0, 0x0000, 0x86B2 },   { 0, 0x0009, 0x86B3 }, /* Y coord for bad pixels compensation (L) */  { 0, 0x0000, 0x86B4 },  { 0, 0x0001, 0x86B0 },  { 0, 0x00F5, 0x86B1 },  { 0, 0x0000, 0x86B2 },  { 0, 0x00C6, 0x86B3 },  { 0, 0x0000, 0x86B4 },  { 0, 0x0002, 0x86B0 },  { 0, 0x001C, 0x86B1 },  { 0, 0x0001, 0x86B2 },  { 0, 0x00D7, 0x86B3 },  { 0, 0x0000, 0x86B4 },  { 0, 0x0003, 0x86B0 },  { 0, 0x001C, 0x86B1 },  { 0, 0x0001, 0x86B2 },  { 0, 0x00D8, 0x86B3 },  { 0, 0x0000, 0x86B4 },  { 0, 0x0004, 0x86B0 },  { 0, 0x001D, 0x86B1 },  { 0, 0x0001, 0x86B2 },  { 0, 0x00D8, 0x86B3 },  { 0, 0x0000, 0x86B4 },  { 0, 0x001E, 0x8660 },  /* READ { 0, 0x0000, 0x8608 } ->                0000: 13  */  /* READ { 0, 0x0000, 0x8609 } ->                0000: 28  */  /* READ { 0, 0x0000, 0x8610 } ->                0000: 05  */  /* READ { 0, 0x0000, 0x8611 } ->                0000: 25  */  /* READ { 0, 0x0000, 0x8612 } ->                0000: e1  */  /* READ { 0, 0x0000, 0x8613 } ->                0000: fa  */  /* READ { 0, 0x0000, 0x8614 } ->                0000: f4  */  /* READ { 0, 0x0000, 0x8615 } ->                0000: e8  */  /* READ { 0, 0x0000, 0x8616 } ->                0000: 25  */  { 0,0,0 }};static int config_spca508(struct usb_spca50x *spca50x){	struct usb_device *dev = spca50x->dev;	int data1, data2;		// Read frm global register the USB product and vendor IDs, just to	// prove that we can communicate with the device.  This works, which	// confirms at we are communicating properly and that the device	// is a 508.	data1 = spca50x_reg_read(dev, 0, 0x8104, 1);	if (data1 < 0) PDEBUG(1,"Error reading USB Vendor ID from Global register");	data2 = spca50x_reg_read(dev, 0, 0x8105, 1);	if (data2 < 0) 		PDEBUG(1,"Error reading USB Vendor ID from Global register");	PDEBUG(1, "Read from GLOBAL: USB Vendor ID 0x%02x%02x", data2, data1);		data1=spca50x_reg_read(dev, 0, 0x8106, 1);	if (data1 < 0) 		PDEBUG(1, "Error reading USB Product ID from Global register");	data2 = spca50x_reg_read(dev, 0, 0x8107, 1);	if (data2 < 0) 		PDEBUG(1, "Error reading USB Product ID from Global register");	PDEBUG(1, "Read from GLOBAL: USB Product ID 0x%02x%02x", data2, data1);		data1=spca50x_reg_read(dev, 0, 0x8621, 1);	if (data1 < 0) 		PDEBUG(1, "Error reading Window 1 Average Luminance from Global register");	PDEBUG(1, "Read from GLOBAL: Window 1 average luminance %3d", data1);		switch (spca50x->desc) {		case ViewQuestVQ110:			{				if (spca50x_write_vector				    (spca50x, spca508_init_data))					return -1;				break;			}		case MicroInnovationIC200:		case IntelEasyPCCamera:			{				if (spca50x_write_vector				    (spca50x, spca508cs110_init_data))					return -1;				break;			}		case HamaUSBSightcam:			{				if (spca50x_write_vector				    (spca50x, spca508_sightcam_init_data))					return -1;				break;			}		case HamaUSBSightcam2:			{				if (spca50x_write_vector				    (spca50x, spca508_sightcam2_init_data))					return -1;				break;			}		case CreativeVista:			{			if (spca50x_write_vector				(spca50x, spca508_vista_init_data))				return -1;				break;			}		default:			return -1;	}	return 0; // success}#endif /* SPCA508_INIT_H */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -