Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 61368
b: refs/heads/master
c: 66a1787
h: refs/heads/master
v: v3
  • Loading branch information
Thierry MERLE authored and Mauro Carvalho Chehab committed Jul 18, 2007
1 parent 0682f28 commit 64d4570
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ffddcaa6ec4e85ed8504deac1f51f44c86ec1d23
refs/heads/master: 66a17879e9f18a38c4ca5e6ba600a3f5b1b51188
33 changes: 15 additions & 18 deletions trunk/drivers/media/video/usbvision/usbvision-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2537,7 +2537,9 @@ void usbvision_stop_isoc(struct usb_usbvision *usbvision)

int usbvision_muxsel(struct usb_usbvision *usbvision, int channel)
{
int mode[4];
/* inputs #0 and #3 are constant for every SAA711x. */
/* inputs #1 and #2 are variable for SAA7111 and SAA7113 */
int mode[4]= {SAA7115_COMPOSITE0, 0, 0, SAA7115_COMPOSITE3};
int audio[]= {1, 0, 0, 0};
struct v4l2_routing route;
//channel 0 is TV with audiochannel 1 (tuner mono)
Expand All @@ -2547,39 +2549,34 @@ int usbvision_muxsel(struct usb_usbvision *usbvision, int channel)

RESTRICT_TO_RANGE(channel, 0, usbvision->video_inputs);
usbvision->ctl_input = channel;
route.input = SAA7115_COMPOSITE1;
route.output = 0;
call_i2c_clients(usbvision, VIDIOC_INT_S_VIDEO_ROUTING,&route);
call_i2c_clients(usbvision, VIDIOC_S_INPUT, &usbvision->ctl_input);

// set the new channel
// Regular USB TV Tuners -> channel: 0 = Television, 1 = Composite, 2 = S-Video
// Four video input devices -> channel: 0 = Chan White, 1 = Chan Green, 2 = Chan Yellow, 3 = Chan Red

switch (usbvision_device_data[usbvision->DevModel].Codec) {
case CODEC_SAA7113:
if (SwitchSVideoInput) { // To handle problems with S-Video Input for some devices. Use SwitchSVideoInput parameter when loading the module.
mode[2] = 1;
mode[1] = SAA7115_COMPOSITE2;
if (SwitchSVideoInput) {
/* To handle problems with S-Video Input for
* some devices. Use SwitchSVideoInput
* parameter when loading the module.*/
mode[2] = SAA7115_COMPOSITE1;
}
else {
mode[2] = 7;
}
if (usbvision_device_data[usbvision->DevModel].VideoChannels == 4) {
mode[0] = 0; mode[1] = 2; mode[3] = 3; // Special for four input devices
}
else {
mode[0] = 0; mode[1] = 2; //modes for regular saa7113 devices
mode[2] = SAA7115_SVIDEO1;
}
break;
case CODEC_SAA7111:
mode[0] = 0; mode[1] = 1; mode[2] = 7; //modes for saa7111
break;
default:
mode[0] = 0; mode[1] = 1; mode[2] = 7; //default modes
/* modes for saa7111 */
mode[1] = SAA7115_COMPOSITE1;
mode[2] = SAA7115_SVIDEO1;
break;
}
route.input = mode[channel];
route.output = 0;
call_i2c_clients(usbvision, VIDIOC_INT_S_VIDEO_ROUTING,&route);
usbvision->channel = channel;
usbvision_set_audio(usbvision, audio[channel]);
return 0;
}
Expand Down
5 changes: 3 additions & 2 deletions trunk/drivers/media/video/usbvision/usbvision-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -637,10 +637,9 @@ static int vidioc_s_input (struct file *file, void *priv, unsigned int input)

if ((input >= usbvision->video_inputs) || (input < 0) )
return -EINVAL;
usbvision->ctl_input = input;

down(&usbvision->lock);
usbvision_muxsel(usbvision, usbvision->ctl_input);
usbvision_muxsel(usbvision, input);
usbvision_set_input(usbvision);
usbvision_set_output(usbvision,
usbvision->curwidth,
Expand All @@ -660,6 +659,8 @@ static int vidioc_s_std (struct file *file, void *priv, v4l2_std_id *id)
call_i2c_clients(usbvision, VIDIOC_S_STD,
&usbvision->tvnormId);
up(&usbvision->lock);
/* propagate the change to the decoder */
usbvision_muxsel(usbvision, usbvision->ctl_input);

return 0;
}
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/media/video/usbvision/usbvision.h
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,6 @@ struct usb_usbvision {
int tuner_type;
int tuner_addr;
int bridgeType; // NT1003, NT1004, NT1005
int channel;
int radio;
int video_inputs; // # of inputs
unsigned long freq;
Expand Down

0 comments on commit 64d4570

Please sign in to comment.