Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 17346
b: refs/heads/master
c: 3faeeae
h: refs/heads/master
v: v3
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Jan 9, 2006
1 parent 07cee02 commit b6b259f
Show file tree
Hide file tree
Showing 4 changed files with 33 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: d3900bc42e6bc5e461c29951cc2a50df09e08771
refs/heads/master: 3faeeae48348959c58f3121d2a6a4fb0bc626da0
40 changes: 19 additions & 21 deletions trunk/drivers/media/video/cx25840/cx25840-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,9 @@ static int set_v4lctrl(struct i2c_client *client, struct v4l2_control *ctrl)
case V4L2_CID_AUDIO_BALANCE:
case V4L2_CID_AUDIO_MUTE:
return cx25840_audio(client, VIDIOC_S_CTRL, ctrl);

default:
return -EINVAL;
}

return 0;
Expand Down Expand Up @@ -564,12 +567,8 @@ static int cx25840_command(struct i2c_client *client, unsigned int cmd,
{
struct cx25840_state *state = i2c_get_clientdata(client);
struct v4l2_tuner *vt = arg;
int result = 0;

switch (cmd) {
case 0:
break;

#ifdef CONFIG_VIDEO_ADV_DEBUG
/* ioctls to allow direct access to the
* cx25840 registers for testing */
Expand Down Expand Up @@ -600,8 +599,7 @@ static int cx25840_command(struct i2c_client *client, unsigned int cmd,
return cx25840_vbi(client, cmd, arg);

case VIDIOC_INT_AUDIO_CLOCK_FREQ:
result = cx25840_audio(client, cmd, arg);
break;
return cx25840_audio(client, cmd, arg);

case VIDIOC_STREAMON:
cx25840_dbg("enable output\n");
Expand All @@ -620,35 +618,35 @@ static int cx25840_command(struct i2c_client *client, unsigned int cmd,
break;

case VIDIOC_G_CTRL:
result = get_v4lctrl(client, (struct v4l2_control *)arg);
break;
return get_v4lctrl(client, (struct v4l2_control *)arg);

case VIDIOC_S_CTRL:
result = set_v4lctrl(client, (struct v4l2_control *)arg);
break;
return set_v4lctrl(client, (struct v4l2_control *)arg);

case VIDIOC_G_STD:
*(v4l2_std_id *)arg = cx25840_get_v4lstd(client);
break;

case VIDIOC_S_STD:
result = set_v4lstd(client, *(v4l2_std_id *)arg);
state->radio = 0;
return set_v4lstd(client, *(v4l2_std_id *)arg);

case AUDC_SET_RADIO:
state->radio = 1;
break;

case VIDIOC_G_INPUT:
*(int *)arg = state->vid_input;
break;

case VIDIOC_S_INPUT:
result = set_input(client, *(enum cx25840_video_input *)arg, state->aud_input);
break;
return set_input(client, *(enum cx25840_video_input *)arg, state->aud_input);

case VIDIOC_S_AUDIO:
{
struct v4l2_audio *input = arg;

result = set_input(client, state->vid_input, input->index);
break;
return set_input(client, state->vid_input, input->index);
}

case VIDIOC_G_AUDIO:
Expand All @@ -671,6 +669,9 @@ static int cx25840_command(struct i2c_client *client, unsigned int cmd,
u8 vpres = cx25840_read(client, 0x80a) & 0x10;
int val = 0;

if (state->radio)
break;

vt->capability |=
V4L2_TUNER_CAP_STEREO | V4L2_TUNER_CAP_LANG1 |
V4L2_TUNER_CAP_LANG2 | V4L2_TUNER_CAP_SAP;
Expand Down Expand Up @@ -725,12 +726,10 @@ static int cx25840_command(struct i2c_client *client, unsigned int cmd,
break;

case VIDIOC_G_FMT:
result = get_v4lfmt(client, (struct v4l2_format *)arg);
break;
return get_v4lfmt(client, (struct v4l2_format *)arg);

case VIDIOC_S_FMT:
result = set_v4lfmt(client, (struct v4l2_format *)arg);
break;
return set_v4lfmt(client, (struct v4l2_format *)arg);

case VIDIOC_INT_RESET:
cx25840_initialize(client, 0);
Expand All @@ -742,11 +741,10 @@ static int cx25840_command(struct i2c_client *client, unsigned int cmd,
break;

default:
cx25840_err("invalid ioctl %x\n", cmd);
return -EINVAL;
}

return result;
return 0;
}

/* ----------------------------------------------------------------------- */
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/media/video/cx25840/cx25840.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ enum cx25840_audio_input {

struct cx25840_state {
int pvr150_workaround;
int radio;
enum cx25840_video_input vid_input;
enum cx25840_audio_input aud_input;
u32 audclk_freq;
Expand Down
12 changes: 12 additions & 0 deletions trunk/drivers/media/video/saa7115.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ struct saa7115_state {
v4l2_std_id std;
int input;
int enable;
int radio;
int bright;
int contrast;
int hue;
Expand Down Expand Up @@ -634,6 +635,9 @@ static int saa7115_set_v4lctrl(struct i2c_client *client, struct v4l2_control *c
state->hue = ctrl->value;
saa7115_write(client, 0x0d, state->hue);
break;

default:
return -EINVAL;
}

return 0;
Expand Down Expand Up @@ -1043,6 +1047,8 @@ static int saa7115_command(struct i2c_client *client, unsigned int cmd, void *ar
struct v4l2_tuner *vt = arg;
int status;

if (state->radio)
break;
status = saa7115_read(client, 0x1f);

saa7115_dbg("status: 0x%02x\n", status);
Expand All @@ -1065,9 +1071,14 @@ static int saa7115_command(struct i2c_client *client, unsigned int cmd, void *ar
break;

case VIDIOC_S_STD:
state->radio = 0;
saa7115_set_v4lstd(client, *(v4l2_std_id *)arg);
break;

case AUDC_SET_RADIO:
state->radio = 1;
break;

case VIDIOC_G_INPUT:
*(int *)arg = state->input;
break;
Expand Down Expand Up @@ -1230,6 +1241,7 @@ static int saa7115_attach(struct i2c_adapter *adapter, int address, int kind)
state->std = V4L2_STD_NTSC;
state->input = -1;
state->enable = 1;
state->radio = 0;
state->bright = 128;
state->contrast = 64;
state->hue = 0;
Expand Down

0 comments on commit b6b259f

Please sign in to comment.