aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa7115.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2006-03-25 07:20:28 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-04-02 03:54:54 -0400
commit1f8f5fa9b78ce344a03aeb1e6e12fffeb6a4c0c4 (patch)
tree72d923f9ee76b303debd4a21a50c0a2f516b96f1 /drivers/media/video/saa7115.c
parent013423588af1950e8eb7a44d80a684fd50174827 (diff)
V4L/DVB (3607): Implement routing command for saa7115.c
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/saa7115.c')
-rw-r--r--drivers/media/video/saa7115.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/drivers/media/video/saa7115.c b/drivers/media/video/saa7115.c
index f2123d62f1f8..615ec903355a 100644
--- a/drivers/media/video/saa7115.c
+++ b/drivers/media/video/saa7115.c
@@ -40,6 +40,7 @@
40#include <linux/i2c.h> 40#include <linux/i2c.h>
41#include <linux/videodev2.h> 41#include <linux/videodev2.h>
42#include <media/v4l2-common.h> 42#include <media/v4l2-common.h>
43#include <media/saa7115.h>
43#include <asm/div64.h> 44#include <asm/div64.h>
44 45
45MODULE_DESCRIPTION("Philips SAA7113/SAA7114/SAA7115 video decoder driver"); 46MODULE_DESCRIPTION("Philips SAA7113/SAA7114/SAA7115 video decoder driver");
@@ -1180,6 +1181,46 @@ static int saa7115_command(struct i2c_client *client, unsigned int cmd, void *ar
1180 state->radio = 1; 1181 state->radio = 1;
1181 break; 1182 break;
1182 1183
1184 case VIDIOC_INT_G_VIDEO_ROUTING:
1185 {
1186 struct v4l2_routing *route = arg;
1187
1188 route->input = state->input;
1189 route->output = 0;
1190 break;
1191 }
1192
1193 case VIDIOC_INT_S_VIDEO_ROUTING:
1194 {
1195 struct v4l2_routing *route = arg;
1196
1197 v4l_dbg(1, debug, client, "decoder set input %d\n", route->input);
1198 /* saa7113 does not have these inputs */
1199 if (state->ident == V4L2_IDENT_SAA7113 &&
1200 (route->input == SAA7115_COMPOSITE4 ||
1201 route->input == SAA7115_COMPOSITE5)) {
1202 return -EINVAL;
1203 }
1204 if (route->input > SAA7115_SVIDEO3)
1205 return -EINVAL;
1206 if (state->input == route->input)
1207 break;
1208 v4l_dbg(1, debug, client, "now setting %s input\n",
1209 (route->input >= SAA7115_SVIDEO0) ? "S-Video" : "Composite");
1210 state->input = route->input;
1211
1212 /* select mode */
1213 saa7115_write(client, 0x02,
1214 (saa7115_read(client, 0x02) & 0xf0) |
1215 state->input);
1216
1217 /* bypass chrominance trap for S-Video modes */
1218 saa7115_write(client, 0x09,
1219 (saa7115_read(client, 0x09) & 0x7f) |
1220 (state->input >= SAA7115_SVIDEO0 ? 0x80 : 0x0));
1221 break;
1222 }
1223
1183 case VIDIOC_G_INPUT: 1224 case VIDIOC_G_INPUT:
1184 *(int *)arg = state->input; 1225 *(int *)arg = state->input;
1185 break; 1226 break;