Merge master.kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb

* master.kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb: (49 commits)
V4L/DVB (3667b): cpia2: fix function prototype
V4L/DVB (3702): Make msp3400 routing defines more consistent
V4L/DVB (3700): Remove obsolete commands from tvp5150.c
V4L/DVB (3697): More msp3400 and bttv fixes
V4L/DVB (3696): Previous change for cx2341X boards broke the remote support
V4L/DVB (3693): Fix msp3400c and bttv stereo/mono/bilingual detection/handling
V4L/DVB (3692): Keep experimental SLICED_VBI defines under an #if 0
V4L/DVB (3689): Kconfig: fix VP-3054 Secondary I2C Bus build configuration menu dependencies
V4L/DVB (3673): Fix budget-av CAM reset
V4L/DVB (3672): Fix memory leak in dvr open
V4L/DVB (3671): New module parameter 'tv_standard' (dvb-ttpci driver)
V4L/DVB (3670): Fix typo in comment
V4L/DVB (3669): Configurable dma buffer size for saa7146-based budget dvb cards
V4L/DVB (3653h): Move usb v4l docs into Documentation/video4linux
V4L/DVB (3667a): Fix SAP + stereo mode at msp3400
V4L/DVB (3666): Remove trailing newlines
V4L/DVB (3665): Add new NEC uPD64031A and uPD64083 i2c drivers
V4L/DVB (3663): Fix msp3400c wait time and better audio mode fallbacks
V4L/DVB (3662): Don't set msp3400c-non-existent register
V4L/DVB (3661): Add wm8739 stereo audio ADC i2c driver
...

