aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa7115.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2006-01-09 12:25:44 -0500
committerMauro Carvalho Chehab <mchehab@brturbo.com.br>2006-01-09 12:25:44 -0500
commit3faeeae48348959c58f3121d2a6a4fb0bc626da0 (patch)
treeb8a9388826d06542c190d7ce7c3fe44b78e22b30 /drivers/media/video/saa7115.c
parentd3900bc42e6bc5e461c29951cc2a50df09e08771 (diff)
V4L/DVB (3256): When in radio mode ignore VIDIOC_G_TUNER
- Detect when AUDC_SET_RADIO is called. - When in radio mode ignore VIDIOC_G_TUNER. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Diffstat (limited to 'drivers/media/video/saa7115.c')
-rw-r--r--drivers/media/video/saa7115.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/media/video/saa7115.c b/drivers/media/video/saa7115.c
index 5d33d0922e79..9f550fd741d1 100644
--- a/drivers/media/video/saa7115.c
+++ b/drivers/media/video/saa7115.c
@@ -74,6 +74,7 @@ struct saa7115_state {
74 v4l2_std_id std; 74 v4l2_std_id std;
75 int input; 75 int input;
76 int enable; 76 int enable;
77 int radio;
77 int bright; 78 int bright;
78 int contrast; 79 int contrast;
79 int hue; 80 int hue;
@@ -634,6 +635,9 @@ static int saa7115_set_v4lctrl(struct i2c_client *client, struct v4l2_control *c
634 state->hue = ctrl->value; 635 state->hue = ctrl->value;
635 saa7115_write(client, 0x0d, state->hue); 636 saa7115_write(client, 0x0d, state->hue);
636 break; 637 break;
638
639 default:
640 return -EINVAL;
637 } 641 }
638 642
639 return 0; 643 return 0;
@@ -1043,6 +1047,8 @@ static int saa7115_command(struct i2c_client *client, unsigned int cmd, void *ar
1043 struct v4l2_tuner *vt = arg; 1047 struct v4l2_tuner *vt = arg;
1044 int status; 1048 int status;
1045 1049
1050 if (state->radio)
1051 break;
1046 status = saa7115_read(client, 0x1f); 1052 status = saa7115_read(client, 0x1f);
1047 1053
1048 saa7115_dbg("status: 0x%02x\n", status); 1054 saa7115_dbg("status: 0x%02x\n", status);
@@ -1065,9 +1071,14 @@ static int saa7115_command(struct i2c_client *client, unsigned int cmd, void *ar
1065 break; 1071 break;
1066 1072
1067 case VIDIOC_S_STD: 1073 case VIDIOC_S_STD:
1074 state->radio = 0;
1068 saa7115_set_v4lstd(client, *(v4l2_std_id *)arg); 1075 saa7115_set_v4lstd(client, *(v4l2_std_id *)arg);
1069 break; 1076 break;
1070 1077
1078 case AUDC_SET_RADIO:
1079 state->radio = 1;
1080 break;
1081
1071 case VIDIOC_G_INPUT: 1082 case VIDIOC_G_INPUT:
1072 *(int *)arg = state->input; 1083 *(int *)arg = state->input;
1073 break; 1084 break;
@@ -1230,6 +1241,7 @@ static int saa7115_attach(struct i2c_adapter *adapter, int address, int kind)
1230 state->std = V4L2_STD_NTSC; 1241 state->std = V4L2_STD_NTSC;
1231 state->input = -1; 1242 state->input = -1;
1232 state->enable = 1; 1243 state->enable = 1;
1244 state->radio = 0;
1233 state->bright = 128; 1245 state->bright = 128;
1234 state->contrast = 64; 1246 state->contrast = 64;
1235 state->hue = 0; 1247 state->hue = 0;