summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa7115.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2006-01-09 15:25:44 -0200
committerMauro Carvalho Chehab <mchehab@brturbo.com.br>2006-01-09 15:25:44 -0200
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 5d33d0922e7..9f550fd741d 100644
--- a/drivers/media/video/saa7115.c
+++ b/drivers/media/video/saa7115.c
@@ -74,6 +74,7 @@ struct saa7115_state {
v4l2_std_id std;
int input;
int enable;
+ int radio;
int bright;
int contrast;
int hue;
@@ -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;
@@ -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);
@@ -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;
@@ -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;