+2102 -866
Documentation/usb/et61x251.txt Documentation/video4linux/et61x251.txt
+1 -1
Documentation/usb/ibmcam.txt Documentation/video4linux/ibmcam.txt
··· 122 122 - A Linux box with USB support (2.3/2.4; 2.2 w/backport may work) 123 123 124 124 - A Video4Linux compatible frame grabber program such as xawtv. 125 - 125 + 126 126 HOW TO COMPILE THE DRIVER: 127 127 128 128 You need to compile the driver only if you are a developer
+5 -6
Documentation/usb/ov511.txt Documentation/video4linux/ov511.txt
··· 9 9 10 10 This is a driver for the OV511, a USB-only chip used in many "webcam" devices. 11 11 Any camera using the OV511/OV511+ and the OV6620/OV7610/20/20AE should work. 12 - Video capture devices that use the Philips SAA7111A decoder also work. It 12 + Video capture devices that use the Philips SAA7111A decoder also work. It 13 13 supports streaming and capture of color or monochrome video via the Video4Linux 14 14 API. Most V4L apps are compatible with it. Most resolutions with a width and 15 15 height that are a multiple of 8 are supported. ··· 52 52 53 53 chmod 666 /dev/video 54 54 chmod 666 /dev/video0 (if necessary) 55 - 55 + 56 56 Now you are ready to run a video app! Both vidcat and xawtv work well for me 57 57 at 640x480. 58 - 58 + 59 59 [Using vidcat:] 60 60 61 61 vidcat -s 640x480 -p c > test.jpg 62 62 xview test.jpg 63 - 63 + 64 64 [Using xawtv:] 65 65 66 66 From the main xawtv directory: ··· 70 70 make 71 71 make install 72 72 73 - Now you should be able to run xawtv. Right click for the options dialog. 73 + Now you should be able to run xawtv. Right click for the options dialog. 74 74 75 75 MODULE PARAMETERS: 76 76 ··· 286 286 and the USB stack. Thanks to Bret Wallach for getting camera reg IO, ISOC, and 287 287 image capture working. Thanks to Orion Sky Lawlor, Kevin Moore, and Claudio 288 288 Matsuoka for their work as well. 289 -
Documentation/usb/se401.txt Documentation/video4linux/se401.txt
+8 -8
Documentation/usb/sn9c102.txt Documentation/video4linux/sn9c102.txt
··· 174 174 ------------------------------------------------------------------------------- 175 175 Name: video_nr 176 176 Type: short array (min = 0, max = 64) 177 - Syntax: <-1|n[,...]> 177 + Syntax: <-1|n[,...]> 178 178 Description: Specify V4L2 minor mode number: 179 179 -1 = use next available 180 180 n = use minor number n ··· 187 187 ------------------------------------------------------------------------------- 188 188 Name: force_munmap 189 189 Type: bool array (min = 0, max = 64) 190 - Syntax: <0|1[,...]> 190 + Syntax: <0|1[,...]> 191 191 Description: Force the application to unmap previously mapped buffer memory 192 192 before calling any VIDIOC_S_CROP or VIDIOC_S_FMT ioctl's. Not 193 193 all the applications support this feature. This parameter is ··· 206 206 ------------------------------------------------------------------------------- 207 207 Name: debug 208 208 Type: ushort 209 - Syntax: <n> 209 + Syntax: <n> 210 210 Description: Debugging information level, from 0 to 3: 211 211 0 = none (use carefully) 212 212 1 = critical errors ··· 267 267 frame header of the most recent requested and captured video frame. The header 268 268 is always 18-bytes long and is appended to every video frame by the SN9C10x 269 269 controllers. As an example, this additional information can be used by the user 270 - application for implementing auto-exposure features via software. 270 + application for implementing auto-exposure features via software. 271 271 272 272 The following table describes the frame header: 273 273 ··· 441 441 value and is disposed in memory according to the pattern shown below: 442 442 443 443 B[0] G[1] B[2] G[3] ... B[m-2] G[m-1] 444 - G[m] R[m+1] G[m+2] R[m+2] ... G[2m-2] R[2m-1] 444 + G[m] R[m+1] G[m+2] R[m+2] ... G[2m-2] R[2m-1] 445 445 ... 446 446 ... B[(n-1)(m-2)] G[(n-1)(m-1)] 447 447 ... G[n(m-2)] R[n(m-1)] ··· 472 472 The algorithm purely describes the conversion from compressed Bayer code used 473 473 in the SN9C10x chips to uncompressed Bayer. Additional steps are required to 474 474 convert this to a color image (i.e. a color interpolation algorithm). 475 - 475 + 476 476 The following Huffman codes have been found: 477 - 0: +0 (relative to reference pixel value) 477 + 0: +0 (relative to reference pixel value) 478 478 100: +4 479 479 101: -4? 480 - 1110xxxx: set absolute value to xxxx.0000 480 + 1110xxxx: set absolute value to xxxx.0000 481 481 1101: +11 482 482 1111: -11 483 483 11001: +20
+11 -13
Documentation/usb/stv680.txt Documentation/video4linux/stv680.txt
··· 5 5 6 6 INTRODUCTION: 7 7 8 - STMicroelectronics produces the STV0680B chip, which comes in two 9 - types, -001 and -003. The -003 version allows the recording and downloading 10 - of sound clips from the camera, and allows a flash attachment. Otherwise, 11 - it uses the same commands as the -001 version. Both versions support a 12 - variety of SDRAM sizes and sensors, allowing for a maximum of 26 VGA or 20 13 - CIF pictures. The STV0680 supports either a serial or a usb interface, and 8 + STMicroelectronics produces the STV0680B chip, which comes in two 9 + types, -001 and -003. The -003 version allows the recording and downloading 10 + of sound clips from the camera, and allows a flash attachment. Otherwise, 11 + it uses the same commands as the -001 version. Both versions support a 12 + variety of SDRAM sizes and sensors, allowing for a maximum of 26 VGA or 20 13 + CIF pictures. The STV0680 supports either a serial or a usb interface, and 14 14 video is possible through the usb interface. 15 15 16 - The following cameras are known to work with this driver, although any 16 + The following cameras are known to work with this driver, although any 17 17 camera with Vendor/Product codes of 0553/0202 should work: 18 18 19 19 Aiptek Pencam (various models) ··· 34 34 MODULE OPTIONS: 35 35 36 36 When the driver is compiled as a module, you can set a "swapRGB=1" 37 - option, if necessary, for those applications that require it 38 - (such as xawtv). However, the driver should detect and set this 37 + option, if necessary, for those applications that require it 38 + (such as xawtv). However, the driver should detect and set this 39 39 automatically, so this option should not normally be used. 40 40 41 41 42 42 KNOWN PROBLEMS: 43 43 44 - The driver seems to work better with the usb-ohci than the usb-uhci host 45 - controller driver. 44 + The driver seems to work better with the usb-ohci than the usb-uhci host 45 + controller driver. 46 46 47 47 HELP: 48 48 ··· 51 51 http://stv0680-usb.sourceforge.net 52 52 53 53 Any questions to me can be send to: kjsisson@bellsouth.net 54 - 55 -
+18 -18
Documentation/usb/w9968cf.txt Documentation/video4linux/w9968cf.txt
··· 1 1 2 - W996[87]CF JPEG USB Dual Mode Camera Chip 2 + W996[87]CF JPEG USB Dual Mode Camera Chip 3 3 Driver for Linux 2.6 (basic version) 4 4 ========================================= 5 5 ··· 115 115 ====================== 116 116 For it to work properly, the driver needs kernel support for Video4Linux, USB 117 117 and I2C, and the "ovcamchip" module for the image sensor. Make sure you are not 118 - actually using any external "ovcamchip" module, given that the W996[87]CF 118 + actually using any external "ovcamchip" module, given that the W996[87]CF 119 119 driver depends on the version of the module present in the official kernels. 120 120 121 121 The following options of the kernel configuration file must be enabled and ··· 197 197 enabled for the 'ovcamchip' module to be loaded and for 198 198 this parameter to be present. 199 199 ------------------------------------------------------------------------------- 200 - Name: simcams 201 - Type: int 202 - Syntax: <n> 200 + Name: simcams 201 + Type: int 202 + Syntax: <n> 203 203 Description: Number of cameras allowed to stream simultaneously. 204 204 n may vary from 0 to 32. 205 205 Default: 32 206 206 ------------------------------------------------------------------------------- 207 207 Name: video_nr 208 208 Type: int array (min = 0, max = 32) 209 - Syntax: <-1|n[,...]> 209 + Syntax: <-1|n[,...]> 210 210 Description: Specify V4L minor mode number. 211 211 -1 = use next available 212 212 n = use minor number n ··· 219 219 ------------------------------------------------------------------------------- 220 220 Name: packet_size 221 221 Type: int array (min = 0, max = 32) 222 - Syntax: <n[,...]> 222 + Syntax: <n[,...]> 223 223 Description: Specify the maximum data payload size in bytes for alternate 224 224 settings, for each device. n is scaled between 63 and 1023. 225 225 Default: 1023 ··· 234 234 ------------------------------------------------------------------------------- 235 235 Name: double_buffer 236 236 Type: bool array (min = 0, max = 32) 237 - Syntax: <0|1[,...]> 237 + Syntax: <0|1[,...]> 238 238 Description: Hardware double buffering: 0 disabled, 1 enabled. 239 239 It should be enabled if you want smooth video output: if you 240 240 obtain out of sync. video, disable it, or try to ··· 243 243 ------------------------------------------------------------------------------- 244 244 Name: clamping 245 245 Type: bool array (min = 0, max = 32) 246 - Syntax: <0|1[,...]> 246 + Syntax: <0|1[,...]> 247 247 Description: Video data clamping: 0 disabled, 1 enabled. 248 248 Default: 0 for every device. 249 249 ------------------------------------------------------------------------------- 250 250 Name: filter_type 251 251 Type: int array (min = 0, max = 32) 252 - Syntax: <0|1|2[,...]> 252 + Syntax: <0|1|2[,...]> 253 253 Description: Video filter type. 254 254 0 none, 1 (1-2-1) 3-tap filter, 2 (2-3-6-3-2) 5-tap filter. 255 255 The filter is used to reduce noise and aliasing artifacts ··· 258 258 ------------------------------------------------------------------------------- 259 259 Name: largeview 260 260 Type: bool array (min = 0, max = 32) 261 - Syntax: <0|1[,...]> 261 + Syntax: <0|1[,...]> 262 262 Description: Large view: 0 disabled, 1 enabled. 263 263 Default: 1 for every device. 264 264 ------------------------------------------------------------------------------- 265 265 Name: upscaling 266 266 Type: bool array (min = 0, max = 32) 267 - Syntax: <0|1[,...]> 267 + Syntax: <0|1[,...]> 268 268 Description: Software scaling (for non-compressed video only): 269 269 0 disabled, 1 enabled. 270 270 Disable it if you have a slow CPU or you don't have enough ··· 341 341 ------------------------------------------------------------------------------- 342 342 Name: bandingfilter 343 343 Type: bool array (min = 0, max = 32) 344 - Syntax: <0|1[,...]> 345 - Description: Banding filter to reduce effects of fluorescent 344 + Syntax: <0|1[,...]> 345 + Description: Banding filter to reduce effects of fluorescent 346 346 lighting: 347 347 0 disabled, 1 enabled. 348 348 This filter tries to reduce the pattern of horizontal ··· 374 374 ------------------------------------------------------------------------------- 375 375 Name: monochrome 376 376 Type: bool array (min = 0, max = 32) 377 - Syntax: <0|1[,...]> 377 + Syntax: <0|1[,...]> 378 378 Description: The image sensor is monochrome: 379 379 0 = no, 1 = yes 380 380 Default: 0 for every device. ··· 400 400 ------------------------------------------------------------------------------- 401 401 Name: contrast 402 402 Type: long array (min = 0, max = 32) 403 - Syntax: <n[,...]> 403 + Syntax: <n[,...]> 404 404 Description: Set picture contrast (0-65535). 405 405 Default: 50000 for every device. 406 406 ------------------------------------------------------------------------------- 407 407 Name: whiteness 408 408 Type: long array (min = 0, max = 32) 409 - Syntax: <n[,...]> 409 + Syntax: <n[,...]> 410 410 Description: Set picture whiteness (0-65535). 411 411 Default: 32768 for every device. 412 412 ------------------------------------------------------------------------------- 413 413 Name: debug 414 414 Type: int 415 - Syntax: <n> 415 + Syntax: <n> 416 416 Description: Debugging information level, from 0 to 6: 417 417 0 = none (use carefully) 418 418 1 = critical errors
Documentation/usb/zc0301.txt Documentation/video4linux/zc0301.txt
+3 -2
Documentation/video4linux/CARDLIST.saa7134
··· 52 52 51 -> ProVideo PV952 [1540:9524] 53 53 52 -> AverMedia AverTV/305 [1461:2108] 54 54 53 -> ASUS TV-FM 7135 [1043:4845] 55 - 54 -> LifeView FlyTV Platinum FM [5168:0214,1489:0214] 55 + 54 -> LifeView FlyTV Platinum FM / Gold [5168:0214,1489:0214,5168:0304] 56 56 55 -> LifeView FlyDVB-T DUO [5168:0306] 57 57 56 -> Avermedia AVerTV 307 [1461:a70a] 58 58 57 -> Avermedia AVerTV GO 007 FM [1461:f31f] ··· 84 84 83 -> Terratec Cinergy 250 PCI TV [153b:1160] 85 85 84 -> LifeView FlyDVB Trio [5168:0319] 86 86 85 -> AverTV DVB-T 777 [1461:2c05] 87 - 86 -> LifeView FlyDVB-T [5168:0301] 87 + 86 -> LifeView FlyDVB-T / Genius VideoWonder DVB-T [5168:0301,1489:0301] 88 88 87 -> ADS Instant TV Duo Cardbus PTV331 [0331:1421] 89 89 88 -> Tevion/KWorld DVB-T 220RF [17de:7201] 90 90 89 -> ELSA EX-VISION 700TV [1048:226c] ··· 92 92 91 -> AVerMedia A169 B [1461:7360] 93 93 92 -> AVerMedia A169 B1 [1461:6360] 94 94 93 -> Medion 7134 Bridge #2 [16be:0005] 95 + 94 -> LifeView FlyDVB-T Hybrid Cardbus [5168:3306,5168:3502]
+11 -11
drivers/media/Kconfig
··· 51 51 tristate 52 52 53 53 config USB_DABUSB 54 - tristate "DABUSB driver" 55 - depends on USB 56 - ---help--- 57 - A Digital Audio Broadcasting (DAB) Receiver for USB and Linux 58 - brought to you by the DAB-Team 59 - <http://wwwbode.cs.tum.edu/Par/arch/dab/>. This driver can be taken 60 - as an example for URB-based bulk, control, and isochronous 61 - transactions. URB's are explained in 62 - <Documentation/usb/URB.txt>. 54 + tristate "DABUSB driver" 55 + depends on USB 56 + ---help--- 57 + A Digital Audio Broadcasting (DAB) Receiver for USB and Linux 58 + brought to you by the DAB-Team 59 + <http://wwwbode.cs.tum.edu/Par/arch/dab/>. This driver can be taken 60 + as an example for URB-based bulk, control, and isochronous 61 + transactions. URB's are explained in 62 + <Documentation/usb/URB.txt>. 63 63 64 - To compile this driver as a module, choose M here: the 65 - module will be called dabusb. 64 + To compile this driver as a module, choose M here: the 65 + module will be called dabusb. 66 66 67 67 endmenu 68 68
+1
drivers/media/dvb/bt8xx/Kconfig
··· 7 7 select DVB_CX24110 8 8 select DVB_OR51211 9 9 select DVB_LGDT330X 10 + select FW_LOADER 10 11 help 11 12 Support for PCI cards based on the Bt8xx PCI bridge. Examples are 12 13 the Nebula cards, the Pinnacle PCTV cards, the Twinhan DST cards,
+9 -3
drivers/media/dvb/dvb-core/dmxdev.c
··· 141 141 } 142 142 143 143 if ((file->f_flags & O_ACCMODE) == O_RDONLY) { 144 - void *mem = vmalloc(DVR_BUFFER_SIZE); 144 + void *mem; 145 + if (!dvbdev->readers) { 146 + mutex_unlock(&dmxdev->mutex); 147 + return -EBUSY; 148 + } 149 + mem = vmalloc(DVR_BUFFER_SIZE); 145 150 if (!mem) { 146 151 mutex_unlock(&dmxdev->mutex); 147 152 return -ENOMEM; 148 153 } 149 154 dvb_ringbuffer_init(&dmxdev->dvr_buffer, mem, DVR_BUFFER_SIZE); 155 + dvbdev->readers--; 150 156 } 151 157 152 158 if ((file->f_flags & O_ACCMODE) == O_WRONLY) { ··· 190 184 dmxdev->dvr_orig_fe); 191 185 } 192 186 if ((file->f_flags & O_ACCMODE) == O_RDONLY) { 187 + dvbdev->readers++; 193 188 if (dmxdev->dvr_buffer.data) { 194 189 void *mem = dmxdev->dvr_buffer.data; 195 190 mb(); ··· 1036 1029 1037 1030 static struct dvb_device dvbdev_dvr = { 1038 1031 .priv = NULL, 1039 - .users = 1, 1040 - .writers = 1, 1032 + .readers = 1, 1041 1033 .fops = &dvb_dvr_fops 1042 1034 }; 1043 1035
+17 -1
drivers/media/dvb/dvb-core/dvb_frontend.c
··· 105 105 fe_status_t status; 106 106 unsigned long tune_mode_flags; 107 107 unsigned int delay; 108 + unsigned int reinitialise; 108 109 109 110 /* swzigzag values */ 110 111 unsigned int state; ··· 122 121 unsigned int check_wrapped; 123 122 }; 124 123 124 + static void dvb_frontend_wakeup(struct dvb_frontend *fe); 125 125 126 126 static void dvb_frontend_add_event(struct dvb_frontend *fe, fe_status_t status) 127 127 { ··· 214 212 if (fe->ops->init) 215 213 fe->ops->init(fe); 216 214 } 215 + 216 + void dvb_frontend_reinitialise(struct dvb_frontend *fe) 217 + { 218 + struct dvb_frontend_private *fepriv = fe->frontend_priv; 219 + 220 + fepriv->reinitialise = 1; 221 + dvb_frontend_wakeup(fe); 222 + } 223 + EXPORT_SYMBOL(dvb_frontend_reinitialise); 217 224 218 225 static void dvb_frontend_swzigzag_update_delay(struct dvb_frontend_private *fepriv, int locked) 219 226 { ··· 516 505 fepriv->quality = 0; 517 506 fepriv->delay = 3*HZ; 518 507 fepriv->status = 0; 519 - dvb_frontend_init(fe); 520 508 fepriv->wakeup = 0; 509 + fepriv->reinitialise = 1; 521 510 522 511 while (1) { 523 512 up(&fepriv->sem); /* is locked when we enter the thread... */ ··· 534 523 535 524 if (down_interruptible(&fepriv->sem)) 536 525 break; 526 + 527 + if (fepriv->reinitialise) { 528 + dvb_frontend_init(fe); 529 + fepriv->reinitialise = 0; 530 + } 537 531 538 532 /* do an iteration of the tuning loop */ 539 533 if (fe->ops->tune) {
+2
drivers/media/dvb/dvb-core/dvb_frontend.h
··· 112 112 113 113 extern int dvb_unregister_frontend(struct dvb_frontend* fe); 114 114 115 + extern void dvb_frontend_reinitialise(struct dvb_frontend *fe); 116 + 115 117 extern void dvb_frontend_sleep_until(struct timeval *waketime, u32 add_usec); 116 118 extern s32 timeval_usec_diff(struct timeval lasttime, struct timeval curtime); 117 119
+54
drivers/media/dvb/dvb-usb/cxusb.c
··· 233 233 { 0xfe, 0x4e, KEY_POWER }, 234 234 }; 235 235 236 + static struct dvb_usb_rc_key dvico_portable_rc_keys[] = { 237 + { 0xfc, 0x02, KEY_SETUP }, /* Profile */ 238 + { 0xfc, 0x43, KEY_POWER2 }, 239 + { 0xfc, 0x06, KEY_EPG }, 240 + { 0xfc, 0x5a, KEY_BACK }, 241 + { 0xfc, 0x05, KEY_MENU }, 242 + { 0xfc, 0x47, KEY_INFO }, 243 + { 0xfc, 0x01, KEY_TAB }, 244 + { 0xfc, 0x42, KEY_PREVIOUSSONG },/* Replay */ 245 + { 0xfc, 0x49, KEY_VOLUMEUP }, 246 + { 0xfc, 0x09, KEY_VOLUMEDOWN }, 247 + { 0xfc, 0x54, KEY_CHANNELUP }, 248 + { 0xfc, 0x0b, KEY_CHANNELDOWN }, 249 + { 0xfc, 0x16, KEY_CAMERA }, 250 + { 0xfc, 0x40, KEY_TUNER }, /* ATV/DTV */ 251 + { 0xfc, 0x45, KEY_OPEN }, 252 + { 0xfc, 0x19, KEY_1 }, 253 + { 0xfc, 0x18, KEY_2 }, 254 + { 0xfc, 0x1b, KEY_3 }, 255 + { 0xfc, 0x1a, KEY_4 }, 256 + { 0xfc, 0x58, KEY_5 }, 257 + { 0xfc, 0x59, KEY_6 }, 258 + { 0xfc, 0x15, KEY_7 }, 259 + { 0xfc, 0x14, KEY_8 }, 260 + { 0xfc, 0x17, KEY_9 }, 261 + { 0xfc, 0x44, KEY_ANGLE }, /* Aspect */ 262 + { 0xfc, 0x55, KEY_0 }, 263 + { 0xfc, 0x07, KEY_ZOOM }, 264 + { 0xfc, 0x0a, KEY_REWIND }, 265 + { 0xfc, 0x08, KEY_PLAYPAUSE }, 266 + { 0xfc, 0x4b, KEY_FASTFORWARD }, 267 + { 0xfc, 0x5b, KEY_MUTE }, 268 + { 0xfc, 0x04, KEY_STOP }, 269 + { 0xfc, 0x56, KEY_RECORD }, 270 + { 0xfc, 0x57, KEY_POWER }, 271 + { 0xfc, 0x41, KEY_UNKNOWN }, /* INPUT */ 272 + { 0xfc, 0x00, KEY_UNKNOWN }, /* HD */ 273 + }; 274 + 236 275 static int cxusb_dee1601_demod_init(struct dvb_frontend* fe) 237 276 { 238 277 static u8 clock_config [] = { CLOCK_CTL, 0x38, 0x28 }; ··· 550 511 551 512 .i2c_algo = &cxusb_i2c_algo, 552 513 514 + .rc_interval = 100, 515 + .rc_key_map = dvico_portable_rc_keys, 516 + .rc_key_map_size = ARRAY_SIZE(dvico_portable_rc_keys), 517 + .rc_query = cxusb_rc_query, 518 + 553 519 .generic_bulk_ctrl_endpoint = 0x01, 554 520 /* parameter for the MPEG2-data transfer */ 555 521 .urb = { ··· 644 600 645 601 .i2c_algo = &cxusb_i2c_algo, 646 602 603 + .rc_interval = 100, 604 + .rc_key_map = dvico_portable_rc_keys, 605 + .rc_key_map_size = ARRAY_SIZE(dvico_portable_rc_keys), 606 + .rc_query = cxusb_rc_query, 607 + 647 608 .generic_bulk_ctrl_endpoint = 0x01, 648 609 /* parameter for the MPEG2-data transfer */ 649 610 .urb = { ··· 688 639 .tuner_attach = cxusb_dtt7579_tuner_attach, 689 640 690 641 .i2c_algo = &cxusb_i2c_algo, 642 + 643 + .rc_interval = 100, 644 + .rc_key_map = dvico_portable_rc_keys, 645 + .rc_key_map_size = ARRAY_SIZE(dvico_portable_rc_keys), 646 + .rc_query = cxusb_rc_query, 691 647 692 648 .generic_bulk_ctrl_endpoint = 0x01, 693 649 /* parameter for the MPEG2-data transfer */
+46 -1
drivers/media/dvb/dvb-usb/dtt200u.c
··· 94 94 95 95 static struct dvb_usb_properties dtt200u_properties; 96 96 static struct dvb_usb_properties wt220u_properties; 97 + static struct dvb_usb_properties wt220u_zl0353_properties; 97 98 98 99 static int dtt200u_usb_probe(struct usb_interface *intf, 99 100 const struct usb_device_id *id) 100 101 { 101 102 if (dvb_usb_device_init(intf,&dtt200u_properties,THIS_MODULE,NULL) == 0 || 102 - dvb_usb_device_init(intf,&wt220u_properties,THIS_MODULE,NULL) == 0) 103 + dvb_usb_device_init(intf,&wt220u_properties,THIS_MODULE,NULL) == 0 || 104 + dvb_usb_device_init(intf,&wt220u_zl0353_properties,THIS_MODULE,NULL) == 0) 103 105 return 0; 104 106 105 107 return -ENODEV; ··· 112 110 { USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_DTT200U_WARM) }, 113 111 { USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_WT220U_COLD) }, 114 112 { USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_WT220U_WARM) }, 113 + { USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_WT220U_ZL0353_COLD) }, 114 + { USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_WT220U_ZL0353_WARM) }, 115 115 { 0 }, 116 116 }; 117 117 MODULE_DEVICE_TABLE(usb, dtt200u_usb_table); ··· 195 191 { .name = "WideView WT-220U PenType Receiver (Typhoon/Freecom)", 196 192 .cold_ids = { &dtt200u_usb_table[2], NULL }, 197 193 .warm_ids = { &dtt200u_usb_table[3], NULL }, 194 + }, 195 + { NULL }, 196 + } 197 + }; 198 + 199 + static struct dvb_usb_properties wt220u_zl0353_properties = { 200 + .caps = DVB_USB_HAS_PID_FILTER | DVB_USB_NEED_PID_FILTERING, 201 + .pid_filter_count = 15, 202 + 203 + .usb_ctrl = CYPRESS_FX2, 204 + .firmware = "dvb-usb-wt220u-zl0353-01.fw", 205 + 206 + .power_ctrl = dtt200u_power_ctrl, 207 + .streaming_ctrl = dtt200u_streaming_ctrl, 208 + .pid_filter = dtt200u_pid_filter, 209 + .frontend_attach = dtt200u_frontend_attach, 210 + 211 + .rc_interval = 300, 212 + .rc_key_map = dtt200u_rc_keys, 213 + .rc_key_map_size = ARRAY_SIZE(dtt200u_rc_keys), 214 + .rc_query = dtt200u_rc_query, 215 + 216 + .generic_bulk_ctrl_endpoint = 0x01, 217 + 218 + /* parameter for the MPEG2-data transfer */ 219 + .urb = { 220 + .type = DVB_USB_BULK, 221 + .count = 7, 222 + .endpoint = 0x02, 223 + .u = { 224 + .bulk = { 225 + .buffersize = 4096, 226 + } 227 + } 228 + }, 229 + 230 + .num_device_descs = 1, 231 + .devices = { 232 + { .name = "WideView WT-220U PenType Receiver (based on ZL353)", 233 + .cold_ids = { &dtt200u_usb_table[4], NULL }, 234 + .warm_ids = { &dtt200u_usb_table[5], NULL }, 198 235 }, 199 236 { NULL }, 200 237 }
+2
drivers/media/dvb/dvb-usb/dvb-usb-ids.h
··· 83 83 #define USB_PID_DTT200U_WARM 0x0301 84 84 #define USB_PID_WT220U_COLD 0x0222 85 85 #define USB_PID_WT220U_WARM 0x0221 86 + #define USB_PID_WT220U_ZL0353_COLD 0x022a 87 + #define USB_PID_WT220U_ZL0353_WARM 0x022b 86 88 #define USB_PID_WINTV_NOVA_T_USB2_COLD 0x9300 87 89 #define USB_PID_WINTV_NOVA_T_USB2_WARM 0x9301 88 90 #define USB_PID_NEBULA_DIGITV 0x0201
+3 -2
drivers/media/dvb/dvb-usb/vp702x-fe.c
··· 147 147 cmd[4] = (sr >> 4) & 0xff; 148 148 cmd[5] = (sr << 4) & 0xf0; 149 149 150 - deb_fe("setting frontend to: %u -> %u (%x) LNB-based GHz, symbolrate: %d -> %Lu (%Lx)\n", 151 - fep->frequency,freq,freq, fep->u.qpsk.symbol_rate, sr, sr); 150 + deb_fe("setting frontend to: %u -> %u (%x) LNB-based GHz, symbolrate: %d -> %lu (%lx)\n", 151 + fep->frequency,freq,freq, fep->u.qpsk.symbol_rate, 152 + (unsigned long) sr, (unsigned long) sr); 152 153 153 154 /* if (fep->inversion == INVERSION_ON) 154 155 cmd[6] |= 0x80; */
+12
drivers/media/dvb/frontends/Kconfig
··· 181 181 help 182 182 An ATSC 8VSB tuner module. Say Y when you want to support this frontend. 183 183 184 + This driver needs external firmware. Please use the command 185 + "<kerneldir>/Documentation/dvb/get_dvb_firmware or51211" to 186 + download it, and then copy it to /usr/lib/hotplug/firmware 187 + or /lib/firmware (depending on configuration of firmware hotplug). 188 + 184 189 config DVB_OR51132 185 190 tristate "Oren OR51132 based" 186 191 depends on DVB_CORE ··· 193 188 help 194 189 An ATSC 8VSB and QAM64/256 tuner module. Say Y when you want 195 190 to support this frontend. 191 + 192 + This driver needs external firmware. Please use the commands 193 + "<kerneldir>/Documentation/dvb/get_dvb_firmware or51132_vsb" and/or 194 + "<kerneldir>/Documentation/dvb/get_dvb_firmware or51132_qam" to 195 + download firmwares for 8VSB and QAM64/256, respectively. Copy them to 196 + /usr/lib/hotplug/firmware or /lib/firmware (depending on 197 + configuration of firmware hotplug). 196 198 197 199 config DVB_BCM3510 198 200 tristate "Broadcom BCM3510"
-12
drivers/media/dvb/frontends/tda1004x.c
··· 52 52 struct dvb_frontend frontend; 53 53 54 54 /* private demod data */ 55 - u8 initialised; 56 55 enum tda1004x_demod demod_type; 57 56 }; 58 57 ··· 593 594 594 595 dprintk("%s\n", __FUNCTION__); 595 596 596 - if (state->initialised) 597 - return 0; 598 - 599 597 if (tda10045_fwupload(fe)) { 600 598 printk("tda1004x: firmware upload failed\n"); 601 599 return -EIO; ··· 622 626 623 627 tda1004x_write_mask(state, 0x1f, 0x01, state->config->invert_oclk); 624 628 625 - state->initialised = 1; 626 629 return 0; 627 630 } 628 631 ··· 629 634 { 630 635 struct tda1004x_state* state = fe->demodulator_priv; 631 636 dprintk("%s\n", __FUNCTION__); 632 - 633 - if (state->initialised) 634 - return 0; 635 637 636 638 if (tda10046_fwupload(fe)) { 637 639 printk("tda1004x: firmware upload failed\n"); ··· 689 697 // tda1004x_write_mask(state, 0x50, 0x80, 0x80); // handle out of guard echoes 690 698 tda1004x_write_mask(state, 0x3a, 0x80, state->config->invert_oclk << 7); 691 699 692 - state->initialised = 1; 693 700 return 0; 694 701 } 695 702 ··· 1198 1207 tda1004x_write_mask(state, TDA1004X_CONFC4, 1, 1); 1199 1208 break; 1200 1209 } 1201 - state->initialised = 0; 1202 1210 1203 1211 return 0; 1204 1212 } ··· 1261 1271 state->config = config; 1262 1272 state->i2c = i2c; 1263 1273 memcpy(&state->ops, &tda10045_ops, sizeof(struct dvb_frontend_ops)); 1264 - state->initialised = 0; 1265 1274 state->demod_type = TDA1004X_DEMOD_TDA10045; 1266 1275 1267 1276 /* check if the demod is there */ ··· 1319 1330 state->config = config; 1320 1331 state->i2c = i2c; 1321 1332 memcpy(&state->ops, &tda10046_ops, sizeof(struct dvb_frontend_ops)); 1322 - state->initialised = 0; 1323 1333 state->demod_type = TDA1004X_DEMOD_TDA10046; 1324 1334 1325 1335 /* check if the demod is there */
+7 -1
drivers/media/dvb/ttpci/av7110.c
··· 87 87 static int budgetpatch; 88 88 static int wss_cfg_4_3 = 0x4008; 89 89 static int wss_cfg_16_9 = 0x0007; 90 + static int tv_standard; 90 91 91 92 module_param_named(debug, av7110_debug, int, 0644); 92 93 MODULE_PARM_DESC(debug, "debug level (bitmask, default 0)"); ··· 110 109 MODULE_PARM_DESC(wss_cfg_4_3, "WSS 4:3 - default 0x4008 - bit 15: disable, 14: burst mode, 13..0: wss data"); 111 110 module_param(wss_cfg_16_9, int, 0444); 112 111 MODULE_PARM_DESC(wss_cfg_16_9, "WSS 16:9 - default 0x0007 - bit 15: disable, 14: burst mode, 13..0: wss data"); 112 + module_param(tv_standard, int, 0444); 113 + MODULE_PARM_DESC(tv_standard, "TV standard: 0 PAL (default), 1 NTSC"); 113 114 114 115 static void restart_feeds(struct av7110 *av7110); 115 116 ··· 2126 2123 read_pwm(av7110)); 2127 2124 break; 2128 2125 case 0x0003: 2129 - /* Haupauge DVB-C 2.1 VES1820/ALPS TDBE2 */ 2126 + /* Hauppauge DVB-C 2.1 VES1820/ALPS TDBE2 */ 2130 2127 av7110->fe = ves1820_attach(&alps_tdbe2_config, &av7110->i2c_adap, 2131 2128 read_pwm(av7110)); 2132 2129 break; ··· 2545 2542 /* default OSD window */ 2546 2543 av7110->osdwin = 1; 2547 2544 mutex_init(&av7110->osd_mutex); 2545 + 2546 + /* TV standard */ 2547 + av7110->vidmode = tv_standard == 1 ? VIDEO_MODE_NTSC : VIDEO_MODE_PAL; 2548 2548 2549 2549 /* ARM "watchdog" */ 2550 2550 init_waitqueue_head(&av7110->arm_wait);
-2
drivers/media/dvb/ttpci/av7110_av.c
··· 1479 1479 void (*play[])(u8 *, int, void *) = { play_audio_cb, play_video_cb }; 1480 1480 int i, ret; 1481 1481 1482 - av7110->vidmode = VIDEO_MODE_PAL; 1483 - 1484 1482 for (i = 0; i < 2; i++) { 1485 1483 struct ipack *ipack = av7110->ipack + i; 1486 1484
+8 -5
drivers/media/dvb/ttpci/budget-av.c
··· 60 60 struct dvb_ca_en50221 ca; 61 61 }; 62 62 63 - /* GPIO CI Connections: 64 - * 0 - Vcc/Reset (Reset is controlled by capacitor) 65 - * 1 - Attribute Memory 66 - * 2 - Card Enable (Active Low) 67 - * 3 - Card Detect 63 + /* GPIO Connections: 64 + * 0 - Vcc/Reset (Reset is controlled by capacitor). Resets the frontend *AS WELL*! 65 + * 1 - CI memory select 0=>IO memory, 1=>Attribute Memory 66 + * 2 - CI Card Enable (Active Low) 67 + * 3 - CI Card Detect 68 68 */ 69 69 70 70 /**************************************************************************** ··· 213 213 * but AFAICS it is not routed to the saa7146 */ 214 214 while (--timeout > 0 && ciintf_read_attribute_mem(ca, slot, 0) != 0x1d) 215 215 msleep(100); 216 + 217 + /* reinitialise the frontend */ 218 + dvb_frontend_reinitialise(budget_av->budget.dvb_frontend); 216 219 217 220 if (timeout <= 0) 218 221 {
+63 -15
drivers/media/dvb/ttpci/budget-core.c
··· 39 39 #include "budget.h" 40 40 #include "ttpci-eeprom.h" 41 41 42 + #define TS_WIDTH (2 * TS_SIZE) 43 + #define TS_WIDTH_ACTIVY TS_SIZE 44 + #define TS_HEIGHT_MASK 0xf00 45 + #define TS_HEIGHT_MASK_ACTIVY 0xc00 46 + #define TS_MIN_BUFSIZE_K 188 47 + #define TS_MAX_BUFSIZE_K 1410 48 + #define TS_MAX_BUFSIZE_K_ACTIVY 564 49 + #define BUFFER_WARNING_WAIT (30*HZ) 50 + 42 51 int budget_debug; 52 + static int dma_buffer_size = TS_MIN_BUFSIZE_K; 43 53 module_param_named(debug, budget_debug, int, 0644); 54 + module_param_named(bufsize, dma_buffer_size, int, 0444); 44 55 MODULE_PARM_DESC(debug, "Turn on/off budget debugging (default:off)."); 56 + MODULE_PARM_DESC(bufsize, "DMA buffer size in KB, default: 188, min: 188, max: 1410 (Activy: 564)"); 45 57 46 58 /**************************************************************************** 47 59 * TT budget / WinTV Nova ··· 82 70 83 71 saa7146_write(dev, MC1, MASK_20); // DMA3 off 84 72 85 - memset(budget->grabbing, 0x00, TS_HEIGHT * TS_WIDTH); 73 + memset(budget->grabbing, 0x00, budget->buffer_size); 86 74 87 75 saa7146_write(dev, PCI_BT_V1, 0x001c0000 | (saa7146_read(dev, PCI_BT_V1) & ~0x001f0000)); 88 76 89 - budget->tsf = 0xff; 90 77 budget->ttbp = 0; 91 78 92 79 /* ··· 126 115 127 116 saa7146_write(dev, BASE_ODD3, 0); 128 117 saa7146_write(dev, BASE_EVEN3, 0); 129 - saa7146_write(dev, PROT_ADDR3, TS_WIDTH * TS_HEIGHT); 118 + saa7146_write(dev, PROT_ADDR3, budget->buffer_size); 130 119 saa7146_write(dev, BASE_PAGE3, budget->pt.dma | ME1 | 0x90); 131 120 132 - if (budget->card->type == BUDGET_FS_ACTIVY) { 133 - saa7146_write(dev, PITCH3, TS_WIDTH / 2); 134 - saa7146_write(dev, NUM_LINE_BYTE3, ((TS_HEIGHT * 2) << 16) | (TS_WIDTH / 2)); 135 - } else { 136 - saa7146_write(dev, PITCH3, TS_WIDTH); 137 - saa7146_write(dev, NUM_LINE_BYTE3, (TS_HEIGHT << 16) | TS_WIDTH); 138 - } 121 + saa7146_write(dev, PITCH3, budget->buffer_width); 122 + saa7146_write(dev, NUM_LINE_BYTE3, 123 + (budget->buffer_height << 16) | budget->buffer_width); 139 124 140 125 saa7146_write(dev, MC2, (MASK_04 | MASK_20)); 141 126 ··· 148 141 u8 *mem = (u8 *) (budget->grabbing); 149 142 u32 olddma = budget->ttbp; 150 143 u32 newdma = saa7146_read(budget->dev, PCI_VDP3); 144 + u32 count; 151 145 152 146 /* nearest lower position divisible by 188 */ 153 147 newdma -= newdma % 188; 154 148 155 - if (newdma >= TS_BUFLEN) 149 + if (newdma >= budget->buffer_size) 156 150 return; 157 151 158 152 budget->ttbp = newdma; ··· 162 154 return; 163 155 164 156 if (newdma > olddma) { /* no wraparound, dump olddma..newdma */ 165 - dvb_dmx_swfilter_packets(&budget->demux, mem + olddma, (newdma - olddma) / 188); 157 + count = newdma - olddma; 158 + dvb_dmx_swfilter_packets(&budget->demux, mem + olddma, count / 188); 166 159 } else { /* wraparound, dump olddma..buflen and 0..newdma */ 167 - dvb_dmx_swfilter_packets(&budget->demux, mem + olddma, (TS_BUFLEN - olddma) / 188); 160 + count = budget->buffer_size - olddma; 161 + dvb_dmx_swfilter_packets(&budget->demux, mem + olddma, count / 188); 162 + count += newdma; 168 163 dvb_dmx_swfilter_packets(&budget->demux, mem, newdma / 188); 164 + } 165 + 166 + if (count > budget->buffer_warning_threshold) 167 + budget->buffer_warnings++; 168 + 169 + if (budget->buffer_warnings && time_after(jiffies, budget->buffer_warning_time)) { 170 + printk("%s %s: used %d times >80%% of buffer (%u bytes now)\n", 171 + budget->dev->name, __FUNCTION__, budget->buffer_warnings, count); 172 + budget->buffer_warning_time = jiffies + BUFFER_WARNING_WAIT; 173 + budget->buffer_warnings = 0; 169 174 } 170 175 } 171 176 ··· 362 341 struct saa7146_pci_extension_data *info, 363 342 struct module *owner) 364 343 { 365 - int length = TS_WIDTH * TS_HEIGHT; 366 344 int ret = 0; 367 345 struct budget_info *bi = info->ext_priv; 346 + int max_bufsize; 347 + int height_mask; 368 348 369 349 memset(budget, 0, sizeof(struct budget)); 370 350 ··· 373 351 374 352 budget->card = bi; 375 353 budget->dev = (struct saa7146_dev *) dev; 354 + 355 + if (budget->card->type == BUDGET_FS_ACTIVY) { 356 + budget->buffer_width = TS_WIDTH_ACTIVY; 357 + max_bufsize = TS_MAX_BUFSIZE_K_ACTIVY; 358 + height_mask = TS_HEIGHT_MASK_ACTIVY; 359 + } else { 360 + budget->buffer_width = TS_WIDTH; 361 + max_bufsize = TS_MAX_BUFSIZE_K; 362 + height_mask = TS_HEIGHT_MASK; 363 + } 364 + 365 + if (dma_buffer_size < TS_MIN_BUFSIZE_K) 366 + dma_buffer_size = TS_MIN_BUFSIZE_K; 367 + else if (dma_buffer_size > max_bufsize) 368 + dma_buffer_size = max_bufsize; 369 + 370 + budget->buffer_height = dma_buffer_size * 1024 / budget->buffer_width; 371 + budget->buffer_height &= height_mask; 372 + budget->buffer_size = budget->buffer_height * budget->buffer_width; 373 + budget->buffer_warning_threshold = budget->buffer_size * 80/100; 374 + budget->buffer_warnings = 0; 375 + budget->buffer_warning_time = jiffies; 376 + 377 + dprintk(2, "%s: width = %d, height = %d\n", 378 + budget->dev->name, budget->buffer_width, budget->buffer_height); 379 + printk("%s: dma buffer size %u\n", budget->dev->name, budget->buffer_size); 376 380 377 381 dvb_register_adapter(&budget->dvb_adapter, budget->card->name, owner); 378 382 ··· 440 392 ttpci_eeprom_parse_mac(&budget->i2c_adap, budget->dvb_adapter.proposed_mac); 441 393 442 394 if (NULL == 443 - (budget->grabbing = saa7146_vmalloc_build_pgtable(dev->pci, length, &budget->pt))) { 395 + (budget->grabbing = saa7146_vmalloc_build_pgtable(dev->pci, budget->buffer_size, &budget->pt))) { 444 396 ret = -ENOMEM; 445 397 goto err; 446 398 }
+14 -14
drivers/media/dvb/ttpci/budget-patch.c
··· 577 577 saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTLO); 578 578 // Set RPS1 Address register to point to RPS code (r108 p42) 579 579 saa7146_write(dev, RPS_ADDR1, dev->d_rps1.dma_handle); 580 - // Set Source Line Counter Threshold, using BRS (rCC p43) 581 - // It generates HS event every TS_HEIGHT lines 582 - // this is related to TS_WIDTH set in register 583 - // NUM_LINE_BYTE3 in budget-core.c. If NUM_LINE_BYTE 584 - // low 16 bits are set to TS_WIDTH bytes (TS_WIDTH=2*188 585 - //,then RPS_THRESH1 586 - // should be set to trigger every TS_HEIGHT (512) lines. 587 - // 588 - saa7146_write(dev, RPS_THRESH1, (TS_HEIGHT*1) | MASK_12 ); 589 - 590 - // saa7146_write(dev, RPS_THRESH0, ((TS_HEIGHT/2)<<16) |MASK_28| (TS_HEIGHT/2) |MASK_12 ); 591 - // Enable RPS1 (rFC p33) 592 - saa7146_write(dev, MC1, (MASK_13 | MASK_29)); 593 - 594 580 595 581 if (!(budget = kmalloc (sizeof(struct budget_patch), GFP_KERNEL))) 596 582 return -ENOMEM; ··· 587 601 kfree (budget); 588 602 return err; 589 603 } 604 + 605 + // Set Source Line Counter Threshold, using BRS (rCC p43) 606 + // It generates HS event every TS_HEIGHT lines 607 + // this is related to TS_WIDTH set in register 608 + // NUM_LINE_BYTE3 in budget-core.c. If NUM_LINE_BYTE 609 + // low 16 bits are set to TS_WIDTH bytes (TS_WIDTH=2*188 610 + //,then RPS_THRESH1 611 + // should be set to trigger every TS_HEIGHT (512) lines. 612 + // 613 + saa7146_write(dev, RPS_THRESH1, budget->buffer_height | MASK_12 ); 614 + 615 + // saa7146_write(dev, RPS_THRESH0, ((TS_HEIGHT/2)<<16) |MASK_28| (TS_HEIGHT/2) |MASK_12 ); 616 + // Enable RPS1 (rFC p33) 617 + saa7146_write(dev, MC1, (MASK_13 | MASK_29)); 590 618 591 619 592 620 dev->ext_priv = budget;
+7 -6
drivers/media/dvb/ttpci/budget.h
··· 58 58 int ci_present; 59 59 int video_port; 60 60 61 - u8 tsf; 61 + u32 buffer_width; 62 + u32 buffer_height; 63 + u32 buffer_size; 64 + u32 buffer_warning_threshold; 65 + u32 buffer_warnings; 66 + unsigned long buffer_warning_time; 67 + 62 68 u32 ttbp; 63 69 int feeding; 64 70 ··· 84 78 static struct saa7146_pci_extension_data x_var = { \ 85 79 .ext_priv = &x_var ## _info, \ 86 80 .ext = &budget_extension }; 87 - 88 - #define TS_WIDTH (376) 89 - #define TS_HEIGHT (512) 90 - #define TS_BUFLEN (TS_WIDTH*TS_HEIGHT) 91 - #define TS_MAX_PACKETS (TS_BUFLEN/TS_SIZE) 92 81 93 82 #define BUDGET_TT 0 94 83 #define BUDGET_TT_HW_DISEQC 1
+65 -168
drivers/media/video/Kconfig
··· 300 300 camera drivers. 301 301 302 302 To compile this driver as a module, choose M here: the 303 - module will be called ovcamchip 303 + module will be called ovcamchip. 304 304 305 305 config VIDEO_M32R_AR 306 306 tristate "AR devices" ··· 316 316 Say Y here to use the Renesas M64278E-800 camera module, 317 317 which supports VGA(640x480 pixcels) size of images. 318 318 319 + # 320 + # Encoder / Decoder module configuration 321 + # 322 + 323 + menu "Encoders and Decoders" 324 + depends on VIDEO_DEV 325 + 319 326 config VIDEO_MSP3400 320 327 tristate "Micronas MSP34xx audio decoders" 321 328 depends on VIDEO_DEV && I2C ··· 330 323 Support for the Micronas MSP34xx series of audio decoders. 331 324 332 325 To compile this driver as a module, choose M here: the 333 - module will be called msp3400 326 + module will be called msp3400. 334 327 335 328 config VIDEO_CS53L32A 336 329 tristate "Cirrus Logic CS53L32A audio ADC" ··· 340 333 stereo A/D converter. 341 334 342 335 To compile this driver as a module, choose M here: the 343 - module will be called cs53l32a 336 + module will be called cs53l32a. 344 337 345 338 config VIDEO_WM8775 346 - tristate "Wolfson Microelectronics WM8775 audio ADC" 339 + tristate "Wolfson Microelectronics WM8775 audio ADC with input mixer" 347 340 depends on VIDEO_DEV && I2C && EXPERIMENTAL 348 341 ---help--- 349 - Support for the Wolfson Microelectronics WM8775 350 - high performance stereo A/D Converter. 342 + Support for the Wolfson Microelectronics WM8775 high 343 + performance stereo A/D Converter with a 4 channel input mixer. 351 344 352 345 To compile this driver as a module, choose M here: the 353 - module will be called wm8775 346 + module will be called wm8775. 347 + 348 + config VIDEO_WM8739 349 + tristate "Wolfson Microelectronics WM8739 stereo audio ADC" 350 + depends on VIDEO_DEV && I2C && EXPERIMENTAL 351 + ---help--- 352 + Support for the Wolfson Microelectronics WM8739 353 + stereo A/D Converter. 354 + 355 + To compile this driver as a module, choose M here: the 356 + module will be called wm8739. 354 357 355 358 source "drivers/media/video/cx25840/Kconfig" 356 359 ··· 371 354 Support for the Philips SAA7113/4/5 video decoders. 372 355 373 356 To compile this driver as a module, choose M here: the 374 - module will be called saa7115 357 + module will be called saa7115. 375 358 376 359 config VIDEO_SAA7127 377 360 tristate "Philips SAA7127/9 digital video encoders" ··· 380 363 Support for the Philips SAA7127/9 digital video encoders. 381 364 382 365 To compile this driver as a module, choose M here: the 383 - module will be called saa7127 366 + module will be called saa7127. 367 + 368 + config VIDEO_UPD64031A 369 + tristate "NEC Electronics uPD64031A Ghost Reduction" 370 + depends on VIDEO_DEV && I2C && EXPERIMENTAL 371 + ---help--- 372 + Support for the NEC Electronics uPD64031A Ghost Reduction 373 + video chip. It is most often found in NTSC TV cards made for 374 + Japan and is used to reduce the 'ghosting' effect that can 375 + be present in analog TV broadcasts. 376 + 377 + To compile this driver as a module, choose M here: the 378 + module will be called upd64031a. 379 + 380 + config VIDEO_UPD64083 381 + tristate "NEC Electronics uPD64083 3-Dimensional Y/C separation" 382 + depends on VIDEO_DEV && I2C && EXPERIMENTAL 383 + ---help--- 384 + Support for the NEC Electronics uPD64083 3-Dimensional Y/C 385 + separation video chip. It is used to improve the quality of 386 + the colors of a composite signal. 387 + 388 + To compile this driver as a module, choose M here: the 389 + module will be called upd64083. 390 + 391 + endmenu # encoder / decoder chips 384 392 385 393 # 386 394 # USB Multimedia device configuration ··· 416 374 417 375 source "drivers/media/video/em28xx/Kconfig" 418 376 419 - config USB_VICAM 420 - tristate "USB 3com HomeConnect (aka vicam) support (EXPERIMENTAL)" 421 - depends on USB && VIDEO_DEV && EXPERIMENTAL 422 - ---help--- 423 - Say Y here if you have 3com homeconnect camera (vicam). 424 - 425 - This driver uses the Video For Linux API. You must say Y or M to 426 - "Video For Linux" (under Multimedia Devices) to use this driver. 427 - Information on this API and pointers to "v4l" programs may be found 428 - at <file:Documentation/video4linux/API.html>. 429 - 430 - To compile this driver as a module, choose M here: the 431 - module will be called vicam. 432 - 433 377 config USB_DSBR 434 378 tristate "D-Link USB FM radio support (EXPERIMENTAL)" 435 379 depends on USB && VIDEO_DEV && EXPERIMENTAL ··· 425 397 you must connect the line out connector to a sound card or a 426 398 set of speakers. 427 399 428 - This driver uses the Video For Linux API. You must enable 429 - (Y or M in config) Video For Linux (under Character Devices) 430 - to use this driver. Information on this API and pointers to 431 - "v4l" programs may be found at 432 - <file:Documentation/video4linux/API.html>. 433 - 434 400 To compile this driver as a module, choose M here: the 435 401 module will be called dsbr100. 436 402 437 - config USB_ET61X251 438 - tristate "USB ET61X[12]51 PC Camera Controller support" 439 - depends on USB && VIDEO_DEV 440 - ---help--- 441 - Say Y here if you want support for cameras based on Etoms ET61X151 442 - or ET61X251 PC Camera Controllers. 403 + source "drivers/media/video/usbvideo/Kconfig" 443 404 444 - See <file:Documentation/usb/et61x251.txt> for more informations. 445 - 446 - This driver uses the Video For Linux API. You must say Y or M to 447 - "Video For Linux" to use this driver. 448 - 449 - To compile this driver as a module, choose M here: the 450 - module will be called et61x251. 451 - 452 - config USB_IBMCAM 453 - tristate "USB IBM (Xirlink) C-it Camera support" 454 - depends on USB && VIDEO_DEV 455 - ---help--- 456 - Say Y here if you want to connect a IBM "C-It" camera, also known as 457 - "Xirlink PC Camera" to your computer's USB port. For more 458 - information, read <file:Documentation/usb/ibmcam.txt>. 459 - 460 - This driver uses the Video For Linux API. You must enable 461 - (Y or M in config) Video For Linux (under Character Devices) 462 - to use this driver. Information on this API and pointers to 463 - "v4l" programs may be found at 464 - <file:Documentation/video4linux/API.html>. 465 - 466 - To compile this driver as a module, choose M here: the 467 - module will be called ibmcam. 468 - 469 - This camera has several configuration options which 470 - can be specified when you load the module. Read 471 - <file:Documentation/usb/ibmcam.txt> to learn more. 472 - 473 - config USB_KONICAWC 474 - tristate "USB Konica Webcam support" 475 - depends on USB && VIDEO_DEV 476 - ---help--- 477 - Say Y here if you want support for webcams based on a Konica 478 - chipset. This is known to work with the Intel YC76 webcam. 479 - 480 - This driver uses the Video For Linux API. You must enable 481 - (Y or M in config) Video For Linux (under Character Devices) 482 - to use this driver. Information on this API and pointers to 483 - "v4l" programs may be found at 484 - <file:Documentation/video4linux/API.html>. 485 - 486 - To compile this driver as a module, choose M here: the 487 - module will be called konicawc. 405 + source "drivers/media/video/et61x251/Kconfig" 488 406 489 407 config USB_OV511 490 408 tristate "USB OV511 Camera support" 491 409 depends on USB && VIDEO_DEV 492 410 ---help--- 493 411 Say Y here if you want to connect this type of camera to your 494 - computer's USB port. See <file:Documentation/usb/ov511.txt> for more 495 - information and for a list of supported cameras. 496 - 497 - This driver uses the Video For Linux API. You must say Y or M to 498 - "Video For Linux" (under Character Devices) to use this driver. 499 - Information on this API and pointers to "v4l" programs may be found 500 - at <file:Documentation/video4linux/API.html>. 412 + computer's USB port. See <file:Documentation/video4linux/ov511.txt> 413 + for more information and for a list of supported cameras. 501 414 502 415 To compile this driver as a module, choose M here: the 503 416 module will be called ov511. ··· 448 479 depends on USB && VIDEO_DEV 449 480 ---help--- 450 481 Say Y here if you want to connect this type of camera to your 451 - computer's USB port. See <file:Documentation/usb/se401.txt> for more 452 - information and for a list of supported cameras. 453 - 454 - This driver uses the Video For Linux API. You must say Y or M to 455 - "Video For Linux" (under Multimedia Devices) to use this driver. 456 - Information on this API and pointers to "v4l" programs may be found 457 - at <file:Documentation/video4linux/API.html>. 482 + computer's USB port. See <file:Documentation/video4linux/se401.txt> 483 + for more information and for a list of supported cameras. 458 484 459 485 To compile this driver as a module, choose M here: the 460 486 module will be called se401. 461 487 462 - config USB_SN9C102 463 - tristate "USB SN9C10x PC Camera Controller support" 464 - depends on USB && VIDEO_DEV 465 - ---help--- 466 - Say Y here if you want support for cameras based on SONiX SN9C101, 467 - SN9C102 or SN9C103 PC Camera Controllers. 468 - 469 - See <file:Documentation/usb/sn9c102.txt> for more informations. 470 - 471 - This driver uses the Video For Linux API. You must say Y or M to 472 - "Video For Linux" to use this driver. 473 - 474 - To compile this driver as a module, choose M here: the 475 - module will be called sn9c102. 488 + source "drivers/media/video/sn9c102/Kconfig" 476 489 477 490 config USB_STV680 478 491 tristate "USB STV680 (Pencam) Camera support" ··· 462 511 ---help--- 463 512 Say Y here if you want to connect this type of camera to your 464 513 computer's USB port. This includes the Pencam line of cameras. 465 - See <file:Documentation/usb/stv680.txt> for more information and for 466 - a list of supported cameras. 467 - 468 - This driver uses the Video For Linux API. You must say Y or M to 469 - "Video For Linux" (under Multimedia Devices) to use this driver. 470 - Information on this API and pointers to "v4l" programs may be found 471 - at <file:Documentation/video4linux/API.html>. 514 + See <file:Documentation/video4linux/stv680.txt> for more information 515 + and for a list of supported cameras. 472 516 473 517 To compile this driver as a module, choose M here: the 474 518 module will be called stv680. 475 519 476 520 config USB_W9968CF 477 521 tristate "USB W996[87]CF JPEG Dual Mode Camera support" 478 - depends on USB && VIDEO_DEV && I2C && VIDEO_OVCAMCHIP 522 + depends on USB && VIDEO_DEV && I2C 523 + select VIDEO_OVCAMCHIP 479 524 ---help--- 480 525 Say Y here if you want support for cameras based on OV681 or 481 526 Winbond W9967CF/W9968CF JPEG USB Dual Mode Camera Chips. ··· 481 534 resolutions and framerates, but cannot be included in the official 482 535 Linux kernel for performance purposes. 483 536 484 - See <file:Documentation/usb/w9968cf.txt> for more informations. 485 - 486 - This driver uses the Video For Linux and the I2C APIs. It needs the 487 - OmniVision Camera Chip support as well. You must say Y or M to 488 - "Video For Linux", "I2C Support" and "OmniVision Camera Chip 489 - support" to use this driver. 537 + See <file:Documentation/video4linux/w9968cf.txt> for more info. 490 538 491 539 To compile this driver as a module, choose M here: the 492 540 module will be called w9968cf. 493 541 494 - config USB_ZC0301 495 - tristate "USB ZC0301 Image Processor and Control Chip support" 496 - depends on USB && VIDEO_DEV 497 - ---help--- 498 - Say Y here if you want support for cameras based on the ZC0301 499 - Image Processor and Control Chip. 542 + source "drivers/media/video/zc0301/Kconfig" 500 543 501 - See <file:Documentation/usb/zc0301.txt> for more informations. 502 - 503 - This driver uses the Video For Linux API. You must say Y or M to 504 - "Video For Linux" to use this driver. 505 - 506 - To compile this driver as a module, choose M here: the 507 - module will be called zc0301. 508 - 509 - config USB_PWC 510 - tristate "USB Philips Cameras" 511 - depends on USB && VIDEO_DEV 512 - ---help--- 513 - Say Y or M here if you want to use one of these Philips & OEM 514 - webcams: 515 - * Philips PCA645, PCA646 516 - * Philips PCVC675, PCVC680, PCVC690 517 - * Philips PCVC720/40, PCVC730, PCVC740, PCVC750 518 - * Askey VC010 519 - * Logitech QuickCam Pro 3000, 4000, 'Zoom', 'Notebook Pro' 520 - and 'Orbit'/'Sphere' 521 - * Samsung MPC-C10, MPC-C30 522 - * Creative Webcam 5, Pro Ex 523 - * SOTEC Afina Eye 524 - * Visionite VCS-UC300, VCS-UM100 525 - 526 - The PCA635, PCVC665 and PCVC720/20 are not supported by this driver 527 - and never will be, but the 665 and 720/20 are supported by other 528 - drivers. 529 - 530 - See <file:Documentation/usb/philips.txt> for more information and 531 - installation instructions. 532 - 533 - The built-in microphone is enabled by selecting USB Audio support. 534 - 535 - This driver uses the Video For Linux API. You must say Y or M to 536 - "Video For Linux" (under Character Devices) to use this driver. 537 - Information on this API and pointers to "v4l" programs may be found 538 - at <file:Documentation/video4linux/API.html>. 539 - 540 - To compile this driver as a module, choose M here: the 541 - module will be called pwc. 544 + source "drivers/media/video/pwc/Kconfig" 542 545 543 546 endmenu # V4L USB devices 544 547
+3 -3
drivers/media/video/Makefile
··· 45 45 obj-$(CONFIG_VIDEO_MSP3400) += msp3400.o 46 46 obj-$(CONFIG_VIDEO_CS53L32A) += cs53l32a.o 47 47 obj-$(CONFIG_VIDEO_WM8775) += wm8775.o 48 + obj-$(CONFIG_VIDEO_WM8739) += wm8739.o 48 49 obj-$(CONFIG_VIDEO_OVCAMCHIP) += ovcamchip/ 49 50 obj-$(CONFIG_VIDEO_CPIA2) += cpia2/ 50 51 obj-$(CONFIG_VIDEO_MXB) += saa7111.o tda9840.o tea6415c.o tea6420.o mxb.o ··· 65 64 obj-$(CONFIG_VIDEO_CX25840) += cx25840/ 66 65 obj-$(CONFIG_VIDEO_SAA711X) += saa7115.o 67 66 obj-$(CONFIG_VIDEO_SAA7127) += saa7127.o 68 - 69 - et61x251-objs := et61x251_core.o et61x251_tas5130d1b.o 70 - zc0301-objs := zc0301_core.o zc0301_pas202bcb.o 67 + obj-$(CONFIG_VIDEO_UPD64031A) += upd64031a.o 68 + obj-$(CONFIG_VIDEO_UPD64083) += upd64083.o 71 69 72 70 obj-$(CONFIG_USB_DABUSB) += dabusb.o 73 71 obj-$(CONFIG_USB_DSBR) += dsbr100.o
+88 -82
drivers/media/video/bt8xx/bttv-driver.c
··· 973 973 For now this is sufficient. */ 974 974 switch (input) { 975 975 case TVAUDIO_INPUT_RADIO: 976 - route.input = MSP_INPUT(MSP_IN_SCART_2, MSP_IN_TUNER_1, 977 - MSP_DSP_OUT_SCART, MSP_DSP_OUT_SCART); 976 + route.input = MSP_INPUT(MSP_IN_SCART2, MSP_IN_TUNER1, 977 + MSP_DSP_IN_SCART, MSP_DSP_IN_SCART); 978 978 break; 979 979 case TVAUDIO_INPUT_EXTERN: 980 - route.input = MSP_INPUT(MSP_IN_SCART_1, MSP_IN_TUNER_1, 981 - MSP_DSP_OUT_SCART, MSP_DSP_OUT_SCART); 980 + route.input = MSP_INPUT(MSP_IN_SCART1, MSP_IN_TUNER1, 981 + MSP_DSP_IN_SCART, MSP_DSP_IN_SCART); 982 982 break; 983 983 case TVAUDIO_INPUT_INTERN: 984 984 /* Yes, this is the same input as for RADIO. I doubt ··· 986 986 input is the BTTV_BOARD_AVERMEDIA98. I wonder how 987 987 that was tested. My guess is that the whole INTERN 988 988 input does not work. */ 989 - route.input = MSP_INPUT(MSP_IN_SCART_2, MSP_IN_TUNER_1, 990 - MSP_DSP_OUT_SCART, MSP_DSP_OUT_SCART); 989 + route.input = MSP_INPUT(MSP_IN_SCART2, MSP_IN_TUNER1, 990 + MSP_DSP_IN_SCART, MSP_DSP_IN_SCART); 991 991 break; 992 992 case TVAUDIO_INPUT_TUNER: 993 993 default: ··· 1023 1023 static void 1024 1024 i2c_vidiocschan(struct bttv *btv) 1025 1025 { 1026 - struct video_channel c; 1026 + v4l2_std_id std = bttv_tvnorms[btv->tvnorm].v4l2_id; 1027 1027 1028 - memset(&c,0,sizeof(c)); 1029 - c.norm = btv->tvnorm; 1030 - c.channel = btv->input; 1031 - bttv_call_i2c_clients(btv,VIDIOCSCHAN,&c); 1028 + bttv_call_i2c_clients(btv, VIDIOC_S_STD, &std); 1032 1029 if (btv->c.type == BTTV_BOARD_VOODOOTV_FM) 1033 - bttv_tda9880_setnorm(btv,c.norm); 1030 + bttv_tda9880_setnorm(btv,btv->tvnorm); 1034 1031 } 1035 1032 1036 1033 static int ··· 1181 1184 break; 1182 1185 if (i == BTTV_CTLS) 1183 1186 return -EINVAL; 1184 - if (i >= 4 && i <= 8) { 1187 + if (btv->audio_hook && i >= 4 && i <= 8) { 1185 1188 memset(&va,0,sizeof(va)); 1186 - bttv_call_i2c_clients(btv, VIDIOCGAUDIO, &va); 1187 - if (btv->audio_hook) 1188 - btv->audio_hook(btv,&va,0); 1189 + btv->audio_hook(btv,&va,0); 1190 + switch (c->id) { 1191 + case V4L2_CID_AUDIO_MUTE: 1192 + c->value = (VIDEO_AUDIO_MUTE & va.flags) ? 1 : 0; 1193 + break; 1194 + case V4L2_CID_AUDIO_VOLUME: 1195 + c->value = va.volume; 1196 + break; 1197 + case V4L2_CID_AUDIO_BALANCE: 1198 + c->value = va.balance; 1199 + break; 1200 + case V4L2_CID_AUDIO_BASS: 1201 + c->value = va.bass; 1202 + break; 1203 + case V4L2_CID_AUDIO_TREBLE: 1204 + c->value = va.treble; 1205 + break; 1206 + } 1207 + return 0; 1189 1208 } 1190 1209 switch (c->id) { 1191 1210 case V4L2_CID_BRIGHTNESS: ··· 1218 1205 break; 1219 1206 1220 1207 case V4L2_CID_AUDIO_MUTE: 1221 - c->value = (VIDEO_AUDIO_MUTE & va.flags) ? 1 : 0; 1222 - break; 1223 1208 case V4L2_CID_AUDIO_VOLUME: 1224 - c->value = va.volume; 1225 - break; 1226 1209 case V4L2_CID_AUDIO_BALANCE: 1227 - c->value = va.balance; 1228 - break; 1229 1210 case V4L2_CID_AUDIO_BASS: 1230 - c->value = va.bass; 1231 - break; 1232 1211 case V4L2_CID_AUDIO_TREBLE: 1233 - c->value = va.treble; 1212 + bttv_call_i2c_clients(btv,VIDIOC_G_CTRL,c); 1234 1213 break; 1235 1214 1236 1215 case V4L2_CID_PRIVATE_CHROMA_AGC: ··· 1274 1269 break; 1275 1270 if (i == BTTV_CTLS) 1276 1271 return -EINVAL; 1277 - if (i >= 4 && i <= 8) { 1272 + if (btv->audio_hook && i >= 4 && i <= 8) { 1278 1273 memset(&va,0,sizeof(va)); 1279 - bttv_call_i2c_clients(btv, VIDIOCGAUDIO, &va); 1280 - if (btv->audio_hook) 1281 - btv->audio_hook(btv,&va,0); 1274 + btv->audio_hook(btv,&va,0); 1275 + switch (c->id) { 1276 + case V4L2_CID_AUDIO_MUTE: 1277 + if (c->value) { 1278 + va.flags |= VIDEO_AUDIO_MUTE; 1279 + audio_mute(btv, 1); 1280 + } else { 1281 + va.flags &= ~VIDEO_AUDIO_MUTE; 1282 + audio_mute(btv, 0); 1283 + } 1284 + break; 1285 + 1286 + case V4L2_CID_AUDIO_VOLUME: 1287 + va.volume = c->value; 1288 + break; 1289 + case V4L2_CID_AUDIO_BALANCE: 1290 + va.balance = c->value; 1291 + break; 1292 + case V4L2_CID_AUDIO_BASS: 1293 + va.bass = c->value; 1294 + break; 1295 + case V4L2_CID_AUDIO_TREBLE: 1296 + va.treble = c->value; 1297 + break; 1298 + } 1299 + btv->audio_hook(btv,&va,1); 1300 + return 0; 1282 1301 } 1283 1302 switch (c->id) { 1284 1303 case V4L2_CID_BRIGHTNESS: ··· 1318 1289 bt848_sat(btv,c->value); 1319 1290 break; 1320 1291 case V4L2_CID_AUDIO_MUTE: 1321 - if (c->value) { 1322 - va.flags |= VIDEO_AUDIO_MUTE; 1323 - audio_mute(btv, 1); 1324 - } else { 1325 - va.flags &= ~VIDEO_AUDIO_MUTE; 1326 - audio_mute(btv, 0); 1327 - } 1328 - break; 1329 - 1292 + audio_mute(btv, c->value); 1293 + /* fall through */ 1330 1294 case V4L2_CID_AUDIO_VOLUME: 1331 - va.volume = c->value; 1332 - break; 1333 1295 case V4L2_CID_AUDIO_BALANCE: 1334 - va.balance = c->value; 1335 - break; 1336 1296 case V4L2_CID_AUDIO_BASS: 1337 - va.bass = c->value; 1338 - break; 1339 1297 case V4L2_CID_AUDIO_TREBLE: 1340 - va.treble = c->value; 1298 + bttv_call_i2c_clients(btv,VIDIOC_S_CTRL,c); 1341 1299 break; 1342 1300 1343 1301 case V4L2_CID_PRIVATE_CHROMA_AGC: ··· 1379 1363 break; 1380 1364 default: 1381 1365 return -EINVAL; 1382 - } 1383 - if (i >= 4 && i <= 8) { 1384 - bttv_call_i2c_clients(btv, VIDIOCSAUDIO, &va); 1385 - if (btv->audio_hook) 1386 - btv->audio_hook(btv,&va,1); 1387 1366 } 1388 1367 return 0; 1389 1368 } ··· 1602 1591 } 1603 1592 case VIDIOCSFREQ: 1604 1593 { 1605 - unsigned long *freq = arg; 1594 + struct v4l2_frequency freq; 1595 + 1596 + memset(&freq, 0, sizeof(freq)); 1597 + freq.frequency = *(unsigned long *)arg; 1606 1598 mutex_lock(&btv->lock); 1607 - btv->freq=*freq; 1608 - bttv_call_i2c_clients(btv,VIDIOCSFREQ,freq); 1599 + freq.type = btv->radio_user ? V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV; 1600 + btv->freq = *(unsigned long *)arg; 1601 + bttv_call_i2c_clients(btv,VIDIOC_S_FREQUENCY,&freq); 1609 1602 if (btv->has_matchbox && btv->radio_user) 1610 - tea5757_set_freq(btv,*freq); 1603 + tea5757_set_freq(btv,*(unsigned long *)arg); 1611 1604 mutex_unlock(&btv->lock); 1612 1605 return 0; 1613 1606 } ··· 1842 1827 return -EINVAL; 1843 1828 mutex_lock(&btv->lock); 1844 1829 memset(t,0,sizeof(*t)); 1845 - strcpy(t->name, "Television"); 1846 - t->type = V4L2_TUNER_ANALOG_TV; 1847 - t->capability = V4L2_TUNER_CAP_NORM; 1848 1830 t->rxsubchans = V4L2_TUNER_SUB_MONO; 1831 + bttv_call_i2c_clients(btv, VIDIOC_G_TUNER, t); 1832 + strcpy(t->name, "Television"); 1833 + t->capability = V4L2_TUNER_CAP_NORM; 1834 + t->type = V4L2_TUNER_ANALOG_TV; 1849 1835 if (btread(BT848_DSTATUS)&BT848_DSTATUS_HLOC) 1850 1836 t->signal = 0xffff; 1851 - { 1852 - struct video_tuner tuner; 1853 1837 1854 - memset(&tuner, 0, sizeof (tuner)); 1855 - tuner.rangehigh = 0xffffffffUL; 1856 - bttv_call_i2c_clients(btv, VIDIOCGTUNER, &tuner); 1857 - t->rangelow = tuner.rangelow; 1858 - t->rangehigh = tuner.rangehigh; 1859 - } 1860 - { 1838 + if (btv->audio_hook) { 1861 1839 /* Hmmm ... */ 1862 1840 struct video_audio va; 1863 1841 memset(&va, 0, sizeof(struct video_audio)); 1864 - bttv_call_i2c_clients(btv, VIDIOCGAUDIO, &va); 1865 - if (btv->audio_hook) 1866 - btv->audio_hook(btv,&va,0); 1842 + btv->audio_hook(btv,&va,0); 1843 + t->audmode = V4L2_TUNER_MODE_MONO; 1844 + t->rxsubchans = V4L2_TUNER_SUB_MONO; 1867 1845 if(va.mode & VIDEO_SOUND_STEREO) { 1868 - t->audmode = V4L2_TUNER_MODE_STEREO; 1869 - t->rxsubchans |= V4L2_TUNER_SUB_STEREO; 1846 + t->audmode = V4L2_TUNER_MODE_STEREO; 1847 + t->rxsubchans = V4L2_TUNER_SUB_STEREO; 1870 1848 } 1871 - if(va.mode & VIDEO_SOUND_LANG1) { 1849 + if(va.mode & VIDEO_SOUND_LANG2) { 1872 1850 t->audmode = V4L2_TUNER_MODE_LANG1; 1873 1851 t->rxsubchans = V4L2_TUNER_SUB_LANG1 1874 1852 | V4L2_TUNER_SUB_LANG2; ··· 1880 1872 if (0 != t->index) 1881 1873 return -EINVAL; 1882 1874 mutex_lock(&btv->lock); 1883 - { 1875 + bttv_call_i2c_clients(btv, VIDIOC_S_TUNER, t); 1876 + if (btv->audio_hook) { 1884 1877 struct video_audio va; 1885 1878 memset(&va, 0, sizeof(struct video_audio)); 1886 - bttv_call_i2c_clients(btv, VIDIOCGAUDIO, &va); 1887 1879 if (t->audmode == V4L2_TUNER_MODE_MONO) 1888 1880 va.mode = VIDEO_SOUND_MONO; 1889 1881 else if (t->audmode == V4L2_TUNER_MODE_STEREO || ··· 1893 1885 va.mode = VIDEO_SOUND_LANG1; 1894 1886 else if (t->audmode == V4L2_TUNER_MODE_LANG2) 1895 1887 va.mode = VIDEO_SOUND_LANG2; 1896 - bttv_call_i2c_clients(btv, VIDIOCSAUDIO, &va); 1897 - if (btv->audio_hook) 1898 - btv->audio_hook(btv,&va,1); 1888 + btv->audio_hook(btv,&va,1); 1899 1889 } 1900 1890 mutex_unlock(&btv->lock); 1901 1891 return 0; ··· 1918 1912 return -EINVAL; 1919 1913 mutex_lock(&btv->lock); 1920 1914 btv->freq = f->frequency; 1921 - bttv_call_i2c_clients(btv,VIDIOCSFREQ,&btv->freq); 1915 + bttv_call_i2c_clients(btv,VIDIOC_S_FREQUENCY,f); 1922 1916 if (btv->has_matchbox && btv->radio_user) 1923 1917 tea5757_set_freq(btv,btv->freq); 1924 1918 mutex_unlock(&btv->lock); ··· 1926 1920 } 1927 1921 case VIDIOC_LOG_STATUS: 1928 1922 { 1923 + printk(KERN_INFO "bttv%d: ================= START STATUS CARD #%d =================\n", btv->c.nr, btv->c.nr); 1929 1924 bttv_call_i2c_clients(btv, VIDIOC_LOG_STATUS, NULL); 1925 + printk(KERN_INFO "bttv%d: ================== END STATUS CARD #%d ==================\n", btv->c.nr, btv->c.nr); 1930 1926 return 0; 1931 1927 } 1932 1928 ··· 2878 2870 return 0; 2879 2871 } 2880 2872 *c = bttv_ctls[i]; 2881 - if (i >= 4 && i <= 8) { 2873 + if (btv->audio_hook && i >= 4 && i <= 8) { 2882 2874 struct video_audio va; 2883 2875 memset(&va,0,sizeof(va)); 2884 - bttv_call_i2c_clients(btv, VIDIOCGAUDIO, &va); 2885 - if (btv->audio_hook) 2886 - btv->audio_hook(btv,&va,0); 2876 + btv->audio_hook(btv,&va,0); 2887 2877 switch (bttv_ctls[i].id) { 2888 2878 case V4L2_CID_AUDIO_VOLUME: 2889 2879 if (!(va.flags & VIDEO_AUDIO_VOLUME))
+1 -1
drivers/media/video/bt8xx/bttv-vbi.c
··· 184 184 - tvnorm->vbistart[0]; 185 185 count1 = (s64) f->fmt.vbi.start[1] + f->fmt.vbi.count[1] 186 186 - tvnorm->vbistart[1]; 187 - count = clamp (max (count0, count1), 1LL, (s64) VBI_MAXLINES); 187 + count = clamp (max (count0, count1), (s64) 1, (s64) VBI_MAXLINES); 188 188 189 189 f->fmt.vbi.start[0] = tvnorm->vbistart[0]; 190 190 f->fmt.vbi.start[1] = tvnorm->vbistart[1];
+6 -7
drivers/media/video/cpia.c
··· 64 64 MODULE_SUPPORTED_DEVICE("video"); 65 65 #endif 66 66 67 - static unsigned short colorspace_conv = 0; 67 + static unsigned short colorspace_conv; 68 68 module_param(colorspace_conv, ushort, 0444); 69 69 MODULE_PARM_DESC(colorspace_conv, 70 - "\n<n> Colorspace conversion:" 71 - "\n0 = disable" 72 - "\n1 = enable" 73 - "\nDefault value is 0" 74 - "\n"); 70 + " Colorspace conversion:" 71 + "\n 0 = disable, 1 = enable" 72 + "\n Default value is 0" 73 + ); 75 74 76 75 #define ABOUT "V4L-Driver for Vision CPiA based cameras" 77 76 ··· 4041 4042 "allowed, it is disabled by default now. Users should fix the " 4042 4043 "applications in case they don't work without conversion " 4043 4044 "reenabled by setting the 'colorspace_conv' module " 4044 - "parameter to 1"); 4045 + "parameter to 1\n"); 4045 4046 4046 4047 #ifdef CONFIG_PROC_FS 4047 4048 proc_cpia_create();
+1 -1
drivers/media/video/cpia2/cpia2.h
··· 456 456 int cpia2_allocate_buffers(struct camera_data *cam); 457 457 void cpia2_free_buffers(struct camera_data *cam); 458 458 long cpia2_read(struct camera_data *cam, 459 - char *buf, unsigned long count, int noblock); 459 + char __user *buf, unsigned long count, int noblock); 460 460 unsigned int cpia2_poll(struct camera_data *cam, 461 461 struct file *filp, poll_table *wait); 462 462 int cpia2_remap_buffer(struct camera_data *cam, struct vm_area_struct *vma);
+2 -1
drivers/media/video/cx25840/cx25840-audio.c
··· 19 19 #include <linux/videodev2.h> 20 20 #include <linux/i2c.h> 21 21 #include <media/v4l2-common.h> 22 + #include <media/cx25840.h> 22 23 23 - #include "cx25840.h" 24 + #include "cx25840-core.h" 24 25 25 26 static int set_audclk_freq(struct i2c_client *client, u32 freq) 26 27 {
+14 -10
drivers/media/video/cx25840/cx25840-core.c
··· 32 32 #include <linux/videodev2.h> 33 33 #include <linux/i2c.h> 34 34 #include <media/v4l2-common.h> 35 + #include <media/cx25840.h> 35 36 36 - #include "cx25840.h" 37 + #include "cx25840-core.h" 37 38 38 39 MODULE_DESCRIPTION("Conexant CX25840 audio/video decoder driver"); 39 40 MODULE_AUTHOR("Ulf Eklund, Chris Kennedy, Hans Verkuil, Tyler Trafford"); ··· 669 668 { 670 669 struct cx25840_state *state = i2c_get_clientdata(client); 671 670 struct v4l2_tuner *vt = arg; 671 + struct v4l2_routing *route = arg; 672 672 673 673 switch (cmd) { 674 674 #ifdef CONFIG_VIDEO_ADV_DEBUG ··· 751 749 state->radio = 1; 752 750 break; 753 751 754 - case VIDIOC_G_INPUT: 755 - *(int *)arg = state->vid_input; 752 + case VIDIOC_INT_G_VIDEO_ROUTING: 753 + route->input = state->vid_input; 754 + route->output = 0; 756 755 break; 757 756 758 - case VIDIOC_S_INPUT: 759 - return set_input(client, *(enum cx25840_video_input *)arg, state->aud_input); 757 + case VIDIOC_INT_S_VIDEO_ROUTING: 758 + return set_input(client, route->input, state->aud_input); 760 759 761 - case VIDIOC_S_AUDIO: 762 - { 763 - struct v4l2_audio *input = arg; 760 + case VIDIOC_INT_G_AUDIO_ROUTING: 761 + route->input = state->aud_input; 762 + route->output = 0; 763 + break; 764 764 765 - return set_input(client, state->vid_input, input->index); 766 - } 765 + case VIDIOC_INT_S_AUDIO_ROUTING: 766 + return set_input(client, state->vid_input, route->input); 767 767 768 768 case VIDIOC_S_FREQUENCY: 769 769 input_change(client);
+13 -2
drivers/media/video/cx25840/cx25840-firmware.c
··· 20 20 #include <linux/i2c-algo-bit.h> 21 21 #include <linux/firmware.h> 22 22 #include <media/v4l2-common.h> 23 + #include <media/cx25840.h> 23 24 24 - #include "cx25840.h" 25 + #include "cx25840-core.h" 25 26 26 27 #define FWFILE "v4l-cx25840.fw" 27 - #define FWSEND 1024 28 + 29 + /* 30 + * Mike Isely <isely@pobox.com> - The FWSEND parameter controls the 31 + * size of the firmware chunks sent down the I2C bus to the chip. 32 + * Previously this had been set to 1024 but unfortunately some I2C 33 + * implementations can't transfer data in such big gulps. 34 + * Specifically, the pvrusb2 driver has a hard limit of around 60 35 + * bytes, due to the encapsulation there of I2C traffic into USB 36 + * messages. So we have to significantly reduce this parameter. 37 + */ 38 + #define FWSEND 48 28 39 29 40 #define FWDEV(x) &((x)->adapter->dev) 30 41
+5 -4
drivers/media/video/cx25840/cx25840-vbi.c
··· 19 19 #include <linux/videodev2.h> 20 20 #include <linux/i2c.h> 21 21 #include <media/v4l2-common.h> 22 + #include <media/cx25840.h> 22 23 23 - #include "cx25840.h" 24 + #include "cx25840-core.h" 24 25 25 26 static int odd_parity(u8 c) 26 27 { ··· 152 151 case VIDIOC_G_FMT: 153 152 { 154 153 static u16 lcr2vbi[] = { 155 - 0, V4L2_SLICED_TELETEXT_PAL_B, 0, /* 1 */ 154 + 0, V4L2_SLICED_TELETEXT_B, 0, /* 1 */ 156 155 0, V4L2_SLICED_WSS_625, 0, /* 4 */ 157 156 V4L2_SLICED_CAPTION_525, /* 6 */ 158 157 0, 0, V4L2_SLICED_VPS, 0, 0, /* 9 */ ··· 232 231 for (i = 7; i <= 23; i++) { 233 232 for (x = 0; x <= 1; x++) { 234 233 switch (svbi->service_lines[1-x][i]) { 235 - case V4L2_SLICED_TELETEXT_PAL_B: 234 + case V4L2_SLICED_TELETEXT_B: 236 235 lcr[i] |= 1 << (4 * x); 237 236 break; 238 237 case V4L2_SLICED_WSS_625: ··· 283 282 284 283 switch (id2) { 285 284 case 1: 286 - id2 = V4L2_SLICED_TELETEXT_PAL_B; 285 + id2 = V4L2_SLICED_TELETEXT_B; 287 286 break; 288 287 case 4: 289 288 id2 = V4L2_SLICED_WSS_625;
+3 -43
drivers/media/video/cx25840/cx25840.h drivers/media/video/cx25840/cx25840-core.h
··· 1 - /* cx25840 API header 1 + /* cx25840 internal API header 2 2 * 3 3 * Copyright (C) 2003-2004 Chris Kennedy 4 4 * ··· 17 17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 18 */ 19 19 20 - #ifndef _CX25840_H_ 21 - #define _CX25840_H_ 20 + #ifndef _CX25840_CORE_H_ 21 + #define _CX25840_CORE_H_ 22 22 23 23 24 24 #include <linux/videodev2.h> ··· 31 31 is to select the audio standard explicitly. Many thanks to Hauppauge for 32 32 providing this information. */ 33 33 #define CX25840_CID_ENABLE_PVR150_WORKAROUND (V4L2_CID_PRIVATE_BASE+0) 34 - 35 - enum cx25840_video_input { 36 - /* Composite video inputs In1-In8 */ 37 - CX25840_COMPOSITE1 = 1, 38 - CX25840_COMPOSITE2, 39 - CX25840_COMPOSITE3, 40 - CX25840_COMPOSITE4, 41 - CX25840_COMPOSITE5, 42 - CX25840_COMPOSITE6, 43 - CX25840_COMPOSITE7, 44 - CX25840_COMPOSITE8, 45 - 46 - /* S-Video inputs consist of one luma input (In1-In4) ORed with one 47 - chroma input (In5-In8) */ 48 - CX25840_SVIDEO_LUMA1 = 0x10, 49 - CX25840_SVIDEO_LUMA2 = 0x20, 50 - CX25840_SVIDEO_LUMA3 = 0x30, 51 - CX25840_SVIDEO_LUMA4 = 0x40, 52 - CX25840_SVIDEO_CHROMA4 = 0x400, 53 - CX25840_SVIDEO_CHROMA5 = 0x500, 54 - CX25840_SVIDEO_CHROMA6 = 0x600, 55 - CX25840_SVIDEO_CHROMA7 = 0x700, 56 - CX25840_SVIDEO_CHROMA8 = 0x800, 57 - 58 - /* S-Video aliases for common luma/chroma combinations */ 59 - CX25840_SVIDEO1 = 0x510, 60 - CX25840_SVIDEO2 = 0x620, 61 - CX25840_SVIDEO3 = 0x730, 62 - CX25840_SVIDEO4 = 0x840, 63 - }; 64 - 65 - enum cx25840_audio_input { 66 - /* Audio inputs: serial or In4-In8 */ 67 - CX25840_AUDIO_SERIAL, 68 - CX25840_AUDIO4 = 4, 69 - CX25840_AUDIO5, 70 - CX25840_AUDIO6, 71 - CX25840_AUDIO7, 72 - CX25840_AUDIO8, 73 - }; 74 34 75 35 struct cx25840_state { 76 36 int pvr150_workaround;
+10 -5
drivers/media/video/cx88/Kconfig
··· 1 + config VIDEO_CX88_VP3054 2 + tristate 3 + depends on VIDEO_CX88_DVB && DVB_MT352 4 + 1 5 config VIDEO_CX88 2 6 tristate "Conexant 2388x (bt878 successor) support" 3 7 depends on VIDEO_DEV && PCI && I2C ··· 29 25 30 26 It only works with boards with function 01 enabled. 31 27 To check if your board supports, use lspci -n. 32 - If supported, you should see 1471:8801 or 1471:8811 28 + If supported, you should see 14f1:8801 or 14f1:8811 33 29 PCI device. 34 30 35 31 To compile this driver as a module, choose M here: the ··· 77 73 This adds DVB-T support for cards based on the 78 74 Connexant 2388x chip and the MT352 demodulator. 79 75 80 - config VIDEO_CX88_VP3054 81 - tristate "VP-3054 Secondary I2C Bus Support" 82 - default m 83 - depends on DVB_MT352 76 + config VIDEO_CX88_DVB_VP3054 77 + bool "VP-3054 Secondary I2C Bus Support" 78 + default y 79 + depends on VIDEO_CX88_DVB_MT352 80 + select VIDEO_CX88_VP3054 84 81 ---help--- 85 82 This adds DVB-T support for cards based on the 86 83 Connexant 2388x chip and the MT352 demodulator,
+2 -2
drivers/media/video/em28xx/em28xx-cards.c
··· 151 151 },{ 152 152 .type = EM28XX_VMUX_SVIDEO, 153 153 .vmux = 2, 154 - .amux = MSP_INPUT(MSP_IN_SCART_1, MSP_IN_TUNER_1, 155 - MSP_DSP_OUT_SCART, MSP_DSP_OUT_SCART), 154 + .amux = MSP_INPUT(MSP_IN_SCART1, MSP_IN_TUNER1, 155 + MSP_DSP_IN_SCART, MSP_DSP_IN_SCART), 156 156 }}, 157 157 }, 158 158 [EM2820_BOARD_MSI_VOX_USB_2] = {
+5 -28
drivers/media/video/em28xx/em28xx-video.c
··· 222 222 if (dev->i2s_speed) 223 223 em28xx_i2c_call_clients(dev, VIDIOC_INT_I2S_CLOCK_FREQ, &dev->i2s_speed); 224 224 route.input = dev->ctl_ainput; 225 - route.output = MSP_OUTPUT(MSP_OUT_SCART1_DA); 225 + route.output = MSP_OUTPUT(MSP_SC_IN_DSP_SCART1); 226 226 /* Note: this is msp3400 specific */ 227 227 em28xx_i2c_call_clients(dev, VIDIOC_INT_S_AUDIO_ROUTING, &route); 228 228 ainput = EM28XX_AUDIO_SRC_TUNER; ··· 1141 1141 case VIDIOC_G_TUNER: 1142 1142 { 1143 1143 struct v4l2_tuner *t = arg; 1144 - int status = 0; 1145 1144 1146 1145 if (0 != t->index) 1147 1146 return -EINVAL; 1148 1147 1149 1148 memset(t, 0, sizeof(*t)); 1150 1149 strcpy(t->name, "Tuner"); 1151 - t->type = V4L2_TUNER_ANALOG_TV; 1152 - t->capability = V4L2_TUNER_CAP_NORM; 1153 - t->rangehigh = 0xffffffffUL; /* FIXME: set correct range */ 1154 - /* t->signal = 0xffff;*/ 1155 - /* em28xx_i2c_call_clients(dev,VIDIOC_G_TUNER,t);*/ 1156 - /* No way to get signal strength? */ 1157 1150 mutex_lock(&dev->lock); 1158 - em28xx_i2c_call_clients(dev, DECODER_GET_STATUS, 1159 - &status); 1151 + /* let clients fill in the remainder of this struct */ 1152 + em28xx_i2c_call_clients(dev, cmd, t); 1160 1153 mutex_unlock(&dev->lock); 1161 - t->signal = 1162 - (status & DECODER_STATUS_GOOD) != 0 ? 0xffff : 0; 1163 - 1164 1154 em28xx_videodbg("VIDIO_G_TUNER: signal=%x, afc=%x\n", t->signal, 1165 1155 t->afc); 1166 1156 return 0; ··· 1158 1168 case VIDIOC_S_TUNER: 1159 1169 { 1160 1170 struct v4l2_tuner *t = arg; 1161 - int status = 0; 1162 1171 1163 1172 if (0 != t->index) 1164 1173 return -EINVAL; 1165 - memset(t, 0, sizeof(*t)); 1166 - strcpy(t->name, "Tuner"); 1167 - t->type = V4L2_TUNER_ANALOG_TV; 1168 - t->capability = V4L2_TUNER_CAP_NORM; 1169 - t->rangehigh = 0xffffffffUL; /* FIXME: set correct range */ 1170 - /* t->signal = 0xffff; */ 1171 - /* No way to get signal strength? */ 1172 1174 mutex_lock(&dev->lock); 1173 - em28xx_i2c_call_clients(dev, DECODER_GET_STATUS, 1174 - &status); 1175 + /* let clients handle this */ 1176 + em28xx_i2c_call_clients(dev, cmd, t); 1175 1177 mutex_unlock(&dev->lock); 1176 - t->signal = 1177 - (status & DECODER_STATUS_GOOD) != 0 ? 0xffff : 0; 1178 - 1179 - em28xx_videodbg("VIDIO_S_TUNER: signal=%x, afc=%x\n", 1180 - t->signal, t->afc); 1181 1178 return 0; 1182 1179 } 1183 1180 case VIDIOC_G_FREQUENCY:
+14
drivers/media/video/et61x251/Kconfig
··· 1 + config USB_ET61X251 2 + tristate "USB ET61X[12]51 PC Camera Controller support" 3 + depends on USB && VIDEO_DEV 4 + ---help--- 5 + Say Y here if you want support for cameras based on Etoms ET61X151 6 + or ET61X251 PC Camera Controllers. 7 + 8 + See <file:Documentation/video4linux/et61x251.txt> for more info. 9 + 10 + This driver uses the Video For Linux API. You must say Y or M to 11 + "Video For Linux" to use this driver. 12 + 13 + To compile this driver as a module, choose M here: the 14 + module will be called et61x251.
+3
drivers/media/video/ir-kbd-i2c.c
··· 411 411 case I2C_HW_B_BT848: 412 412 probe = probe_bttv; 413 413 break; 414 + case I2C_HW_B_CX2341X: 415 + probe = probe_bttv; 416 + break; 414 417 case I2C_HW_SAA7134: 415 418 probe = probe_saa7134; 416 419 break;
+42 -49
drivers/media/video/msp3400-driver.c
··· 279 279 msp_write_dsp(client, 0x13, state->acb); 280 280 281 281 /* Sets I2S speed 0 = 1.024 Mbps, 1 = 2.048 Mbps */ 282 - msp_write_dem(client, 0x40, state->i2s_mode); 283 - } 284 - 285 - void msp_set_mute(struct i2c_client *client) 286 - { 287 - struct msp_state *state = i2c_get_clientdata(client); 288 - 289 - v4l_dbg(1, msp_debug, client, "mute audio\n"); 290 - msp_write_dsp(client, 0x0000, 0); 291 - msp_write_dsp(client, 0x0007, 1); 292 - if (state->has_scart2_out_volume) 293 - msp_write_dsp(client, 0x0040, 1); 294 - if (state->has_headphones) 295 - msp_write_dsp(client, 0x0006, 0); 282 + if (state->has_i2s_conf) 283 + msp_write_dem(client, 0x40, state->i2s_mode); 296 284 } 297 285 298 286 void msp_set_audio(struct i2c_client *client) ··· 288 300 struct msp_state *state = i2c_get_clientdata(client); 289 301 int bal = 0, bass, treble, loudness; 290 302 int val = 0; 303 + int reallymuted = state->muted | state->scan_in_progress; 291 304 292 - if (!state->muted) 305 + if (!reallymuted) 293 306 val = (state->volume * 0x7f / 65535) << 8; 294 307 295 - v4l_dbg(1, msp_debug, client, "mute=%s volume=%d\n", 296 - state->muted ? "on" : "off", state->volume); 308 + v4l_dbg(1, msp_debug, client, "mute=%s scanning=%s volume=%d\n", 309 + state->muted ? "on" : "off", state->scan_in_progress ? "yes" : "no", 310 + state->volume); 297 311 298 312 msp_write_dsp(client, 0x0000, val); 299 - msp_write_dsp(client, 0x0007, state->muted ? 0x1 : (val | 0x1)); 313 + msp_write_dsp(client, 0x0007, reallymuted ? 0x1 : (val | 0x1)); 300 314 if (state->has_scart2_out_volume) 301 - msp_write_dsp(client, 0x0040, state->muted ? 0x1 : (val | 0x1)); 315 + msp_write_dsp(client, 0x0040, reallymuted ? 0x1 : (val | 0x1)); 302 316 if (state->has_headphones) 303 317 msp_write_dsp(client, 0x0006, val); 304 318 if (!state->has_sound_processing) ··· 336 346 337 347 if (NULL == state->kthread) 338 348 return; 339 - msp_set_mute(client); 340 349 state->watch_stereo = 0; 341 350 state->restart = 1; 342 351 wake_up_interruptible(&state->wq); ··· 363 374 364 375 /* ------------------------------------------------------------------------ */ 365 376 366 - static int msp_mode_v4l2_to_v4l1(int rxsubchans) 377 + static int msp_mode_v4l2_to_v4l1(int rxsubchans, int audmode) 367 378 { 368 - int mode = 0; 369 - 370 - if (rxsubchans & V4L2_TUNER_SUB_STEREO) 371 - mode |= VIDEO_SOUND_STEREO; 372 - if (rxsubchans & V4L2_TUNER_SUB_LANG2) 373 - mode |= VIDEO_SOUND_LANG2 | VIDEO_SOUND_STEREO; 374 - if (rxsubchans & V4L2_TUNER_SUB_LANG1) 375 - mode |= VIDEO_SOUND_LANG1 | VIDEO_SOUND_STEREO; 376 - if (mode == 0) 377 - mode |= VIDEO_SOUND_MONO; 378 - return mode; 379 + if (rxsubchans == V4L2_TUNER_SUB_MONO) 380 + return VIDEO_SOUND_MONO; 381 + if (rxsubchans == V4L2_TUNER_SUB_STEREO) 382 + return VIDEO_SOUND_STEREO; 383 + if (audmode == V4L2_TUNER_MODE_LANG2) 384 + return VIDEO_SOUND_LANG2; 385 + return VIDEO_SOUND_LANG1; 379 386 } 380 387 381 388 static int msp_mode_v4l1_to_v4l2(int mode) ··· 590 605 break; 591 606 if (state->opmode == OPMODE_AUTOSELECT) 592 607 msp_detect_stereo(client); 593 - va->mode = msp_mode_v4l2_to_v4l1(state->rxsubchans); 608 + va->mode = msp_mode_v4l2_to_v4l1(state->rxsubchans, state->audmode); 594 609 break; 595 610 } 596 611 ··· 605 620 state->treble = va->treble; 606 621 msp_set_audio(client); 607 622 608 - if (va->mode != 0 && state->radio == 0) { 623 + if (va->mode != 0 && state->radio == 0 && 624 + state->audmode != msp_mode_v4l1_to_v4l2(va->mode)) { 609 625 state->audmode = msp_mode_v4l1_to_v4l2(va->mode); 610 626 msp_set_audmode(client); 611 627 } ··· 673 687 int sc_in = rt->input & 0x7; 674 688 int sc1_out = rt->output & 0xf; 675 689 int sc2_out = (rt->output >> 4) & 0xf; 676 - u16 val; 690 + u16 val, reg; 677 691 692 + if (state->routing.input == rt->input && 693 + state->routing.output == rt->output) 694 + break; 678 695 state->routing = *rt; 679 - if (state->opmode == OPMODE_AUTOSELECT) { 680 - val = msp_read_dem(client, 0x30) & ~0x100; 681 - msp_write_dem(client, 0x30, val | (tuner ? 0x100 : 0)); 682 - } else { 683 - val = msp_read_dem(client, 0xbb) & ~0x100; 684 - msp_write_dem(client, 0xbb, val | (tuner ? 0x100 : 0)); 685 - } 686 696 msp_set_scart(client, sc_in, 0); 687 697 msp_set_scart(client, sc1_out, 1); 688 698 msp_set_scart(client, sc2_out, 2); 689 699 msp_set_audmode(client); 690 - msp_wake_thread(client); 700 + reg = (state->opmode == OPMODE_AUTOSELECT) ? 0x30 : 0xbb; 701 + val = msp_read_dem(client, reg); 702 + if (tuner != ((val >> 8) & 1)) { 703 + msp_write_dem(client, reg, (val & ~0x100) | (tuner << 8)); 704 + /* wake thread when a new tuner input is chosen */ 705 + msp_wake_thread(client); 706 + } 691 707 break; 692 708 } 693 709 ··· 703 715 msp_detect_stereo(client); 704 716 vt->audmode = state->audmode; 705 717 vt->rxsubchans = state->rxsubchans; 706 - vt->capability = V4L2_TUNER_CAP_STEREO | 718 + vt->capability |= V4L2_TUNER_CAP_STEREO | 707 719 V4L2_TUNER_CAP_LANG1 | V4L2_TUNER_CAP_LANG2; 708 720 break; 709 721 } ··· 713 725 struct v4l2_tuner *vt = (struct v4l2_tuner *)arg; 714 726 715 727 if (state->radio) /* TODO: add mono/stereo support for radio */ 728 + break; 729 + if (state->audmode == vt->audmode) 716 730 break; 717 731 state->audmode = vt->audmode; 718 732 /* only set audmode */ ··· 877 887 878 888 memset(state, 0, sizeof(*state)); 879 889 state->v4l2_std = V4L2_STD_NTSC; 880 - state->audmode = V4L2_TUNER_MODE_LANG1; 890 + state->audmode = V4L2_TUNER_MODE_STEREO; 881 891 state->volume = 58880; /* 0db gain */ 882 892 state->balance = 32768; /* 0db gain */ 883 893 state->bass = 32768; ··· 921 931 state->has_radio = msp_revision >= 'G'; 922 932 /* Has headphones output: not for stripped down products */ 923 933 state->has_headphones = msp_prod_lo < 5; 934 + /* Has scart2 input: not in stripped down products of the '3' family */ 935 + state->has_scart2 = msp_family >= 4 || msp_prod_lo < 7; 936 + /* Has scart3 input: not in stripped down products of the '3' family */ 937 + state->has_scart3 = msp_family >= 4 || msp_prod_lo < 5; 924 938 /* Has scart4 input: not in pre D revisions, not in stripped D revs */ 925 939 state->has_scart4 = msp_family >= 4 || (msp_revision >= 'D' && msp_prod_lo < 5); 926 - /* Has scart2 and scart3 inputs and scart2 output: not in stripped 927 - down products of the '3' family */ 928 - state->has_scart23_in_scart2_out = msp_family >= 4 || msp_prod_lo < 5; 940 + /* Has scart2 output: not in stripped down products of the '3' family */ 941 + state->has_scart2_out = msp_family >= 4 || msp_prod_lo < 5; 929 942 /* Has scart2 a volume control? Not in pre-D revisions. */ 930 - state->has_scart2_out_volume = msp_revision > 'C' && state->has_scart23_in_scart2_out; 943 + state->has_scart2_out_volume = msp_revision > 'C' && state->has_scart2_out; 931 944 /* Has a configurable i2s out? */ 932 945 state->has_i2s_conf = msp_revision >= 'G' && msp_prod_lo < 7; 933 946 /* Has subwoofer output: not in pre-D revs and not in stripped down products */
+4 -2
drivers/media/video/msp3400-driver.h
··· 54 54 u8 has_radio; 55 55 u8 has_headphones; 56 56 u8 has_ntsc_jp_d_k3; 57 + u8 has_scart2; 58 + u8 has_scart3; 57 59 u8 has_scart4; 58 - u8 has_scart23_in_scart2_out; 60 + u8 has_scart2_out; 59 61 u8 has_scart2_out_volume; 60 62 u8 has_i2s_conf; 61 63 u8 has_subwoofer; ··· 85 83 int volume, muted; 86 84 int balance, loudness; 87 85 int bass, treble; 86 + int scan_in_progress; 88 87 89 88 /* thread */ 90 89 struct task_struct *kthread; ··· 101 98 int msp_read_dsp(struct i2c_client *client, int addr); 102 99 int msp_reset(struct i2c_client *client); 103 100 void msp_set_scart(struct i2c_client *client, int in, int out); 104 - void msp_set_mute(struct i2c_client *client); 105 101 void msp_set_audio(struct i2c_client *client); 106 102 int msp_sleep(struct msp_state *state, int timeout); 107 103
+64 -57
drivers/media/video/msp3400-kthreads.c
··· 170 170 msp_write_dsp(client, 0x000a, src); 171 171 msp_write_dsp(client, 0x000b, src); 172 172 msp_write_dsp(client, 0x000c, src); 173 - if (state->has_scart23_in_scart2_out) 173 + if (state->has_scart2_out) 174 174 msp_write_dsp(client, 0x0041, src); 175 175 } 176 176 ··· 228 228 char *modestr = (state->audmode >= 0 && state->audmode < 5) ? 229 229 strmode[state->audmode] : "unknown"; 230 230 int src = 0; /* channel source: FM/AM, nicam or SCART */ 231 + int audmode = state->audmode; 231 232 232 233 if (state->opmode == OPMODE_AUTOSELECT) { 233 234 /* this method would break everything, let's make sure ··· 240 239 return; 241 240 } 242 241 242 + /* Note: for the C and D revs no NTSC stereo + SAP is possible as 243 + the hardware does not support SAP. So the rxsubchans combination 244 + of STEREO | LANG2 does not occur. */ 245 + 246 + /* switch to mono if only mono is available */ 247 + if (state->rxsubchans == V4L2_TUNER_SUB_MONO) 248 + audmode = V4L2_TUNER_MODE_MONO; 249 + /* if bilingual */ 250 + else if (state->rxsubchans & V4L2_TUNER_SUB_LANG2) { 251 + /* and mono or stereo, then fallback to lang1 */ 252 + if (audmode == V4L2_TUNER_MODE_MONO || 253 + audmode == V4L2_TUNER_MODE_STEREO) 254 + audmode = V4L2_TUNER_MODE_LANG1; 255 + } 256 + /* if stereo, and audmode is not mono, then switch to stereo */ 257 + else if (audmode != V4L2_TUNER_MODE_MONO) 258 + audmode = V4L2_TUNER_MODE_STEREO; 259 + 243 260 /* switch demodulator */ 244 261 switch (state->mode) { 245 262 case MSP_MODE_FM_TERRA: 246 263 v4l_dbg(1, msp_debug, client, "FM set_audmode: %s\n", modestr); 247 - switch (state->audmode) { 264 + switch (audmode) { 248 265 case V4L2_TUNER_MODE_STEREO: 249 266 msp_write_dsp(client, 0x000e, 0x3001); 250 267 break; ··· 276 257 break; 277 258 case MSP_MODE_FM_SAT: 278 259 v4l_dbg(1, msp_debug, client, "SAT set_audmode: %s\n", modestr); 279 - switch (state->audmode) { 260 + switch (audmode) { 280 261 case V4L2_TUNER_MODE_MONO: 281 262 msp3400c_set_carrier(client, MSP_CARRIER(6.5), MSP_CARRIER(6.5)); 282 263 break; ··· 315 296 } 316 297 317 298 /* switch audio */ 318 - switch (state->audmode) { 299 + v4l_dbg(1, msp_debug, client, "set audmode %d\n", audmode); 300 + switch (audmode) { 319 301 case V4L2_TUNER_MODE_STEREO: 320 302 case V4L2_TUNER_MODE_LANG1_LANG2: 321 303 src |= 0x0020; ··· 334 314 src = 0x0030; 335 315 break; 336 316 case V4L2_TUNER_MODE_LANG1: 337 - /* switch to stereo for stereo transmission, otherwise 338 - keep first language */ 339 - if (state->rxsubchans & V4L2_TUNER_SUB_STEREO) 340 - src |= 0x0020; 341 317 break; 342 318 case V4L2_TUNER_MODE_LANG2: 343 319 src |= 0x0010; ··· 383 367 if (val > 32767) 384 368 val -= 65536; 385 369 v4l_dbg(2, msp_debug, client, "stereo detect register: %d\n", val); 386 - if (val > 4096) { 370 + if (val > 8192) { 387 371 rxsubchans = V4L2_TUNER_SUB_STEREO; 388 372 } else if (val < -4096) { 389 373 rxsubchans = V4L2_TUNER_SUB_LANG1 | V4L2_TUNER_SUB_LANG2; ··· 480 464 if (state->radio || MSP_MODE_EXTERN == state->mode) { 481 465 /* no carrier scan, just unmute */ 482 466 v4l_dbg(1, msp_debug, client, "thread: no carrier scan\n"); 467 + state->scan_in_progress = 0; 483 468 msp_set_audio(client); 484 469 continue; 485 470 } 486 471 487 - /* mute */ 488 - msp_set_mute(client); 472 + /* mute audio */ 473 + state->scan_in_progress = 1; 474 + msp_set_audio(client); 475 + 489 476 msp3400c_set_mode(client, MSP_MODE_AM_DETECT); 490 477 val1 = val2 = 0; 491 478 max1 = max2 = -1; 492 479 state->watch_stereo = 0; 493 480 state->nicam_on = 0; 494 481 495 - /* some time for the tuner to sync */ 482 + /* wait for tuner to settle down after a channel change */ 496 483 if (msp_sleep(state, 200)) 497 484 goto restart; 498 485 ··· 571 552 /* B/G NICAM */ 572 553 state->second = msp3400c_carrier_detect_55[max2].cdo; 573 554 msp3400c_set_mode(client, MSP_MODE_FM_NICAM1); 574 - msp3400c_set_carrier(client, state->second, state->main); 575 555 state->nicam_on = 1; 576 556 state->watch_stereo = 1; 577 557 } else { ··· 581 563 /* PAL I NICAM */ 582 564 state->second = MSP_CARRIER(6.552); 583 565 msp3400c_set_mode(client, MSP_MODE_FM_NICAM2); 584 - msp3400c_set_carrier(client, state->second, state->main); 585 566 state->nicam_on = 1; 586 567 state->watch_stereo = 1; 587 568 break; ··· 594 577 /* L NICAM or AM-mono */ 595 578 state->second = msp3400c_carrier_detect_65[max2].cdo; 596 579 msp3400c_set_mode(client, MSP_MODE_AM_NICAM); 597 - msp3400c_set_carrier(client, state->second, state->main); 598 580 state->watch_stereo = 1; 599 581 } else if (max2 == 0 && state->has_nicam) { 600 582 /* D/K NICAM */ 601 583 state->second = msp3400c_carrier_detect_65[max2].cdo; 602 584 msp3400c_set_mode(client, MSP_MODE_FM_NICAM1); 603 - msp3400c_set_carrier(client, state->second, state->main); 604 585 state->nicam_on = 1; 605 586 state->watch_stereo = 1; 606 587 } else { ··· 610 595 no_second: 611 596 state->second = msp3400c_carrier_detect_main[max1].cdo; 612 597 msp3400c_set_mode(client, MSP_MODE_FM_TERRA); 613 - msp3400c_set_carrier(client, state->second, state->main); 614 - state->rxsubchans = V4L2_TUNER_SUB_MONO; 615 598 break; 616 599 } 600 + msp3400c_set_carrier(client, state->second, state->main); 617 601 618 602 /* unmute */ 619 - msp_set_audio(client); 603 + state->scan_in_progress = 0; 620 604 msp3400c_set_audmode(client); 605 + msp_set_audio(client); 621 606 622 607 if (msp_debug) 623 608 msp3400c_print_mode(client); 624 609 625 610 /* monitor tv audio mode, the first time don't wait 626 611 so long to get a quick stereo/bilingual result */ 627 - if (msp_sleep(state, 1000)) 628 - goto restart; 612 + count = 3; 629 613 while (state->watch_stereo) { 630 - if (msp_sleep(state, 5000)) 614 + if (msp_sleep(state, count ? 1000 : 5000)) 631 615 goto restart; 616 + if (count) count--; 632 617 watch_stereo(client); 633 618 } 634 619 } ··· 641 626 { 642 627 struct i2c_client *client = data; 643 628 struct msp_state *state = i2c_get_clientdata(client); 644 - int val, i, std; 629 + int val, i, std, count; 645 630 646 631 v4l_dbg(1, msp_debug, client, "msp3410 daemon started\n"); 647 632 ··· 659 644 if (state->mode == MSP_MODE_EXTERN) { 660 645 /* no carrier scan needed, just unmute */ 661 646 v4l_dbg(1, msp_debug, client, "thread: no carrier scan\n"); 647 + state->scan_in_progress = 0; 662 648 msp_set_audio(client); 663 649 continue; 664 650 } 665 651 666 - /* put into sane state (and mute) */ 667 - msp_reset(client); 668 - 669 - /* some time for the tuner to sync */ 670 - if (msp_sleep(state,200)) 671 - goto restart; 652 + /* mute audio */ 653 + state->scan_in_progress = 1; 654 + msp_set_audio(client); 672 655 673 656 /* start autodetect. Note: autodetect is not supported for 674 657 NTSC-M and radio, hence we force the standard in those cases. */ ··· 676 663 std = (state->v4l2_std & V4L2_STD_NTSC) ? 0x20 : 1; 677 664 state->watch_stereo = 0; 678 665 state->nicam_on = 0; 666 + 667 + /* wait for tuner to settle down after a channel change */ 668 + if (msp_sleep(state, 200)) 669 + goto restart; 679 670 680 671 if (msp_debug) 681 672 v4l_dbg(2, msp_debug, client, "setting standard: %s (0x%04x)\n", ··· 710 693 state->main = msp_stdlist[i].main; 711 694 state->second = msp_stdlist[i].second; 712 695 state->std = val; 696 + state->rxsubchans = V4L2_TUNER_SUB_MONO; 713 697 714 698 if (msp_amsound && !state->radio && (state->v4l2_std & V4L2_STD_SECAM) && 715 699 (val != 0x0009)) { ··· 732 714 else 733 715 state->mode = MSP_MODE_FM_NICAM1; 734 716 /* just turn on stereo */ 735 - state->rxsubchans = V4L2_TUNER_SUB_STEREO; 736 717 state->nicam_on = 1; 737 718 state->watch_stereo = 1; 738 719 break; 739 720 case 0x0009: 740 721 state->mode = MSP_MODE_AM_NICAM; 741 - state->rxsubchans = V4L2_TUNER_SUB_MONO; 742 722 state->nicam_on = 1; 743 723 state->watch_stereo = 1; 744 724 break; 745 725 case 0x0020: /* BTSC */ 746 726 /* The pre-'G' models only have BTSC-mono */ 747 727 state->mode = MSP_MODE_BTSC; 748 - state->rxsubchans = V4L2_TUNER_SUB_MONO; 749 728 break; 750 729 case 0x0040: /* FM radio */ 751 730 state->mode = MSP_MODE_FM_RADIO; ··· 752 737 msp3400c_set_mode(client, MSP_MODE_FM_RADIO); 753 738 msp3400c_set_carrier(client, MSP_CARRIER(10.7), 754 739 MSP_CARRIER(10.7)); 755 - /* scart routing (this doesn't belong here I think) */ 756 - msp_set_scart(client,SCART_IN2,0); 757 740 break; 758 741 case 0x0002: 759 742 case 0x0003: 760 743 case 0x0004: 761 744 case 0x0005: 762 745 state->mode = MSP_MODE_FM_TERRA; 763 - state->rxsubchans = V4L2_TUNER_SUB_MONO; 764 746 state->watch_stereo = 1; 765 747 break; 766 748 } ··· 771 759 if (state->has_i2s_conf) 772 760 msp_write_dem(client, 0x40, state->i2s_mode); 773 761 774 - /* unmute, restore misc registers */ 775 - msp_set_audio(client); 776 - 777 - msp_write_dsp(client, 0x13, state->acb); 762 + /* unmute */ 778 763 msp3400c_set_audmode(client); 764 + state->scan_in_progress = 0; 765 + msp_set_audio(client); 779 766 780 767 /* monitor tv audio mode, the first time don't wait 781 768 so long to get a quick stereo/bilingual result */ 782 - if (msp_sleep(state, 1000)) 783 - goto restart; 769 + count = 3; 784 770 while (state->watch_stereo) { 785 - watch_stereo(client); 786 - if (msp_sleep(state, 5000)) 771 + if (msp_sleep(state, count ? 1000 : 5000)) 787 772 goto restart; 773 + if (count) count--; 774 + watch_stereo(client); 788 775 } 789 776 } 790 777 v4l_dbg(1, msp_debug, client, "thread: exit\n"); ··· 840 829 source = 0; /* mono only */ 841 830 matrix = 0x30; 842 831 break; 843 - case V4L2_TUNER_MODE_LANG1: 844 - source = 3; /* stereo or A */ 845 - matrix = 0x00; 846 - break; 847 832 case V4L2_TUNER_MODE_LANG2: 848 833 source = 4; /* stereo or B */ 849 834 matrix = 0x10; 850 835 break; 851 - case V4L2_TUNER_MODE_STEREO: 852 836 case V4L2_TUNER_MODE_LANG1_LANG2: 853 - default: 854 837 source = 1; /* stereo or A|B */ 855 838 matrix = 0x20; 856 839 break; 840 + case V4L2_TUNER_MODE_STEREO: 841 + case V4L2_TUNER_MODE_LANG1: 842 + default: 843 + source = 3; /* stereo or A */ 844 + matrix = 0x00; 845 + break; 857 846 } 858 847 859 - if (in == MSP_DSP_OUT_TUNER) 848 + if (in == MSP_DSP_IN_TUNER) 860 849 source = (source << 8) | 0x20; 861 850 /* the msp34x2g puts the MAIN_AVC, MAIN and AUX sources in 12, 13, 14 862 851 instead of 11, 12, 13. So we add one for that msp version. */ 863 - else if (in >= MSP_DSP_OUT_MAIN_AVC && state->has_dolby_pro_logic) 852 + else if (in >= MSP_DSP_IN_MAIN_AVC && state->has_dolby_pro_logic) 864 853 source = ((in + 1) << 8) | matrix; 865 854 else 866 855 source = (in << 8) | matrix; ··· 880 869 msp34xxg_set_source(client, 0x000c, (in >> 4) & 0xf); 881 870 msp34xxg_set_source(client, 0x0009, (in >> 8) & 0xf); 882 871 msp34xxg_set_source(client, 0x000a, (in >> 12) & 0xf); 883 - if (state->has_scart23_in_scart2_out) 872 + if (state->has_scart2_out) 884 873 msp34xxg_set_source(client, 0x0041, (in >> 16) & 0xf); 885 874 msp34xxg_set_source(client, 0x000b, (in >> 20) & 0xf); 886 875 } ··· 897 886 state->std = 1; 898 887 899 888 msp_reset(client); 900 - 901 - /* make sure that input/output is muted (paranoid mode) */ 902 - /* ACB, mute DSP input, mute SCART 1 */ 903 - msp_write_dsp(client, 0x13, 0x0f20); 904 889 905 890 if (state->has_i2s_conf) 906 891 msp_write_dem(client, 0x40, state->i2s_mode); ··· 1035 1028 1036 1029 if (state->std == 0x20) { 1037 1030 if ((state->rxsubchans & V4L2_TUNER_SUB_SAP) && 1038 - (state->audmode == V4L2_TUNER_MODE_STEREO || 1031 + (state->audmode == V4L2_TUNER_MODE_LANG1_LANG2 || 1039 1032 state->audmode == V4L2_TUNER_MODE_LANG2)) { 1040 1033 msp_write_dem(client, 0x20, 0x21); 1041 1034 } else {
+28
drivers/media/video/pwc/Kconfig
··· 1 + config USB_PWC 2 + tristate "USB Philips Cameras" 3 + depends on USB && VIDEO_DEV 4 + ---help--- 5 + Say Y or M here if you want to use one of these Philips & OEM 6 + webcams: 7 + * Philips PCA645, PCA646 8 + * Philips PCVC675, PCVC680, PCVC690 9 + * Philips PCVC720/40, PCVC730, PCVC740, PCVC750 10 + * Askey VC010 11 + * Logitech QuickCam Pro 3000, 4000, 'Zoom', 'Notebook Pro' 12 + and 'Orbit'/'Sphere' 13 + * Samsung MPC-C10, MPC-C30 14 + * Creative Webcam 5, Pro Ex 15 + * SOTEC Afina Eye 16 + * Visionite VCS-UC300, VCS-UM100 17 + 18 + The PCA635, PCVC665 and PCVC720/20 are not supported by this driver 19 + and never will be, but the 665 and 720/20 are supported by other 20 + drivers. 21 + 22 + See <file:Documentation/usb/philips.txt> for more information and 23 + installation instructions. 24 + 25 + The built-in microphone is enabled by selecting USB Audio support. 26 + 27 + To compile this driver as a module, choose M here: the 28 + module will be called pwc.
+53 -12
drivers/media/video/saa7115.c
··· 40 40 #include <linux/i2c.h> 41 41 #include <linux/videodev2.h> 42 42 #include <media/v4l2-common.h> 43 + #include <media/saa7115.h> 43 44 #include <asm/div64.h> 44 45 45 46 MODULE_DESCRIPTION("Philips SAA7113/SAA7114/SAA7115 video decoder driver"); ··· 54 53 MODULE_PARM_DESC(debug, "Debug level (0-1)"); 55 54 56 55 static unsigned short normal_i2c[] = { 57 - 0x4a >>1, 0x48 >>1, /* SAA7113 */ 56 + 0x4a >> 1, 0x48 >> 1, /* SAA7113 */ 58 57 0x42 >> 1, 0x40 >> 1, /* SAA7114 and SAA7115 */ 59 58 I2C_CLIENT_END }; 60 59 ··· 723 722 100 reserved NTSC-Japan (3.58MHz) 724 723 */ 725 724 if (state->ident == V4L2_IDENT_SAA7113) { 726 - u8 reg = saa7115_read(client, 0x0e) & 0x8f; 725 + u8 reg = saa7115_read(client, 0x0e) & 0x8f; 727 726 728 727 if (std == V4L2_STD_PAL_M) { 729 - reg|=0x30; 728 + reg |= 0x30; 730 729 } else if (std == V4L2_STD_PAL_N) { 731 - reg|=0x20; 730 + reg |= 0x20; 732 731 } else if (std == V4L2_STD_PAL_60) { 733 - reg|=0x10; 732 + reg |= 0x10; 734 733 } else if (std == V4L2_STD_NTSC_M_JP) { 735 - reg|=0x40; 734 + reg |= 0x40; 736 735 } 737 736 saa7115_write(client, 0x0e, reg); 738 737 } ··· 812 811 u8 lcr[24]; 813 812 int i, x; 814 813 815 - /* saa7113/71144 doesn't yet support VBI */ 814 + /* saa7113/7114 doesn't yet support VBI */ 816 815 if (state->ident != V4L2_IDENT_SAA7115) 817 816 return; 818 817 ··· 852 851 case 0: 853 852 lcr[i] |= 0xf << (4 * x); 854 853 break; 855 - case V4L2_SLICED_TELETEXT_PAL_B: 854 + case V4L2_SLICED_TELETEXT_B: 856 855 lcr[i] |= 1 << (4 * x); 857 856 break; 858 857 case V4L2_SLICED_CAPTION_525: ··· 881 880 static int saa7115_get_v4lfmt(struct i2c_client *client, struct v4l2_format *fmt) 882 881 { 883 882 static u16 lcr2vbi[] = { 884 - 0, V4L2_SLICED_TELETEXT_PAL_B, 0, /* 1 */ 883 + 0, V4L2_SLICED_TELETEXT_B, 0, /* 1 */ 885 884 0, V4L2_SLICED_CAPTION_525, /* 4 */ 886 885 V4L2_SLICED_WSS_625, 0, /* 5 */ 887 886 V4L2_SLICED_VPS, 0, 0, 0, 0, /* 7 */ ··· 1046 1045 /* decode payloads */ 1047 1046 switch (id2) { 1048 1047 case 1: 1049 - vbi->type = V4L2_SLICED_TELETEXT_PAL_B; 1048 + vbi->type = V4L2_SLICED_TELETEXT_B; 1050 1049 break; 1051 1050 case 4: 1052 1051 if (!saa7115_odd_parity(p[0]) || !saa7115_odd_parity(p[1])) ··· 1180 1179 case AUDC_SET_RADIO: 1181 1180 state->radio = 1; 1182 1181 break; 1182 + 1183 + case VIDIOC_INT_G_VIDEO_ROUTING: 1184 + { 1185 + struct v4l2_routing *route = arg; 1186 + 1187 + route->input = state->input; 1188 + route->output = 0; 1189 + break; 1190 + } 1191 + 1192 + case VIDIOC_INT_S_VIDEO_ROUTING: 1193 + { 1194 + struct v4l2_routing *route = arg; 1195 + 1196 + v4l_dbg(1, debug, client, "decoder set input %d\n", route->input); 1197 + /* saa7113 does not have these inputs */ 1198 + if (state->ident == V4L2_IDENT_SAA7113 && 1199 + (route->input == SAA7115_COMPOSITE4 || 1200 + route->input == SAA7115_COMPOSITE5)) { 1201 + return -EINVAL; 1202 + } 1203 + if (route->input > SAA7115_SVIDEO3) 1204 + return -EINVAL; 1205 + if (state->input == route->input) 1206 + break; 1207 + v4l_dbg(1, debug, client, "now setting %s input\n", 1208 + (route->input >= SAA7115_SVIDEO0) ? "S-Video" : "Composite"); 1209 + state->input = route->input; 1210 + 1211 + /* select mode */ 1212 + saa7115_write(client, 0x02, 1213 + (saa7115_read(client, 0x02) & 0xf0) | 1214 + state->input); 1215 + 1216 + /* bypass chrominance trap for S-Video modes */ 1217 + saa7115_write(client, 0x09, 1218 + (saa7115_read(client, 0x09) & 0x7f) | 1219 + (state->input >= SAA7115_SVIDEO0 ? 0x80 : 0x0)); 1220 + break; 1221 + } 1183 1222 1184 1223 case VIDIOC_G_INPUT: 1185 1224 *(int *)arg = state->input; ··· 1362 1321 1363 1322 saa7115_write(client, 0, 5); 1364 1323 chip_id = saa7115_read(client, 0) & 0x0f; 1365 - if (chip_id <3 && chip_id > 5) { 1324 + if (chip_id < 3 && chip_id > 5) { 1366 1325 v4l_dbg(1, debug, client, "saa7115 not found\n"); 1367 1326 kfree(client); 1368 1327 return 0; ··· 1401 1360 v4l_dbg(1, debug, client, "writing init values\n"); 1402 1361 1403 1362 /* init to 60hz/48khz */ 1404 - if (state->ident==V4L2_IDENT_SAA7113) 1363 + if (state->ident == V4L2_IDENT_SAA7113) 1405 1364 saa7115_writeregs(client, saa7113_init_auto_input); 1406 1365 else 1407 1366 saa7115_writeregs(client, saa7115_init_auto_input);
+18 -25
drivers/media/video/saa7127.c
··· 54 54 #include <linux/i2c.h> 55 55 #include <linux/videodev2.h> 56 56 #include <media/v4l2-common.h> 57 + #include <media/saa7127.h> 57 58 58 59 static int debug = 0; 59 60 static int test_image = 0; ··· 221 220 { SAA7127_REG_MULTI, 0xa0 }, 222 221 { SAA7127_REG_CLOSED_CAPTION, 0x00 }, 223 222 { 0, 0 } 224 - }; 225 - 226 - /* Enumeration for the Supported input types */ 227 - enum saa7127_input_type { 228 - SAA7127_INPUT_TYPE_NORMAL, 229 - SAA7127_INPUT_TYPE_TEST_IMAGE 230 - }; 231 - 232 - /* Enumeration for the Supported Output signal types */ 233 - enum saa7127_output_type { 234 - SAA7127_OUTPUT_TYPE_BOTH, 235 - SAA7127_OUTPUT_TYPE_COMPOSITE, 236 - SAA7127_OUTPUT_TYPE_SVIDEO, 237 - SAA7127_OUTPUT_TYPE_RGB, 238 - SAA7127_OUTPUT_TYPE_YUV_C, 239 - SAA7127_OUTPUT_TYPE_YUV_V 240 223 }; 241 224 242 225 /* ··· 546 561 { 547 562 struct saa7127_state *state = i2c_get_clientdata(client); 548 563 struct v4l2_format *fmt = arg; 549 - int *iarg = arg; 564 + struct v4l2_routing *route = arg; 550 565 551 566 switch (cmd) { 552 567 case VIDIOC_S_STD: ··· 558 573 *(v4l2_std_id *)arg = state->std; 559 574 break; 560 575 561 - case VIDIOC_S_INPUT: 562 - if (state->input_type == *iarg) 563 - break; 564 - return saa7127_set_input_type(client, *iarg); 576 + case VIDIOC_INT_G_VIDEO_ROUTING: 577 + route->input = state->input_type; 578 + route->output = state->output_type; 579 + break; 565 580 566 - case VIDIOC_S_OUTPUT: 567 - if (state->output_type == *iarg) 568 - break; 569 - return saa7127_set_output_type(client, *iarg); 581 + case VIDIOC_INT_S_VIDEO_ROUTING: 582 + { 583 + int rc = 0; 584 + 585 + if (state->input_type != route->input) { 586 + rc = saa7127_set_input_type(client, route->input); 587 + } 588 + if (rc == 0 && state->output_type != route->output) { 589 + rc = saa7127_set_output_type(client, route->output); 590 + } 591 + return rc; 592 + } 570 593 571 594 case VIDIOC_STREAMON: 572 595 case VIDIOC_STREAMOFF:
+1
drivers/media/video/saa7134/Kconfig
··· 39 39 tristate "DVB/ATSC Support for saa7134 based TV cards" 40 40 depends on VIDEO_SAA7134 && DVB_CORE 41 41 select VIDEO_BUF_DVB 42 + select FW_LOADER 42 43 ---help--- 43 44 This adds support for DVB cards based on the 44 45 Philips saa7134 chip.
+63 -3
drivers/media/video/saa7134/saa7134-cards.c
··· 208 208 [SAA7134_BOARD_FLYTVPLATINUM_FM] = { 209 209 /* LifeView FlyTV Platinum FM (LR214WF) */ 210 210 /* "Peter Missel <peter.missel@onlinehome.de> */ 211 - .name = "LifeView FlyTV Platinum FM", 211 + .name = "LifeView FlyTV Platinum FM / Gold", 212 212 .audio_clock = 0x00200000, 213 213 .tuner_type = TUNER_PHILIPS_TDA8290, 214 214 .radio_type = UNSET, ··· 2660 2660 .mpeg = SAA7134_MPEG_DVB, 2661 2661 .inputs = {{ 2662 2662 .name = name_comp1, 2663 - .vmux = 0, 2663 + .vmux = 1, 2664 2664 .amux = LINE1, 2665 2665 },{ 2666 2666 .name = name_svideo, ··· 2671 2671 [SAA7134_BOARD_FLYDVBT_LR301] = { 2672 2672 /* LifeView FlyDVB-T */ 2673 2673 /* Giampiero Giancipoli <gianci@libero.it> */ 2674 - .name = "LifeView FlyDVB-T", 2674 + .name = "LifeView FlyDVB-T / Genius VideoWonder DVB-T", 2675 2675 .audio_clock = 0x00200000, 2676 2676 .tuner_type = TUNER_ABSENT, 2677 2677 .radio_type = UNSET, ··· 2807 2807 .radio_type = UNSET, 2808 2808 .tuner_addr = ADDR_UNSET, 2809 2809 .radio_addr = ADDR_UNSET, 2810 + }, 2811 + [SAA7134_BOARD_FLYDVBT_HYBRID_CARDBUS] = { 2812 + .name = "LifeView FlyDVB-T Hybrid Cardbus", 2813 + .audio_clock = 0x00200000, 2814 + .tuner_type = TUNER_PHILIPS_TDA8290, 2815 + .radio_type = UNSET, 2816 + .tuner_addr = ADDR_UNSET, 2817 + .radio_addr = ADDR_UNSET, 2818 + .mpeg = SAA7134_MPEG_DVB, 2819 + .gpiomask = 0x00600000, /* Bit 21 0=Radio, Bit 22 0=TV */ 2820 + .inputs = {{ 2821 + .name = name_tv, 2822 + .vmux = 1, 2823 + .amux = TV, 2824 + .gpio = 0x200000, /* GPIO21=High for TV input */ 2825 + .tv = 1, 2826 + },{ 2827 + .name = name_svideo, /* S-Video signal on S-Video input */ 2828 + .vmux = 8, 2829 + .amux = LINE2, 2830 + },{ 2831 + .name = name_comp1, /* Composite signal on S-Video input */ 2832 + .vmux = 0, 2833 + .amux = LINE2, 2834 + },{ 2835 + .name = name_comp2, /* Composite input */ 2836 + .vmux = 3, 2837 + .amux = LINE2, 2838 + }}, 2839 + .radio = { 2840 + .name = name_radio, 2841 + .amux = TV, 2842 + .gpio = 0x000000, /* GPIO21=Low for FM radio antenna */ 2843 + }, 2810 2844 }, 2811 2845 }; 2812 2846 ··· 3367 3333 .subdevice = 0x0005, 3368 3334 .driver_data = SAA7134_BOARD_MD7134_BRIDGE_2, 3369 3335 },{ 3336 + .vendor = PCI_VENDOR_ID_PHILIPS, 3337 + .device = PCI_DEVICE_ID_PHILIPS_SAA7134, 3338 + .subvendor = 0x1489, 3339 + .subdevice = 0x0301, 3340 + .driver_data = SAA7134_BOARD_FLYDVBT_LR301, 3341 + },{ 3342 + .vendor = PCI_VENDOR_ID_PHILIPS, 3343 + .device = PCI_DEVICE_ID_PHILIPS_SAA7133, 3344 + .subvendor = 0x5168, /* Animation Technologies (LifeView) */ 3345 + .subdevice = 0x0304, 3346 + .driver_data = SAA7134_BOARD_FLYTVPLATINUM_FM, 3347 + },{ 3348 + .vendor = PCI_VENDOR_ID_PHILIPS, 3349 + .device = PCI_DEVICE_ID_PHILIPS_SAA7133, 3350 + .subvendor = 0x5168, 3351 + .subdevice = 0x3306, 3352 + .driver_data = SAA7134_BOARD_FLYDVBT_HYBRID_CARDBUS, 3353 + },{ 3354 + .vendor = PCI_VENDOR_ID_PHILIPS, 3355 + .device = PCI_DEVICE_ID_PHILIPS_SAA7133, 3356 + .subvendor = 0x5168, 3357 + .subdevice = 0x3502, /* whats the difference to 0x3306 ?*/ 3358 + .driver_data = SAA7134_BOARD_FLYDVBT_HYBRID_CARDBUS, 3359 + },{ 3370 3360 /* --- boards without eeprom + subsystem ID --- */ 3371 3361 .vendor = PCI_VENDOR_ID_PHILIPS, 3372 3362 .device = PCI_DEVICE_ID_PHILIPS_SAA7134, ··· 3520 3462 saa_writeb(SAA7134_GPIO_GPSTATUS3, 0x06); 3521 3463 break; 3522 3464 case SAA7134_BOARD_ADS_DUO_CARDBUS_PTV331: 3465 + case SAA7134_BOARD_FLYDVBT_HYBRID_CARDBUS: 3523 3466 saa_writeb(SAA7134_GPIO_GPMODE3, 0x08); 3524 3467 saa_writeb(SAA7134_GPIO_GPSTATUS3, 0x00); 3525 3468 break; ··· 3692 3633 } 3693 3634 break; 3694 3635 case SAA7134_BOARD_ADS_DUO_CARDBUS_PTV331: 3636 + case SAA7134_BOARD_FLYDVBT_HYBRID_CARDBUS: 3695 3637 /* make the tda10046 find its eeprom */ 3696 3638 { 3697 3639 u8 data[] = { 0x3c, 0x33, 0x62};
+4
drivers/media/video/saa7134/saa7134-dvb.c
··· 1064 1064 dev->dvb.frontend = tda10046_attach(&tevion_dvbt220rf_config, 1065 1065 &dev->i2c_adap); 1066 1066 break; 1067 + case SAA7134_BOARD_FLYDVBT_HYBRID_CARDBUS: 1068 + dev->dvb.frontend = tda10046_attach(&ads_tech_duo_config, 1069 + &dev->i2c_adap); 1070 + break; 1067 1071 #endif 1068 1072 #ifdef HAVE_NXT200X 1069 1073 case SAA7134_BOARD_AVERMEDIA_AVERTVHD_A180:
+1
drivers/media/video/saa7134/saa7134.h
··· 220 220 #define SAA7134_BOARD_AVERMEDIA_A169_B 91 221 221 #define SAA7134_BOARD_AVERMEDIA_A169_B1 92 222 222 #define SAA7134_BOARD_MD7134_BRIDGE_2 93 223 + #define SAA7134_BOARD_FLYDVBT_HYBRID_CARDBUS 94 223 224 224 225 #define SAA7134_MAXBOARDS 8 225 226 #define SAA7134_INPUT_MAX 8
+11
drivers/media/video/sn9c102/Kconfig
··· 1 + config USB_SN9C102 2 + tristate "USB SN9C10x PC Camera Controller support" 3 + depends on USB && VIDEO_DEV 4 + ---help--- 5 + Say Y here if you want support for cameras based on SONiX SN9C101, 6 + SN9C102 or SN9C103 PC Camera Controllers. 7 + 8 + See <file:Documentation/video4linux/sn9c102.txt> for more info. 9 + 10 + To compile this driver as a module, choose M here: the 11 + module will be called sn9c102.
+7 -5
drivers/media/video/tuner-core.c
··· 401 401 } 402 402 tuner_info("Tuner mode: %s\n", p); 403 403 tuner_info("Frequency: %lu.%02lu MHz\n", freq, freq_fraction); 404 - tuner_info("Standard: 0x%08llx\n", t->std); 404 + tuner_info("Standard: 0x%08lx\n", (unsigned long)t->std); 405 405 if (t->mode != V4L2_TUNER_RADIO) 406 406 return; 407 407 if (t->has_signal) { ··· 558 558 559 559 static inline int check_v4l2(struct tuner *t) 560 560 { 561 - if (t->using_v4l2) { 562 - tuner_dbg ("ignore v4l1 call\n"); 563 - return EINVAL; 564 - } 561 + /* bttv still uses both v4l1 and v4l2 calls to the tuner (v4l2 for 562 + TV, v4l1 for radio), until that is fixed this code is disabled. 563 + Otherwise the radio (v4l1) wouldn't tune after using the TV (v4l2) 564 + first. */ 565 565 return 0; 566 566 } 567 567 ··· 744 744 switch_v4l2(); 745 745 746 746 tuner->type = t->mode; 747 + if (t->mode == V4L2_TUNER_ANALOG_TV) 748 + tuner->capability |= V4L2_TUNER_CAP_NORM; 747 749 if (t->mode != V4L2_TUNER_RADIO) { 748 750 tuner->rangelow = tv_range[0] * 16; 749 751 tuner->rangehigh = tv_range[1] * 16;
-15
drivers/media/video/tvaudio.c
··· 1706 1706 break; 1707 1707 } 1708 1708 1709 - case VIDIOC_S_AUDIO: 1710 - { 1711 - struct v4l2_audio *sarg = arg; 1712 - 1713 - if (!(desc->flags & CHIP_HAS_INPUTSEL) || sarg->index >= 4) 1714 - return -EINVAL; 1715 - /* There are four inputs: tuner, radio, extern and intern. */ 1716 - chip->input = sarg->index; 1717 - if (chip->muted) 1718 - break; 1719 - chip_write_masked(chip, desc->inputreg, 1720 - desc->inputmap[chip->input], desc->inputmask); 1721 - break; 1722 - } 1723 - 1724 1709 case VIDIOC_S_TUNER: 1725 1710 { 1726 1711 struct v4l2_tuner *vt = arg;
+3 -3
drivers/media/video/tveeprom.c
··· 757 757 static int 758 758 tveeprom_attach_adapter (struct i2c_adapter *adapter) 759 759 { 760 - if (adapter->id != I2C_HW_B_BT848) 761 - return 0; 762 - return i2c_probe(adapter, &addr_data, tveeprom_detect_client); 760 + if (adapter->class & I2C_CLASS_TV_ANALOG) 761 + return i2c_probe(adapter, &addr_data, tveeprom_detect_client); 762 + return 0; 763 763 } 764 764 765 765 static int
+17 -123
drivers/media/video/tvp5150.c
··· 53 53 .minimum = 0, 54 54 .maximum = 255, 55 55 .step = 1, 56 - .default_value = 0, 56 + .default_value = 128, 57 57 .flags = 0, 58 58 }, { 59 59 .id = V4L2_CID_CONTRAST, ··· 62 62 .minimum = 0, 63 63 .maximum = 255, 64 64 .step = 0x1, 65 - .default_value = 0x10, 65 + .default_value = 128, 66 66 .flags = 0, 67 67 }, { 68 68 .id = V4L2_CID_SATURATION, ··· 71 71 .minimum = 0, 72 72 .maximum = 255, 73 73 .step = 0x1, 74 - .default_value = 0x10, 74 + .default_value = 128, 75 75 .flags = 0, 76 76 }, { 77 77 .id = V4L2_CID_HUE, ··· 80 80 .minimum = -128, 81 81 .maximum = 127, 82 82 .step = 0x1, 83 - .default_value = 0x10, 83 + .default_value = 0, 84 84 .flags = 0, 85 85 } 86 86 }; ··· 500 500 501 501 static struct i2c_vbi_ram_value vbi_ram_default[] = 502 502 { 503 + /* FIXME: Current api doesn't handle all VBI types, those not 504 + yet supported are placed under #if 0 */ 505 + #if 0 503 506 {0x010, /* Teletext, SECAM, WST System A */ 504 507 {V4L2_SLICED_TELETEXT_SECAM,6,23,1}, 505 508 { 0xaa, 0xaa, 0xff, 0xff, 0xe7, 0x2e, 0x20, 0x26, 506 509 0xe6, 0xb4, 0x0e, 0x00, 0x00, 0x00, 0x10, 0x00 } 507 510 }, 511 + #endif 508 512 {0x030, /* Teletext, PAL, WST System B */ 509 - {V4L2_SLICED_TELETEXT_PAL_B,6,22,1}, 513 + {V4L2_SLICED_TELETEXT_B,6,22,1}, 510 514 { 0xaa, 0xaa, 0xff, 0xff, 0x27, 0x2e, 0x20, 0x2b, 511 515 0xa6, 0x72, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00 } 512 516 }, 517 + #if 0 513 518 {0x050, /* Teletext, PAL, WST System C */ 514 519 {V4L2_SLICED_TELETEXT_PAL_C,6,22,1}, 515 520 { 0xaa, 0xaa, 0xff, 0xff, 0xe7, 0x2e, 0x20, 0x22, ··· 540 535 { 0xaa, 0x2a, 0xff, 0x3f, 0x04, 0x51, 0x6e, 0x02, 541 536 0xa6, 0x7b, 0x09, 0x00, 0x00, 0x00, 0x27, 0x00 } 542 537 }, 538 + #endif 543 539 {0x0f0, /* Closed Caption, NTSC */ 544 540 {V4L2_SLICED_CAPTION_525,21,21,1}, 545 541 { 0xaa, 0x2a, 0xff, 0x3f, 0x04, 0x51, 0x6e, 0x02, ··· 551 545 { 0x5b, 0x55, 0xc5, 0xff, 0x00, 0x71, 0x6e, 0x42, 552 546 0xa6, 0xcd, 0x0f, 0x00, 0x00, 0x00, 0x3a, 0x00 } 553 547 }, 548 + #if 0 554 549 {0x130, /* Wide Screen Signal, NTSC C */ 555 550 {V4L2_SLICED_WSS_525,20,20,1}, 556 551 { 0x38, 0x00, 0x3f, 0x00, 0x00, 0x71, 0x6e, 0x43, ··· 567 560 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x8f, 0x6d, 0x49, 568 561 0x69, 0x94, 0x08, 0x00, 0x00, 0x00, 0x4c, 0x00 } 569 562 }, 563 + #endif 570 564 {0x190, /* Video Program System (VPS), PAL */ 571 565 {V4L2_SLICED_VPS,16,16,0}, 572 566 { 0xaa, 0xaa, 0xff, 0xff, 0xba, 0xce, 0x2b, 0x0d, ··· 858 850 859 851 case 0: 860 852 case VIDIOC_INT_RESET: 861 - case DECODER_INIT: 862 853 tvp5150_reset(c); 863 854 break; 864 855 case VIDIOC_S_STD: ··· 956 949 #endif 957 950 958 951 case VIDIOC_LOG_STATUS: 959 - case DECODER_DUMP: 960 952 dump_reg(c); 961 953 break; 962 954 963 - case DECODER_GET_CAPABILITIES: 955 + case VIDIOC_G_TUNER: 964 956 { 965 - struct video_decoder_capability *cap = arg; 957 + struct v4l2_tuner *vt = arg; 958 + int status = tvp5150_read(c, 0x88); 966 959 967 - cap->flags = VIDEO_DECODER_PAL | 968 - VIDEO_DECODER_NTSC | 969 - VIDEO_DECODER_SECAM | 970 - VIDEO_DECODER_AUTO | VIDEO_DECODER_CCIR; 971 - cap->inputs = 3; 972 - cap->outputs = 1; 973 - break; 974 - } 975 - case DECODER_GET_STATUS: 976 - { 977 - int *iarg = arg; 978 - int status; 979 - int res=0; 980 - status = tvp5150_read(c, 0x88); 981 - if(status&0x08){ 982 - res |= DECODER_STATUS_COLOR; 983 - } 984 - if(status&0x04 && status&0x02){ 985 - res |= DECODER_STATUS_GOOD; 986 - } 987 - *iarg=res; 988 - break; 989 - } 990 - 991 - case DECODER_SET_GPIO: 992 - break; 993 - 994 - case DECODER_SET_VBI_BYPASS: 995 - break; 996 - 997 - case DECODER_SET_NORM: 998 - { 999 - int *iarg = arg; 1000 - 1001 - switch (*iarg) { 1002 - 1003 - case VIDEO_MODE_NTSC: 1004 - break; 1005 - 1006 - case VIDEO_MODE_PAL: 1007 - break; 1008 - 1009 - case VIDEO_MODE_SECAM: 1010 - break; 1011 - 1012 - case VIDEO_MODE_AUTO: 1013 - break; 1014 - 1015 - default: 1016 - return -EINVAL; 1017 - 1018 - } 1019 - decoder->norm = *iarg; 1020 - break; 1021 - } 1022 - case DECODER_SET_INPUT: 1023 - { 1024 - int *iarg = arg; 1025 - if (*iarg < 0 || *iarg > 3) { 1026 - return -EINVAL; 1027 - } 1028 - 1029 - decoder->input = *iarg; 1030 - tvp5150_selmux(c, decoder->input); 1031 - 1032 - break; 1033 - } 1034 - case DECODER_SET_OUTPUT: 1035 - { 1036 - int *iarg = arg; 1037 - 1038 - /* not much choice of outputs */ 1039 - if (*iarg != 0) { 1040 - return -EINVAL; 1041 - } 1042 - break; 1043 - } 1044 - case DECODER_ENABLE_OUTPUT: 1045 - { 1046 - int *iarg = arg; 1047 - 1048 - decoder->enable = (*iarg != 0); 1049 - 1050 - tvp5150_selmux(c, decoder->input); 1051 - 960 + vt->signal = ((status & 0x04) && (status & 0x02)) ? 0xffff : 0x0; 1052 961 break; 1053 962 } 1054 963 case VIDIOC_QUERYCTRL: ··· 1010 1087 return -EINVAL; 1011 1088 } 1012 1089 1013 - case DECODER_SET_PICTURE: 1014 - { 1015 - struct video_picture *pic = arg; 1016 - if (decoder->bright != pic->brightness) { 1017 - /* We want 0 to 255 we get 0-65535 */ 1018 - decoder->bright = pic->brightness; 1019 - tvp5150_write(c, TVP5150_BRIGHT_CTL, 1020 - decoder->bright >> 8); 1021 - } 1022 - if (decoder->contrast != pic->contrast) { 1023 - /* We want 0 to 255 we get 0-65535 */ 1024 - decoder->contrast = pic->contrast; 1025 - tvp5150_write(c, TVP5150_CONTRAST_CTL, 1026 - decoder->contrast >> 8); 1027 - } 1028 - if (decoder->sat != pic->colour) { 1029 - /* We want 0 to 255 we get 0-65535 */ 1030 - decoder->sat = pic->colour; 1031 - tvp5150_write(c, TVP5150_SATURATION_CTL, 1032 - decoder->contrast >> 8); 1033 - } 1034 - if (decoder->hue != pic->hue) { 1035 - /* We want -128 to 127 we get 0-65535 */ 1036 - decoder->hue = pic->hue; 1037 - tvp5150_write(c, TVP5150_HUE_CTL, 1038 - (decoder->hue - 32768) >> 8); 1039 - } 1040 - break; 1041 - } 1042 1090 default: 1043 1091 return -EINVAL; 1044 1092 }
+286
drivers/media/video/upd64031a.c
··· 1 + /* 2 + * upd64031A - NEC Electronics Ghost Reduction for NTSC in Japan 3 + * 4 + * 2003 by T.Adachi <tadachi@tadachi-net.com> 5 + * 2003 by Takeru KOMORIYA <komoriya@paken.org> 6 + * 2006 by Hans Verkuil <hverkuil@xs4all.nl> 7 + * 8 + * This program is free software; you can redistribute it and/or modify 9 + * it under the terms of the GNU General Public License as published by 10 + * the Free Software Foundation; either version 2 of the License, or 11 + * (at your option) any later version. 12 + * 13 + * This program is distributed in the hope that it will be useful, 14 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 + * GNU General Public License for more details. 17 + * 18 + * You should have received a copy of the GNU General Public License 19 + * along with this program; if not, write to the Free Software 20 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 21 + */ 22 + 23 + 24 + #include <linux/version.h> 25 + #include <linux/module.h> 26 + #include <linux/kernel.h> 27 + #include <linux/i2c.h> 28 + #include <linux/videodev2.h> 29 + #include <media/v4l2-common.h> 30 + #include <media/upd64031a.h> 31 + 32 + // --------------------- read registers functions define ----------------------- 33 + 34 + /* bit masks */ 35 + #define GR_MODE_MASK 0xc0 36 + #define DIRECT_3DYCS_CONNECT_MASK 0xc0 37 + #define SYNC_CIRCUIT_MASK 0xa0 38 + 39 + // ----------------------------------------------------------------------------- 40 + 41 + MODULE_DESCRIPTION("uPD64031A driver"); 42 + MODULE_AUTHOR("T. Adachi, Takeru KOMORIYA, Hans Verkuil"); 43 + MODULE_LICENSE("GPL"); 44 + 45 + static int debug = 0; 46 + module_param(debug, int, 0644); 47 + 48 + MODULE_PARM_DESC(debug, "Debug level (0-1)"); 49 + 50 + static unsigned short normal_i2c[] = { 0x24 >> 1, 0x26 >> 1, I2C_CLIENT_END }; 51 + 52 + 53 + I2C_CLIENT_INSMOD; 54 + 55 + enum { 56 + R00 = 0, R01, R02, R03, R04, 57 + R05, R06, R07, R08, R09, 58 + R0A, R0B, R0C, R0D, R0E, R0F, 59 + /* unused registers 60 + R10, R11, R12, R13, R14, 61 + R15, R16, R17, 62 + */ 63 + TOT_REGS 64 + }; 65 + 66 + struct upd64031a_state { 67 + u8 regs[TOT_REGS]; 68 + u8 gr_mode; 69 + u8 direct_3dycs_connect; 70 + u8 ext_comp_sync; 71 + u8 ext_vert_sync; 72 + }; 73 + 74 + static u8 upd64031a_init[] = { 75 + 0x00, 0xb8, 0x48, 0xd2, 0xe6, 76 + 0x03, 0x10, 0x0b, 0xaf, 0x7f, 77 + 0x00, 0x00, 0x1d, 0x5e, 0x00, 78 + 0xd0 79 + }; 80 + 81 + /* ------------------------------------------------------------------------ */ 82 + 83 + static u8 upd64031a_read(struct i2c_client *client, u8 reg) 84 + { 85 + u8 buf[2]; 86 + 87 + if (reg >= sizeof(buf)) 88 + return 0xff; 89 + i2c_master_recv(client, buf, 2); 90 + return buf[reg]; 91 + } 92 + 93 + /* ------------------------------------------------------------------------ */ 94 + 95 + static void upd64031a_write(struct i2c_client *client, u8 reg, u8 val) 96 + { 97 + u8 buf[2]; 98 + 99 + buf[0] = reg; 100 + buf[1] = val; 101 + v4l_dbg(1, debug, client, "writing reg addr: %02X val: %02X\n", reg, val); 102 + if (i2c_master_send(client, buf, 2) != 2) 103 + v4l_err(client, "I/O error write 0x%02x/0x%02x\n", reg, val); 104 + } 105 + 106 + /* ------------------------------------------------------------------------ */ 107 + 108 + /* The input changed due to new input or channel changed */ 109 + static void upd64031a_change(struct i2c_client *client) 110 + { 111 + struct upd64031a_state *state = i2c_get_clientdata(client); 112 + u8 reg = state->regs[R00]; 113 + 114 + v4l_dbg(1, debug, client, "changed input or channel\n"); 115 + upd64031a_write(client, R00, reg | 0x10); 116 + upd64031a_write(client, R00, reg & ~0x10); 117 + } 118 + 119 + /* ------------------------------------------------------------------------ */ 120 + 121 + static int upd64031a_command(struct i2c_client *client, unsigned int cmd, void *arg) 122 + { 123 + struct upd64031a_state *state = i2c_get_clientdata(client); 124 + struct v4l2_routing *route = arg; 125 + 126 + switch (cmd) { 127 + case VIDIOC_S_FREQUENCY: 128 + upd64031a_change(client); 129 + break; 130 + 131 + case VIDIOC_INT_G_VIDEO_ROUTING: 132 + route->input = (state->gr_mode >> 6) | 133 + (state->direct_3dycs_connect >> 4) | 134 + (state->ext_comp_sync >> 1) | 135 + (state->ext_vert_sync >> 2); 136 + route->output = 0; 137 + break; 138 + 139 + case VIDIOC_INT_S_VIDEO_ROUTING: 140 + { 141 + u8 r00, r05, r08; 142 + 143 + state->gr_mode = (route->input & 3) << 6; 144 + state->direct_3dycs_connect = (route->input & 0xc) << 4; 145 + state->ext_comp_sync = (route->input & UPD64031A_COMPOSITE_EXTERNAL) << 1; 146 + state->ext_vert_sync = (route->input & UPD64031A_VERTICAL_EXTERNAL) << 2; 147 + r00 = (state->regs[R00] & ~GR_MODE_MASK) | state->gr_mode; 148 + r05 = (state->regs[R00] & ~SYNC_CIRCUIT_MASK) | 149 + state->ext_comp_sync | state->ext_vert_sync; 150 + r08 = (state->regs[R08] & ~DIRECT_3DYCS_CONNECT_MASK) | 151 + state->direct_3dycs_connect; 152 + upd64031a_write(client, R00, r00); 153 + upd64031a_write(client, R05, r05); 154 + upd64031a_write(client, R08, r08); 155 + upd64031a_change(client); 156 + break; 157 + } 158 + 159 + case VIDIOC_LOG_STATUS: 160 + v4l_info(client, "Status: SA00=0x%02x SA01=0x%02x\n", 161 + upd64031a_read(client, 0), upd64031a_read(client, 1)); 162 + break; 163 + 164 + #ifdef CONFIG_VIDEO_ADV_DEBUG 165 + case VIDIOC_INT_G_REGISTER: 166 + { 167 + struct v4l2_register *reg = arg; 168 + 169 + if (reg->i2c_id != I2C_DRIVERID_UPD64031A) 170 + return -EINVAL; 171 + reg->val = upd64031a_read(client, reg->reg & 0xff); 172 + break; 173 + } 174 + 175 + case VIDIOC_INT_S_REGISTER: 176 + { 177 + struct v4l2_register *reg = arg; 178 + u8 addr = reg->reg & 0xff; 179 + u8 val = reg->val & 0xff; 180 + 181 + if (reg->i2c_id != I2C_DRIVERID_UPD64031A) 182 + return -EINVAL; 183 + if (!capable(CAP_SYS_ADMIN)) 184 + return -EPERM; 185 + upd64031a_write(client, addr, val); 186 + break; 187 + } 188 + #endif 189 + 190 + default: 191 + break; 192 + } 193 + return 0; 194 + } 195 + 196 + /* ------------------------------------------------------------------------ */ 197 + 198 + /* i2c implementation */ 199 + 200 + static struct i2c_driver i2c_driver; 201 + 202 + static int upd64031a_attach(struct i2c_adapter *adapter, int address, int kind) 203 + { 204 + struct i2c_client *client; 205 + struct upd64031a_state *state; 206 + int i; 207 + 208 + if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) 209 + return 0; 210 + 211 + client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); 212 + if (client == NULL) { 213 + return -ENOMEM; 214 + } 215 + 216 + client->addr = address; 217 + client->adapter = adapter; 218 + client->driver = &i2c_driver; 219 + snprintf(client->name, sizeof(client->name) - 1, "uPD64031A"); 220 + 221 + v4l_info(client, "chip found @ 0x%x (%s)\n", address << 1, adapter->name); 222 + 223 + state = kmalloc(sizeof(struct upd64031a_state), GFP_KERNEL); 224 + if (state == NULL) { 225 + kfree(client); 226 + return -ENOMEM; 227 + } 228 + i2c_set_clientdata(client, state); 229 + memcpy(state->regs, upd64031a_init, sizeof(state->regs)); 230 + state->gr_mode = UPD64031A_GR_ON << 6; 231 + state->direct_3dycs_connect = UPD64031A_3DYCS_COMPOSITE << 4; 232 + state->ext_comp_sync = state->ext_vert_sync = 0; 233 + for (i = 0; i < TOT_REGS; i++) { 234 + upd64031a_write(client, i, state->regs[i]); 235 + } 236 + 237 + i2c_attach_client(client); 238 + 239 + return 0; 240 + } 241 + 242 + static int upd64031a_probe(struct i2c_adapter *adapter) 243 + { 244 + if (adapter->class & I2C_CLASS_TV_ANALOG) 245 + return i2c_probe(adapter, &addr_data, upd64031a_attach); 246 + return 0; 247 + } 248 + 249 + static int upd64031a_detach(struct i2c_client *client) 250 + { 251 + int err; 252 + 253 + err = i2c_detach_client(client); 254 + if (err) 255 + return err; 256 + 257 + kfree(client); 258 + return 0; 259 + } 260 + 261 + /* ----------------------------------------------------------------------- */ 262 + 263 + /* i2c implementation */ 264 + static struct i2c_driver i2c_driver = { 265 + .driver = { 266 + .name = "upd64031a", 267 + }, 268 + .id = I2C_DRIVERID_UPD64031A, 269 + .attach_adapter = upd64031a_probe, 270 + .detach_client = upd64031a_detach, 271 + .command = upd64031a_command, 272 + }; 273 + 274 + 275 + static int __init upd64031a_init_module(void) 276 + { 277 + return i2c_add_driver(&i2c_driver); 278 + } 279 + 280 + static void __exit upd64031a_exit_module(void) 281 + { 282 + i2c_del_driver(&i2c_driver); 283 + } 284 + 285 + module_init(upd64031a_init_module); 286 + module_exit(upd64031a_exit_module);
+262
drivers/media/video/upd64083.c
··· 1 + /* 2 + * upd6408x - NEC Electronics 3-Dimensional Y/C separation driver 3 + * 4 + * 2003 by T.Adachi (tadachi@tadachi-net.com) 5 + * 2003 by Takeru KOMORIYA <komoriya@paken.org> 6 + * 2006 by Hans Verkuil <hverkuil@xs4all.nl> 7 + * 8 + * This program is free software; you can redistribute it and/or 9 + * modify it under the terms of the GNU General Public License 10 + * as published by the Free Software Foundation; either version 2 11 + * of the License, or (at your option) any later version. 12 + * 13 + * This program is distributed in the hope that it will be useful, 14 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 + * GNU General Public License for more details. 17 + * 18 + * You should have received a copy of the GNU General Public License 19 + * along with this program; if not, write to the Free Software 20 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 21 + */ 22 + 23 + #include <linux/version.h> 24 + #include <linux/module.h> 25 + #include <linux/kernel.h> 26 + #include <linux/i2c.h> 27 + #include <linux/videodev2.h> 28 + #include <media/v4l2-common.h> 29 + #include <media/upd64083.h> 30 + 31 + MODULE_DESCRIPTION("uPD64083 driver"); 32 + MODULE_AUTHOR("T. Adachi, Takeru KOMORIYA, Hans Verkuil"); 33 + MODULE_LICENSE("GPL"); 34 + 35 + static int debug = 0; 36 + module_param(debug, bool, 0644); 37 + 38 + MODULE_PARM_DESC(debug, "Debug level (0-1)"); 39 + 40 + static unsigned short normal_i2c[] = { 0xb8 >> 1, 0xba >> 1, I2C_CLIENT_END }; 41 + 42 + 43 + I2C_CLIENT_INSMOD; 44 + 45 + enum { 46 + R00 = 0, R01, R02, R03, R04, 47 + R05, R06, R07, R08, R09, 48 + R0A, R0B, R0C, R0D, R0E, R0F, 49 + R10, R11, R12, R13, R14, 50 + R15, R16, 51 + TOT_REGS 52 + }; 53 + 54 + struct upd64083_state { 55 + u8 mode; 56 + u8 ext_y_adc; 57 + u8 regs[TOT_REGS]; 58 + }; 59 + 60 + /* Initial values when used in combination with the 61 + NEC upd64031a ghost reduction chip. */ 62 + static u8 upd64083_init[] = { 63 + 0x1f, 0x01, 0xa0, 0x2d, 0x29, /* we use EXCSS=0 */ 64 + 0x36, 0xdd, 0x05, 0x56, 0x48, 65 + 0x00, 0x3a, 0xa0, 0x05, 0x08, 66 + 0x44, 0x60, 0x08, 0x52, 0xf8, 67 + 0x53, 0x60, 0x10 68 + }; 69 + 70 + /* ------------------------------------------------------------------------ */ 71 + 72 + static void upd64083_log_status(struct i2c_client *client) 73 + { 74 + u8 buf[7]; 75 + 76 + i2c_master_recv(client, buf, 7); 77 + v4l_info(client, "Status: SA00=%02x SA01=%02x SA02=%02x SA03=%02x " 78 + "SA04=%02x SA05=%02x SA06=%02x\n", 79 + buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6]); 80 + } 81 + 82 + /* ------------------------------------------------------------------------ */ 83 + 84 + static void upd64083_write(struct i2c_client *client, u8 reg, u8 val) 85 + { 86 + u8 buf[2]; 87 + 88 + buf[0] = reg; 89 + buf[1] = val; 90 + v4l_dbg(1, debug, client, "writing reg addr: %02x val: %02x\n", reg, val); 91 + if (i2c_master_send(client, buf, 2) != 2) 92 + v4l_err(client, "I/O error write 0x%02x/0x%02x\n", reg, val); 93 + } 94 + 95 + /* ------------------------------------------------------------------------ */ 96 + 97 + #ifdef CONFIG_VIDEO_ADV_DEBUG 98 + static u8 upd64083_read(struct i2c_client *client, u8 reg) 99 + { 100 + u8 buf[7]; 101 + 102 + if (reg >= sizeof(buf)) 103 + return 0xff; 104 + i2c_master_recv(client, buf, sizeof(buf)); 105 + return buf[reg]; 106 + } 107 + #endif 108 + 109 + /* ------------------------------------------------------------------------ */ 110 + 111 + static int upd64083_command(struct i2c_client *client, unsigned int cmd, void *arg) 112 + { 113 + struct upd64083_state *state = i2c_get_clientdata(client); 114 + struct v4l2_routing *route = arg; 115 + 116 + switch (cmd) { 117 + case VIDIOC_INT_G_VIDEO_ROUTING: 118 + route->input = (state->mode >> 6) | (state->ext_y_adc >> 3); 119 + route->output = 0; 120 + break; 121 + 122 + case VIDIOC_INT_S_VIDEO_ROUTING: 123 + { 124 + u8 r00, r02; 125 + 126 + if (route->input > 7 || (route->input & 6) == 6) 127 + return -EINVAL; 128 + state->mode = (route->input & 3) << 6; 129 + state->ext_y_adc = (route->input & UPD64083_EXT_Y_ADC) << 3; 130 + r00 = (state->regs[R00] & ~(3 << 6)) | state->mode; 131 + r02 = (state->regs[R02] & ~(1 << 5)) | state->ext_y_adc; 132 + upd64083_write(client, R00, r00); 133 + upd64083_write(client, R02, r02); 134 + break; 135 + } 136 + 137 + case VIDIOC_LOG_STATUS: 138 + upd64083_log_status(client); 139 + break; 140 + 141 + #ifdef CONFIG_VIDEO_ADV_DEBUG 142 + case VIDIOC_INT_G_REGISTER: 143 + { 144 + struct v4l2_register *reg = arg; 145 + 146 + if (reg->i2c_id != I2C_DRIVERID_UPD64083) 147 + return -EINVAL; 148 + reg->val = upd64083_read(client, reg->reg & 0xff); 149 + break; 150 + } 151 + 152 + case VIDIOC_INT_S_REGISTER: 153 + { 154 + struct v4l2_register *reg = arg; 155 + u8 addr = reg->reg & 0xff; 156 + u8 val = reg->val & 0xff; 157 + 158 + if (reg->i2c_id != I2C_DRIVERID_UPD64083) 159 + return -EINVAL; 160 + if (!capable(CAP_SYS_ADMIN)) 161 + return -EPERM; 162 + upd64083_write(client, addr, val); 163 + break; 164 + } 165 + #endif 166 + default: 167 + break; 168 + } 169 + 170 + return 0; 171 + } 172 + 173 + /* ------------------------------------------------------------------------ */ 174 + 175 + /* i2c implementation */ 176 + 177 + static struct i2c_driver i2c_driver; 178 + 179 + static int upd64083_attach(struct i2c_adapter *adapter, int address, int kind) 180 + { 181 + struct i2c_client *client; 182 + struct upd64083_state *state; 183 + int i; 184 + 185 + if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) 186 + return 0; 187 + 188 + client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); 189 + if (client == NULL) { 190 + return -ENOMEM; 191 + } 192 + 193 + client->addr = address; 194 + client->adapter = adapter; 195 + client->driver = &i2c_driver; 196 + snprintf(client->name, sizeof(client->name) - 1, "uPD64083"); 197 + 198 + v4l_info(client, "chip found @ 0x%x (%s)\n", address << 1, adapter->name); 199 + 200 + state = kmalloc(sizeof(struct upd64083_state), GFP_KERNEL); 201 + if (state == NULL) { 202 + kfree(client); 203 + return -ENOMEM; 204 + } 205 + i2c_set_clientdata(client, state); 206 + /* Initially assume that a ghost reduction chip is present */ 207 + state->mode = 0; /* YCS mode */ 208 + state->ext_y_adc = (1 << 5); 209 + memcpy(state->regs, upd64083_init, TOT_REGS); 210 + for (i = 0; i < TOT_REGS; i++) { 211 + upd64083_write(client, i, state->regs[i]); 212 + } 213 + i2c_attach_client(client); 214 + 215 + return 0; 216 + } 217 + 218 + static int upd64083_probe(struct i2c_adapter *adapter) 219 + { 220 + if (adapter->class & I2C_CLASS_TV_ANALOG) 221 + return i2c_probe(adapter, &addr_data, upd64083_attach); 222 + return 0; 223 + } 224 + 225 + static int upd64083_detach(struct i2c_client *client) 226 + { 227 + int err; 228 + 229 + err = i2c_detach_client(client); 230 + if (err) 231 + return err; 232 + 233 + kfree(client); 234 + return 0; 235 + } 236 + 237 + /* ----------------------------------------------------------------------- */ 238 + 239 + /* i2c implementation */ 240 + static struct i2c_driver i2c_driver = { 241 + .driver = { 242 + .name = "upd64083", 243 + }, 244 + .id = I2C_DRIVERID_UPD64083, 245 + .attach_adapter = upd64083_probe, 246 + .detach_client = upd64083_detach, 247 + .command = upd64083_command, 248 + }; 249 + 250 + 251 + static int __init upd64083_init_module(void) 252 + { 253 + return i2c_add_driver(&i2c_driver); 254 + } 255 + 256 + static void __exit upd64083_exit_module(void) 257 + { 258 + i2c_del_driver(&i2c_driver); 259 + } 260 + 261 + module_init(upd64083_init_module); 262 + module_exit(upd64083_exit_module);
+38
drivers/media/video/usbvideo/Kconfig
··· 1 + config VIDEO_USBVIDEO 2 + tristate 3 + 4 + config USB_VICAM 5 + tristate "USB 3com HomeConnect (aka vicam) support (EXPERIMENTAL)" 6 + depends on USB && VIDEO_DEV && EXPERIMENTAL 7 + select VIDEO_USBVIDEO 8 + ---help--- 9 + Say Y here if you have 3com homeconnect camera (vicam). 10 + 11 + To compile this driver as a module, choose M here: the 12 + module will be called vicam. 13 + 14 + config USB_IBMCAM 15 + tristate "USB IBM (Xirlink) C-it Camera support" 16 + depends on USB && VIDEO_DEV 17 + select VIDEO_USBVIDEO 18 + ---help--- 19 + Say Y here if you want to connect a IBM "C-It" camera, also known as 20 + "Xirlink PC Camera" to your computer's USB port. 21 + 22 + To compile this driver as a module, choose M here: the 23 + module will be called ibmcam. 24 + 25 + This camera has several configuration options which 26 + can be specified when you load the module. Read 27 + <file:Documentation/video4linux/ibmcam.txt> to learn more. 28 + 29 + config USB_KONICAWC 30 + tristate "USB Konica Webcam support" 31 + depends on USB && VIDEO_DEV 32 + select VIDEO_USBVIDEO 33 + ---help--- 34 + Say Y here if you want support for webcams based on a Konica 35 + chipset. This is known to work with the Intel YC76 webcam. 36 + 37 + To compile this driver as a module, choose M here: the 38 + module will be called konicawc.
+4 -4
drivers/media/video/usbvideo/Makefile
··· 1 - obj-$(CONFIG_USB_IBMCAM) += ibmcam.o usbvideo.o ultracam.o 2 - obj-$(CONFIG_USB_KONICAWC) += konicawc.o usbvideo.o 3 - obj-$(CONFIG_USB_VICAM) += vicam.o usbvideo.o 4 - 1 + obj-$(CONFIG_VIDEO_USBVIDEO) += usbvideo.o 2 + obj-$(CONFIG_USB_IBMCAM) += ibmcam.o ultracam.o 3 + obj-$(CONFIG_USB_KONICAWC) += konicawc.o 4 + obj-$(CONFIG_USB_VICAM) += vicam.o
+7 -1
drivers/media/video/v4l2-common.c
··· 317 317 [_IOC_NR(TUNER_SET_STANDBY)] = "TUNER_SET_STANDBY", 318 318 [_IOC_NR(TDA9887_SET_CONFIG)] = "TDA9887_SET_CONFIG", 319 319 320 + [_IOC_NR(VIDIOC_INT_S_TUNER_MODE)] = "VIDIOC_INT_S_TUNER_MODE", 320 321 [_IOC_NR(VIDIOC_INT_S_REGISTER)] = "VIDIOC_INT_S_REGISTER", 321 322 [_IOC_NR(VIDIOC_INT_G_REGISTER)] = "VIDIOC_INT_G_REGISTER", 322 323 [_IOC_NR(VIDIOC_INT_RESET)] = "VIDIOC_INT_RESET", ··· 326 325 [_IOC_NR(VIDIOC_INT_S_VBI_DATA)] = "VIDIOC_INT_S_VBI_DATA", 327 326 [_IOC_NR(VIDIOC_INT_G_VBI_DATA)] = "VIDIOC_INT_G_VBI_DATA", 328 327 [_IOC_NR(VIDIOC_INT_G_CHIP_IDENT)] = "VIDIOC_INT_G_CHIP_IDENT", 329 - [_IOC_NR(VIDIOC_INT_I2S_CLOCK_FREQ)] = "VIDIOC_INT_I2S_CLOCK_FREQ" 328 + [_IOC_NR(VIDIOC_INT_I2S_CLOCK_FREQ)] = "VIDIOC_INT_I2S_CLOCK_FREQ", 329 + [_IOC_NR(VIDIOC_INT_S_STANDBY)] = "VIDIOC_INT_S_STANDBY", 330 + [_IOC_NR(VIDIOC_INT_S_AUDIO_ROUTING)] = "VIDIOC_INT_S_AUDIO_ROUTING", 331 + [_IOC_NR(VIDIOC_INT_G_AUDIO_ROUTING)] = "VIDIOC_INT_G_AUDIO_ROUTING", 332 + [_IOC_NR(VIDIOC_INT_S_VIDEO_ROUTING)] = "VIDIOC_INT_S_VIDEO_ROUTING", 333 + [_IOC_NR(VIDIOC_INT_G_VIDEO_ROUTING)] = "VIDIOC_INT_G_VIDEO_ROUTING" 330 334 }; 331 335 #define V4L2_INT_IOCTLS ARRAY_SIZE(v4l2_int_ioctls) 332 336
+10 -4
drivers/media/video/video-buf.c
··· 399 399 int videobuf_pci_dma_map(struct pci_dev *pci,struct videobuf_dmabuf *dma) 400 400 { 401 401 struct videobuf_queue q; 402 + struct videobuf_queue_ops qops; 402 403 403 404 q.dev=pci; 404 - q.ops->vb_map_sg=(vb_map_sg_t *)pci_unmap_sg; 405 + qops.vb_map_sg=(vb_map_sg_t *)pci_map_sg; 406 + qops.vb_unmap_sg=(vb_map_sg_t *)pci_unmap_sg; 407 + q.ops = &qops; 405 408 406 - return (videobuf_dma_unmap(&q,dma)); 409 + return (videobuf_dma_map(&q,dma)); 407 410 } 408 411 409 412 int videobuf_pci_dma_unmap(struct pci_dev *pci,struct videobuf_dmabuf *dma) 410 413 { 411 414 struct videobuf_queue q; 415 + struct videobuf_queue_ops qops; 412 416 413 417 q.dev=pci; 414 - q.ops->vb_map_sg=(vb_map_sg_t *)pci_unmap_sg; 418 + qops.vb_map_sg=(vb_map_sg_t *)pci_map_sg; 419 + qops.vb_unmap_sg=(vb_map_sg_t *)pci_unmap_sg; 420 + q.ops = &qops; 415 421 416 422 return (videobuf_dma_unmap(&q,dma)); 417 423 } ··· 929 923 /* need to capture a new frame */ 930 924 retval = -ENOMEM; 931 925 q->read_buf = videobuf_alloc(q->msize); 932 - dprintk(1,"video alloc=0x%08x\n",(unsigned int) q->read_buf); 926 + dprintk(1,"video alloc=0x%p\n", q->read_buf); 933 927 if (NULL == q->read_buf) 934 928 goto done; 935 929 q->read_buf->memory = V4L2_MEMORY_USERPTR;
+355
drivers/media/video/wm8739.c
··· 1 + /* 2 + * wm8739 3 + * 4 + * Copyright (C) 2005 T. Adachi <tadachi@tadachi-net.com> 5 + * 6 + * Copyright (C) 2005 Hans Verkuil <hverkuil@xs4all.nl> 7 + * - Cleanup 8 + * 9 + * This program is free software; you can redistribute it and/or modify 10 + * it under the terms of the GNU General Public License as published by 11 + * the Free Software Foundation; either version 2 of the License, or 12 + * (at your option) any later version. 13 + * 14 + * This program is distributed in the hope that it will be useful, 15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 + * GNU General Public License for more details. 18 + * 19 + * You should have received a copy of the GNU General Public License 20 + * along with this program; if not, write to the Free Software 21 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 22 + */ 23 + 24 + #include <linux/module.h> 25 + #include <linux/types.h> 26 + #include <linux/ioctl.h> 27 + #include <asm/uaccess.h> 28 + #include <linux/i2c.h> 29 + #include <linux/i2c-id.h> 30 + #include <linux/videodev.h> 31 + #include <media/v4l2-common.h> 32 + 33 + MODULE_DESCRIPTION("wm8739 driver"); 34 + MODULE_AUTHOR("T. Adachi, Hans Verkuil"); 35 + MODULE_LICENSE("GPL"); 36 + 37 + static int debug = 0; 38 + static unsigned short normal_i2c[] = { 0x34 >> 1, 0x36 >> 1, I2C_CLIENT_END }; 39 + 40 + module_param(debug, int, 0644); 41 + 42 + MODULE_PARM_DESC(debug, "Debug level (0-1)"); 43 + 44 + 45 + I2C_CLIENT_INSMOD; 46 + 47 + /* ------------------------------------------------------------------------ */ 48 + 49 + enum { 50 + R0 = 0, R1, 51 + R5 = 5, R6, R7, R8, R9, R15 = 15, 52 + TOT_REGS 53 + }; 54 + 55 + struct wm8739_state { 56 + u32 clock_freq; 57 + u8 muted; 58 + u16 volume; 59 + u16 balance; 60 + u8 vol_l; /* +12dB to -34.5dB 1.5dB step (5bit) def:0dB */ 61 + u8 vol_r; /* +12dB to -34.5dB 1.5dB step (5bit) def:0dB */ 62 + }; 63 + 64 + /* ------------------------------------------------------------------------ */ 65 + 66 + static int wm8739_write(struct i2c_client *client, int reg, u16 val) 67 + { 68 + int i; 69 + 70 + if (reg < 0 || reg >= TOT_REGS) { 71 + v4l_err(client, "Invalid register R%d\n", reg); 72 + return -1; 73 + } 74 + 75 + v4l_dbg(1, debug, client, "write: %02x %02x\n", reg, val); 76 + 77 + for (i = 0; i < 3; i++) { 78 + if (i2c_smbus_write_byte_data(client, (reg << 1) | 79 + (val >> 8), val & 0xff) == 0) { 80 + return 0; 81 + } 82 + } 83 + v4l_err(client, "I2C: cannot write %03x to register R%d\n", val, reg); 84 + return -1; 85 + } 86 + 87 + /* write regs to set audio volume etc */ 88 + static void wm8739_set_audio(struct i2c_client *client) 89 + { 90 + struct wm8739_state *state = i2c_get_clientdata(client); 91 + u16 mute = state->muted ? 0x80 : 0; 92 + 93 + /* Volume setting: bits 0-4, 0x1f = 12 dB, 0x00 = -34.5 dB 94 + * Default setting: 0x17 = 0 dB 95 + */ 96 + wm8739_write(client, R0, (state->vol_l & 0x1f) | mute); 97 + wm8739_write(client, R1, (state->vol_r & 0x1f) | mute); 98 + } 99 + 100 + static int wm8739_get_ctrl(struct i2c_client *client, struct v4l2_control *ctrl) 101 + { 102 + struct wm8739_state *state = i2c_get_clientdata(client); 103 + 104 + switch (ctrl->id) { 105 + case V4L2_CID_AUDIO_MUTE: 106 + ctrl->value = state->muted; 107 + break; 108 + 109 + case V4L2_CID_AUDIO_VOLUME: 110 + ctrl->value = state->volume; 111 + break; 112 + 113 + case V4L2_CID_AUDIO_BALANCE: 114 + ctrl->value = state->balance; 115 + break; 116 + 117 + default: 118 + return -EINVAL; 119 + } 120 + return 0; 121 + } 122 + 123 + static int wm8739_set_ctrl(struct i2c_client *client, struct v4l2_control *ctrl) 124 + { 125 + struct wm8739_state *state = i2c_get_clientdata(client); 126 + unsigned int work_l, work_r; 127 + 128 + switch (ctrl->id) { 129 + case V4L2_CID_AUDIO_MUTE: 130 + state->muted = ctrl->value; 131 + break; 132 + 133 + case V4L2_CID_AUDIO_VOLUME: 134 + state->volume = ctrl->value; 135 + break; 136 + 137 + case V4L2_CID_AUDIO_BALANCE: 138 + state->balance = ctrl->value; 139 + break; 140 + 141 + default: 142 + return -EINVAL; 143 + } 144 + 145 + /* normalize ( 65535 to 0 -> 31 to 0 (12dB to -34.5dB) ) */ 146 + work_l = (min(65536 - state->balance, 32768) * state->volume) / 32768; 147 + work_r = (min(state->balance, (u16)32768) * state->volume) / 32768; 148 + 149 + state->vol_l = (long)work_l * 31 / 65535; 150 + state->vol_r = (long)work_r * 31 / 65535; 151 + 152 + /* set audio volume etc. */ 153 + wm8739_set_audio(client); 154 + return 0; 155 + } 156 + 157 + /* ------------------------------------------------------------------------ */ 158 + 159 + static struct v4l2_queryctrl wm8739_qctrl[] = { 160 + { 161 + .id = V4L2_CID_AUDIO_VOLUME, 162 + .name = "Volume", 163 + .minimum = 0, 164 + .maximum = 65535, 165 + .step = 65535/100, 166 + .default_value = 58880, 167 + .flags = 0, 168 + .type = V4L2_CTRL_TYPE_INTEGER, 169 + },{ 170 + .id = V4L2_CID_AUDIO_MUTE, 171 + .name = "Mute", 172 + .minimum = 0, 173 + .maximum = 1, 174 + .step = 1, 175 + .default_value = 1, 176 + .flags = 0, 177 + .type = V4L2_CTRL_TYPE_BOOLEAN, 178 + },{ 179 + .id = V4L2_CID_AUDIO_BALANCE, 180 + .name = "Balance", 181 + .minimum = 0, 182 + .maximum = 65535, 183 + .step = 65535/100, 184 + .default_value = 32768, 185 + .flags = 0, 186 + .type = V4L2_CTRL_TYPE_INTEGER, 187 + } 188 + }; 189 + 190 + /* ------------------------------------------------------------------------ */ 191 + 192 + static int wm8739_command(struct i2c_client *client, unsigned int cmd, void *arg) 193 + { 194 + struct wm8739_state *state = i2c_get_clientdata(client); 195 + 196 + switch (cmd) { 197 + case VIDIOC_INT_AUDIO_CLOCK_FREQ: 198 + { 199 + u32 audiofreq = *(u32 *)arg; 200 + 201 + state->clock_freq = audiofreq; 202 + wm8739_write(client, R9, 0x000); /* de-activate */ 203 + switch (audiofreq) { 204 + case 44100: 205 + wm8739_write(client, R8, 0x020); /* 256fps, fs=44.1k */ 206 + break; 207 + case 48000: 208 + wm8739_write(client, R8, 0x000); /* 256fps, fs=48k */ 209 + break; 210 + case 32000: 211 + wm8739_write(client, R8, 0x018); /* 256fps, fs=32k */ 212 + break; 213 + default: 214 + break; 215 + } 216 + wm8739_write(client, R9, 0x001); /* activate */ 217 + break; 218 + } 219 + 220 + case VIDIOC_G_CTRL: 221 + return wm8739_get_ctrl(client, arg); 222 + 223 + case VIDIOC_S_CTRL: 224 + return wm8739_set_ctrl(client, arg); 225 + 226 + case VIDIOC_QUERYCTRL: 227 + { 228 + struct v4l2_queryctrl *qc = arg; 229 + int i; 230 + 231 + for (i = 0; i < ARRAY_SIZE(wm8739_qctrl); i++) 232 + if (qc->id && qc->id == wm8739_qctrl[i].id) { 233 + memcpy(qc, &wm8739_qctrl[i], sizeof(*qc)); 234 + return 0; 235 + } 236 + return -EINVAL; 237 + } 238 + 239 + case VIDIOC_LOG_STATUS: 240 + v4l_info(client, "Frequency: %u Hz\n", state->clock_freq); 241 + v4l_info(client, "Volume L: %02x%s\n", state->vol_l & 0x1f, 242 + state->muted ? " (muted)" : ""); 243 + v4l_info(client, "Volume R: %02x%s\n", state->vol_r & 0x1f, 244 + state->muted ? " (muted)" : ""); 245 + break; 246 + 247 + default: 248 + return -EINVAL; 249 + } 250 + 251 + return 0; 252 + } 253 + 254 + /* ------------------------------------------------------------------------ */ 255 + 256 + /* i2c implementation */ 257 + 258 + static struct i2c_driver i2c_driver; 259 + 260 + static int wm8739_attach(struct i2c_adapter *adapter, int address, int kind) 261 + { 262 + struct i2c_client *client; 263 + struct wm8739_state *state; 264 + 265 + /* Check if the adapter supports the needed features */ 266 + if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) 267 + return 0; 268 + 269 + client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); 270 + if (client == NULL) 271 + return -ENOMEM; 272 + 273 + client->addr = address; 274 + client->adapter = adapter; 275 + client->driver = &i2c_driver; 276 + snprintf(client->name, sizeof(client->name) - 1, "wm8739"); 277 + 278 + v4l_info(client, "chip found @ 0x%x (%s)\n", address << 1, adapter->name); 279 + 280 + state = kmalloc(sizeof(struct wm8739_state), GFP_KERNEL); 281 + if (state == NULL) { 282 + kfree(client); 283 + return -ENOMEM; 284 + } 285 + state->vol_l = 0x17; /* 0dB */ 286 + state->vol_r = 0x17; /* 0dB */ 287 + state->muted = 0; 288 + state->balance = 32768; 289 + /* normalize (12dB(31) to -34.5dB(0) [0dB(23)] -> 65535 to 0) */ 290 + state->volume = ((long)state->vol_l + 1) * 65535 / 31; 291 + state->clock_freq = 48000; 292 + i2c_set_clientdata(client, state); 293 + 294 + /* initialize wm8739 */ 295 + wm8739_write(client, R15, 0x00); /* reset */ 296 + wm8739_write(client, R5, 0x000); /* filter setting, high path, offet clear */ 297 + wm8739_write(client, R6, 0x000); /* ADC, OSC, Power Off mode Disable */ 298 + wm8739_write(client, R7, 0x049); /* Digital Audio interface format */ 299 + /* Enable Master mode */ 300 + /* 24 bit, MSB first/left justified */ 301 + wm8739_write(client, R8, 0x000); /* sampling control */ 302 + /* normal, 256fs, 48KHz sampling rate */ 303 + wm8739_write(client, R9, 0x001); /* activate */ 304 + wm8739_set_audio(client); /* set volume/mute */ 305 + 306 + i2c_attach_client(client); 307 + 308 + return 0; 309 + } 310 + 311 + static int wm8739_probe(struct i2c_adapter *adapter) 312 + { 313 + if (adapter->class & I2C_CLASS_TV_ANALOG) 314 + return i2c_probe(adapter, &addr_data, wm8739_attach); 315 + return 0; 316 + } 317 + 318 + static int wm8739_detach(struct i2c_client *client) 319 + { 320 + int err; 321 + 322 + err = i2c_detach_client(client); 323 + if (err) 324 + return err; 325 + 326 + kfree(client); 327 + return 0; 328 + } 329 + 330 + /* ----------------------------------------------------------------------- */ 331 + 332 + /* i2c implementation */ 333 + static struct i2c_driver i2c_driver = { 334 + .driver = { 335 + .name = "wm8739", 336 + }, 337 + .id = I2C_DRIVERID_WM8739, 338 + .attach_adapter = wm8739_probe, 339 + .detach_client = wm8739_detach, 340 + .command = wm8739_command, 341 + }; 342 + 343 + 344 + static int __init wm8739_init_module(void) 345 + { 346 + return i2c_add_driver(&i2c_driver); 347 + } 348 + 349 + static void __exit wm8739_cleanup_module(void) 350 + { 351 + i2c_del_driver(&i2c_driver); 352 + } 353 + 354 + module_init(wm8739_init_module); 355 + module_exit(wm8739_cleanup_module);
+11
drivers/media/video/zc0301/Kconfig
··· 1 + config USB_ZC0301 2 + tristate "USB ZC0301 Image Processor and Control Chip support" 3 + depends on USB && VIDEO_DEV 4 + ---help--- 5 + Say Y here if you want support for cameras based on the ZC0301 6 + Image Processor and Control Chip. 7 + 8 + See <file:Documentation/video4linux/zc0301.txt> for more info. 9 + 10 + To compile this driver as a module, choose M here: the 11 + module will be called zc0301.
+6 -55
include/linux/videodev2.h
··· 966 966 967 967 /* Teletext World System Teletext 968 968 (WST), defined on ITU-R BT.653-2 */ 969 - #define V4L2_SLICED_TELETEXT_PAL_B (0x000001) 970 - #define V4L2_SLICED_TELETEXT_PAL_C (0x000002) 971 - #define V4L2_SLICED_TELETEXT_NTSC_B (0x000010) 972 - #define V4L2_SLICED_TELETEXT_SECAM (0x000020) 973 - 974 - /* Teletext North American Broadcast Teletext Specification 975 - (NABTS), defined on ITU-R BT.653-2 */ 976 - #define V4L2_SLICED_TELETEXT_NTSC_C (0x000040) 977 - #define V4L2_SLICED_TELETEXT_NTSC_D (0x000080) 978 - 969 + #define V4L2_SLICED_TELETEXT_B (0x0001) 979 970 /* Video Program System, defined on ETS 300 231*/ 980 - #define V4L2_SLICED_VPS (0x000400) 981 - 971 + #define V4L2_SLICED_VPS (0x0400) 982 972 /* Closed Caption, defined on EIA-608 */ 983 - #define V4L2_SLICED_CAPTION_525 (0x001000) 984 - #define V4L2_SLICED_CAPTION_625 (0x002000) 985 - 973 + #define V4L2_SLICED_CAPTION_525 (0x1000) 986 974 /* Wide Screen System, defined on ITU-R BT1119.1 */ 987 - #define V4L2_SLICED_WSS_625 (0x004000) 975 + #define V4L2_SLICED_WSS_625 (0x4000) 988 976 989 - /* Wide Screen System, defined on IEC 61880 */ 990 - #define V4L2_SLICED_WSS_525 (0x008000) 977 + #define V4L2_SLICED_VBI_525 (V4L2_SLICED_CAPTION_525) 978 + #define V4L2_SLICED_VBI_625 (V4L2_SLICED_TELETEXT_B | V4L2_SLICED_VPS | V4L2_SLICED_WSS_625) 991 979 992 - /* Vertical Interval Timecode (VITC), defined on SMPTE 12M */ 993 - #define V4l2_SLICED_VITC_625 (0x010000) 994 - #define V4l2_SLICED_VITC_525 (0x020000) 995 - 996 - #define V4L2_SLICED_TELETEXT_B (V4L2_SLICED_TELETEXT_PAL_B |\ 997 - V4L2_SLICED_TELETEXT_NTSC_B) 998 - 999 - #define V4L2_SLICED_TELETEXT (V4L2_SLICED_TELETEXT_PAL_B |\ 1000 - V4L2_SLICED_TELETEXT_PAL_C |\ 1001 - V4L2_SLICED_TELETEXT_SECAM |\ 1002 - V4L2_SLICED_TELETEXT_NTSC_B |\ 1003 - V4L2_SLICED_TELETEXT_NTSC_C |\ 1004 - V4L2_SLICED_TELETEXT_NTSC_D) 1005 - 1006 - #define V4L2_SLICED_CAPTION (V4L2_SLICED_CAPTION_525 |\ 1007 - V4L2_SLICED_CAPTION_625) 1008 - 1009 - #define V4L2_SLICED_WSS (V4L2_SLICED_WSS_525 |\ 1010 - V4L2_SLICED_WSS_625) 1011 - 1012 - #define V4L2_SLICED_VITC (V4L2_SLICED_VITC_525 |\ 1013 - V4L2_SLICED_VITC_625) 1014 - 1015 - #define V4L2_SLICED_VBI_525 (V4L2_SLICED_TELETEXT_NTSC_B |\ 1016 - V4L2_SLICED_TELETEXT_NTSC_C |\ 1017 - V4L2_SLICED_TELETEXT_NTSC_D |\ 1018 - V4L2_SLICED_CAPTION_525 |\ 1019 - V4L2_SLICED_WSS_525 |\ 1020 - V4l2_SLICED_VITC_525) 1021 - 1022 - #define V4L2_SLICED_VBI_625 (V4L2_SLICED_TELETEXT_PAL_B |\ 1023 - V4L2_SLICED_TELETEXT_PAL_C |\ 1024 - V4L2_SLICED_TELETEXT_SECAM |\ 1025 - V4L2_SLICED_VPS |\ 1026 - V4L2_SLICED_CAPTION_625 |\ 1027 - V4L2_SLICED_WSS_625 |\ 1028 - V4l2_SLICED_VITC_625) 1029 980 1030 981 struct v4l2_sliced_vbi_cap 1031 982 {
+64
include/media/cx25840.h
··· 1 + /* 2 + cx25840.h - definition for cx25840/1/2/3 inputs 3 + 4 + Copyright (C) 2006 Hans Verkuil (hverkuil@xs4all.nl) 5 + 6 + This program is free software; you can redistribute it and/or modify 7 + it under the terms of the GNU General Public License as published by 8 + the Free Software Foundation; either version 2 of the License, or 9 + (at your option) any later version. 10 + 11 + This program is distributed in the hope that it will be useful, 12 + but WITHOUT ANY WARRANTY; without even the implied warranty of 13 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 + GNU General Public License for more details. 15 + 16 + You should have received a copy of the GNU General Public License 17 + along with this program; if not, write to the Free Software 18 + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 + */ 20 + 21 + #ifndef _CX25840_H_ 22 + #define _CX25840_H_ 23 + 24 + enum cx25840_video_input { 25 + /* Composite video inputs In1-In8 */ 26 + CX25840_COMPOSITE1 = 1, 27 + CX25840_COMPOSITE2, 28 + CX25840_COMPOSITE3, 29 + CX25840_COMPOSITE4, 30 + CX25840_COMPOSITE5, 31 + CX25840_COMPOSITE6, 32 + CX25840_COMPOSITE7, 33 + CX25840_COMPOSITE8, 34 + 35 + /* S-Video inputs consist of one luma input (In1-In4) ORed with one 36 + chroma input (In5-In8) */ 37 + CX25840_SVIDEO_LUMA1 = 0x10, 38 + CX25840_SVIDEO_LUMA2 = 0x20, 39 + CX25840_SVIDEO_LUMA3 = 0x30, 40 + CX25840_SVIDEO_LUMA4 = 0x40, 41 + CX25840_SVIDEO_CHROMA4 = 0x400, 42 + CX25840_SVIDEO_CHROMA5 = 0x500, 43 + CX25840_SVIDEO_CHROMA6 = 0x600, 44 + CX25840_SVIDEO_CHROMA7 = 0x700, 45 + CX25840_SVIDEO_CHROMA8 = 0x800, 46 + 47 + /* S-Video aliases for common luma/chroma combinations */ 48 + CX25840_SVIDEO1 = 0x510, 49 + CX25840_SVIDEO2 = 0x620, 50 + CX25840_SVIDEO3 = 0x730, 51 + CX25840_SVIDEO4 = 0x840, 52 + }; 53 + 54 + enum cx25840_audio_input { 55 + /* Audio inputs: serial or In4-In8 */ 56 + CX25840_AUDIO_SERIAL, 57 + CX25840_AUDIO4 = 4, 58 + CX25840_AUDIO5, 59 + CX25840_AUDIO6, 60 + CX25840_AUDIO7, 61 + CX25840_AUDIO8, 62 + }; 63 + 64 + #endif
+30 -30
include/media/msp3400.h
··· 80 80 */ 81 81 82 82 /* SCART input to DSP selection */ 83 - #define MSP_IN_SCART_1 0 /* Pin SC1_IN */ 84 - #define MSP_IN_SCART_2 1 /* Pin SC2_IN */ 85 - #define MSP_IN_SCART_3 2 /* Pin SC3_IN */ 86 - #define MSP_IN_SCART_4 3 /* Pin SC4_IN */ 83 + #define MSP_IN_SCART1 0 /* Pin SC1_IN */ 84 + #define MSP_IN_SCART2 1 /* Pin SC2_IN */ 85 + #define MSP_IN_SCART3 2 /* Pin SC3_IN */ 86 + #define MSP_IN_SCART4 3 /* Pin SC4_IN */ 87 87 #define MSP_IN_MONO 6 /* Pin MONO_IN */ 88 88 #define MSP_IN_MUTE 7 /* Mute DSP input */ 89 89 #define MSP_SCART_TO_DSP(in) (in) 90 90 /* Tuner input to demodulator and DSP selection */ 91 - #define MSP_IN_TUNER_1 0 /* Analog Sound IF input pin ANA_IN1 */ 92 - #define MSP_IN_TUNER_2 1 /* Analog Sound IF input pin ANA_IN2 */ 91 + #define MSP_IN_TUNER1 0 /* Analog Sound IF input pin ANA_IN1 */ 92 + #define MSP_IN_TUNER2 1 /* Analog Sound IF input pin ANA_IN2 */ 93 93 #define MSP_TUNER_TO_DSP(in) ((in) << 3) 94 94 95 95 /* The msp has up to 5 DSP outputs, each output can independently select ··· 109 109 DSP. This is currently not implemented. Also not implemented is the 110 110 multi-channel capable I2S3 input of the 44x0G. If someone can demonstrate 111 111 a need for one of those features then additional support can be added. */ 112 - #define MSP_DSP_OUT_TUNER 0 /* Tuner output */ 113 - #define MSP_DSP_OUT_SCART 2 /* SCART output */ 114 - #define MSP_DSP_OUT_I2S1 5 /* I2S1 output */ 115 - #define MSP_DSP_OUT_I2S2 6 /* I2S2 output */ 116 - #define MSP_DSP_OUT_I2S3 7 /* I2S3 output */ 117 - #define MSP_DSP_OUT_MAIN_AVC 11 /* MAIN AVC processed output */ 118 - #define MSP_DSP_OUT_MAIN 12 /* MAIN output */ 119 - #define MSP_DSP_OUT_AUX 13 /* AUX output */ 112 + #define MSP_DSP_IN_TUNER 0 /* Tuner DSP input */ 113 + #define MSP_DSP_IN_SCART 2 /* SCART DSP input */ 114 + #define MSP_DSP_IN_I2S1 5 /* I2S1 DSP input */ 115 + #define MSP_DSP_IN_I2S2 6 /* I2S2 DSP input */ 116 + #define MSP_DSP_IN_I2S3 7 /* I2S3 DSP input */ 117 + #define MSP_DSP_IN_MAIN_AVC 11 /* MAIN AVC processed DSP input */ 118 + #define MSP_DSP_IN_MAIN 12 /* MAIN DSP input */ 119 + #define MSP_DSP_IN_AUX 13 /* AUX DSP input */ 120 120 #define MSP_DSP_TO_MAIN(in) ((in) << 4) 121 121 #define MSP_DSP_TO_AUX(in) ((in) << 8) 122 122 #define MSP_DSP_TO_SCART1(in) ((in) << 12) ··· 125 125 126 126 /* Output SCART select: the SCART outputs can select which input 127 127 to use. */ 128 - #define MSP_OUT_SCART1 0 /* SCART1 input, bypassing the DSP */ 129 - #define MSP_OUT_SCART2 1 /* SCART2 input, bypassing the DSP */ 130 - #define MSP_OUT_SCART3 2 /* SCART3 input, bypassing the DSP */ 131 - #define MSP_OUT_SCART4 3 /* SCART4 input, bypassing the DSP */ 132 - #define MSP_OUT_SCART1_DA 4 /* DSP SCART1 output */ 133 - #define MSP_OUT_SCART2_DA 5 /* DSP SCART2 output */ 134 - #define MSP_OUT_MONO 6 /* MONO input, bypassing the DSP */ 135 - #define MSP_OUT_MUTE 7 /* MUTE output */ 136 - #define MSP_OUT_TO_SCART1(in) (in) 137 - #define MSP_OUT_TO_SCART2(in) ((in) << 4) 128 + #define MSP_SC_IN_SCART1 0 /* SCART1 input, bypassing the DSP */ 129 + #define MSP_SC_IN_SCART2 1 /* SCART2 input, bypassing the DSP */ 130 + #define MSP_SC_IN_SCART3 2 /* SCART3 input, bypassing the DSP */ 131 + #define MSP_SC_IN_SCART4 3 /* SCART4 input, bypassing the DSP */ 132 + #define MSP_SC_IN_DSP_SCART1 4 /* DSP SCART1 input */ 133 + #define MSP_SC_IN_DSP_SCART2 5 /* DSP SCART2 input */ 134 + #define MSP_SC_IN_MONO 6 /* MONO input, bypassing the DSP */ 135 + #define MSP_SC_IN_MUTE 7 /* MUTE output */ 136 + #define MSP_SC_TO_SCART1(in) (in) 137 + #define MSP_SC_TO_SCART2(in) ((in) << 4) 138 138 139 139 /* Shortcut macros */ 140 140 #define MSP_INPUT(sc, t, main_aux_src, sc_i2s_src) \ ··· 145 145 MSP_DSP_TO_SCART1(sc_i2s_src) | \ 146 146 MSP_DSP_TO_SCART2(sc_i2s_src) | \ 147 147 MSP_DSP_TO_I2S(sc_i2s_src)) 148 - #define MSP_INPUT_DEFAULT MSP_INPUT(MSP_IN_SCART_1, MSP_IN_TUNER_1, \ 149 - MSP_DSP_OUT_TUNER, MSP_DSP_OUT_TUNER) 148 + #define MSP_INPUT_DEFAULT MSP_INPUT(MSP_IN_SCART1, MSP_IN_TUNER1, \ 149 + MSP_DSP_IN_TUNER, MSP_DSP_IN_TUNER) 150 150 #define MSP_OUTPUT(sc) \ 151 - (MSP_OUT_TO_SCART1(sc) | \ 152 - MSP_OUT_TO_SCART2(sc)) 151 + (MSP_SC_TO_SCART1(sc) | \ 152 + MSP_SC_TO_SCART2(sc)) 153 153 /* This equals the RESET position of the msp3400 ACB register */ 154 - #define MSP_OUTPUT_DEFAULT (MSP_OUT_TO_SCART1(MSP_OUT_SCART3) | \ 155 - MSP_OUT_TO_SCART2(MSP_OUT_SCART1_DA)) 154 + #define MSP_OUTPUT_DEFAULT (MSP_SC_TO_SCART1(MSP_SC_IN_SCART3) | \ 155 + MSP_SC_TO_SCART2(MSP_SC_IN_DSP_SCART1)) 156 156 157 157 /* Tuner inputs vs. msp version */ 158 158 /* Chip TUNER_1 TUNER_2
+37
include/media/saa7115.h
··· 1 + /* 2 + saa7115.h - definition for saa7113/4/5 inputs 3 + 4 + Copyright (C) 2006 Hans Verkuil (hverkuil@xs4all.nl) 5 + 6 + This program is free software; you can redistribute it and/or modify 7 + it under the terms of the GNU General Public License as published by 8 + the Free Software Foundation; either version 2 of the License, or 9 + (at your option) any later version. 10 + 11 + This program is distributed in the hope that it will be useful, 12 + but WITHOUT ANY WARRANTY; without even the implied warranty of 13 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 + GNU General Public License for more details. 15 + 16 + You should have received a copy of the GNU General Public License 17 + along with this program; if not, write to the Free Software 18 + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 + */ 20 + 21 + #ifndef _SAA7115_H_ 22 + #define _SAA7115_H_ 23 + 24 + /* SAA7113/4/5 HW inputs */ 25 + #define SAA7115_COMPOSITE0 0 26 + #define SAA7115_COMPOSITE1 1 27 + #define SAA7115_COMPOSITE2 2 28 + #define SAA7115_COMPOSITE3 3 29 + #define SAA7115_COMPOSITE4 4 /* not available for the saa7113 */ 30 + #define SAA7115_COMPOSITE5 5 /* not available for the saa7113 */ 31 + #define SAA7115_SVIDEO0 6 32 + #define SAA7115_SVIDEO1 7 33 + #define SAA7115_SVIDEO2 8 34 + #define SAA7115_SVIDEO3 9 35 + 36 + #endif 37 +
+41
include/media/saa7127.h
··· 1 + /* 2 + saa7127.h - definition for saa7126/7/8/9 inputs/outputs 3 + 4 + Copyright (C) 2006 Hans Verkuil (hverkuil@xs4all.nl) 5 + 6 + This program is free software; you can redistribute it and/or modify 7 + it under the terms of the GNU General Public License as published by 8 + the Free Software Foundation; either version 2 of the License, or 9 + (at your option) any later version. 10 + 11 + This program is distributed in the hope that it will be useful, 12 + but WITHOUT ANY WARRANTY; without even the implied warranty of 13 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 + GNU General Public License for more details. 15 + 16 + You should have received a copy of the GNU General Public License 17 + along with this program; if not, write to the Free Software 18 + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 + */ 20 + 21 + #ifndef _SAA7127_H_ 22 + #define _SAA7127_H_ 23 + 24 + /* Enumeration for the supported input types */ 25 + enum saa7127_input_type { 26 + SAA7127_INPUT_TYPE_NORMAL, 27 + SAA7127_INPUT_TYPE_TEST_IMAGE 28 + }; 29 + 30 + /* Enumeration for the supported output signal types */ 31 + enum saa7127_output_type { 32 + SAA7127_OUTPUT_TYPE_BOTH, 33 + SAA7127_OUTPUT_TYPE_COMPOSITE, 34 + SAA7127_OUTPUT_TYPE_SVIDEO, 35 + SAA7127_OUTPUT_TYPE_RGB, 36 + SAA7127_OUTPUT_TYPE_YUV_C, 37 + SAA7127_OUTPUT_TYPE_YUV_V 38 + }; 39 + 40 + #endif 41 +
+40
include/media/upd64031a.h
··· 1 + /* 2 + * upd64031a - NEC Electronics Ghost Reduction input defines 3 + * 4 + * 2006 by Hans Verkuil (hverkuil@xs4all.nl) 5 + * 6 + * This program is free software; you can redistribute it and/or 7 + * modify it under the terms of the GNU General Public License 8 + * as published by the Free Software Foundation; either version 2 9 + * of the License, or (at your option) any later version. 10 + * 11 + * This program is distributed in the hope that it will be useful, 12 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 + * GNU General Public License for more details. 15 + * 16 + * You should have received a copy of the GNU General Public License 17 + * along with this program; if not, write to the Free Software 18 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 19 + */ 20 + 21 + #ifndef _UPD64031A_H_ 22 + #define _UPD64031A_H_ 23 + 24 + /* Ghost reduction modes */ 25 + #define UPD64031A_GR_ON 0 26 + #define UPD64031A_GR_OFF 1 27 + #define UPD64031A_GR_THROUGH 3 28 + 29 + /* Direct 3D/YCS Connection */ 30 + #define UPD64031A_3DYCS_DISABLE (0 << 2) 31 + #define UPD64031A_3DYCS_COMPOSITE (2 << 2) 32 + #define UPD64031A_3DYCS_SVIDEO (3 << 2) 33 + 34 + /* Composite sync digital separation circuit */ 35 + #define UPD64031A_COMPOSITE_EXTERNAL (1 << 4) 36 + 37 + /* Vertical sync digital separation circuit */ 38 + #define UPD64031A_VERTICAL_EXTERNAL (1 << 5) 39 + 40 + #endif
+58
include/media/upd64083.h
··· 1 + /* 2 + * upd6408x - NEC Electronics 3-Dimensional Y/C separation input defines 3 + * 4 + * 2006 by Hans Verkuil (hverkuil@xs4all.nl) 5 + * 6 + * This program is free software; you can redistribute it and/or 7 + * modify it under the terms of the GNU General Public License 8 + * as published by the Free Software Foundation; either version 2 9 + * of the License, or (at your option) any later version. 10 + * 11 + * This program is distributed in the hope that it will be useful, 12 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 + * GNU General Public License for more details. 15 + * 16 + * You should have received a copy of the GNU General Public License 17 + * along with this program; if not, write to the Free Software 18 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 19 + */ 20 + 21 + #ifndef _UPD64083_H_ 22 + #define _UPD64083_H_ 23 + 24 + /* There are two bits of information that the driver needs in order 25 + to select the correct routing: the operating mode and the selection 26 + of the Y input (external or internal). 27 + 28 + The first two operating modes expect a composite signal on the Y input, 29 + the second two operating modes use both the Y and C inputs. 30 + 31 + Normally YCS_MODE is used for tuner and composite inputs, and the 32 + YCNR mode is used for S-Video inputs. 33 + 34 + The external Y-ADC is selected when the composite input comes from a 35 + upd64031a ghost reduction device. If this device is not present, or 36 + the input is a S-Video signal, then the internal Y-ADC input should 37 + be used. */ 38 + 39 + /* Operating modes: */ 40 + 41 + /* YCS mode: Y/C separation (burst locked clocking) */ 42 + #define UPD64083_YCS_MODE 0 43 + /* YCS+ mode: 2D Y/C separation and YCNR (burst locked clocking) */ 44 + #define UPD64083_YCS_PLUS_MODE 1 45 + 46 + /* Note: the following two modes cannot be used in combination with the 47 + external Y-ADC. */ 48 + /* MNNR mode: frame comb type YNR+C delay (line locked clocking) */ 49 + #define UPD64083_MNNR_MODE 2 50 + /* YCNR mode: frame recursive YCNR (burst locked clocking) */ 51 + #define UPD64083_YCNR_MODE 3 52 + 53 + /* Select external Y-ADC: this should be set if this device is used in 54 + combination with the upd64031a ghost reduction device. 55 + Otherwise leave at 0 (use internal Y-ADC). */ 56 + #define UPD64083_EXT_Y_ADC (1 << 2) 57 + 58 + #endif