summaryrefslogtreecommitdiff
path: root/drivers/media/video/bt866.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2009-02-18 17:26:06 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-30 12:42:57 -0300
commit107063c6156a0cbf055e771baafc28a3e3c0fb9b (patch)
tree813a2dc2c1426521167f2f289d7a106aaf2f24ec /drivers/media/video/bt866.c
parent84c1b09495ea366276726b0df2dcd7898cda9d0f (diff)
V4L/DVB (10714): zoran et al: convert zoran i2c modules to V4L2.
The zoran i2c modules were still using V4L1 internally. Replace this with V4L2. Also deleted saa7111.c and saa7114.c, we use saa7115.c instead. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> [mchehab@redhat.com: fix v4l2_ctrl_query_fill_std merge conflict] Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/bt866.c')
-rw-r--r--drivers/media/video/bt866.c67
1 files changed, 11 insertions, 56 deletions
diff --git a/drivers/media/video/bt866.c b/drivers/media/video/bt866.c
index 596f9e2376be..1df24c8776f3 100644
--- a/drivers/media/video/bt866.c
+++ b/drivers/media/video/bt866.c
@@ -52,8 +52,7 @@ MODULE_PARM_DESC(debug, "Debug level (0-1)");
struct bt866 {
u8 reg[256];
- int norm;
- int enable;
+ v4l2_std_id norm;
int bright;
int contrast;
int hue;
@@ -94,44 +93,21 @@ static int bt866_command(struct i2c_client *client, unsigned cmd, void *arg)
struct bt866 *encoder = i2c_get_clientdata(client);
switch (cmd) {
- case ENCODER_GET_CAPABILITIES:
+ case VIDIOC_INT_S_STD_OUTPUT:
{
- struct video_encoder_capability *cap = arg;
+ v4l2_std_id *iarg = arg;
- v4l_dbg(1, debug, client, "get capabilities\n");
+ v4l_dbg(1, debug, client, "set norm %llx\n", *iarg);
- cap->flags
- = VIDEO_ENCODER_PAL
- | VIDEO_ENCODER_NTSC
- | VIDEO_ENCODER_CCIR;
- cap->inputs = 2;
- cap->outputs = 1;
- break;
- }
-
- case ENCODER_SET_NORM:
- {
- int *iarg = arg;
-
- v4l_dbg(1, debug, client, "set norm %d\n", *iarg);
-
- switch (*iarg) {
- case VIDEO_MODE_NTSC:
- break;
-
- case VIDEO_MODE_PAL:
- break;
-
- default:
+ if (!(*iarg & (V4L2_STD_NTSC | V4L2_STD_PAL)))
return -EINVAL;
- }
encoder->norm = *iarg;
break;
}
- case ENCODER_SET_INPUT:
+ case VIDIOC_INT_S_VIDEO_ROUTING:
{
- int *iarg = arg;
+ struct v4l2_routing *route = arg;
static const __u8 init[] = {
0xc8, 0xcc, /* CRSCALE */
0xca, 0x91, /* CBSCALE */
@@ -167,7 +143,7 @@ static int bt866_command(struct i2c_client *client, unsigned cmd, void *arg)
val = encoder->reg[0xdc];
- if (*iarg == 0)
+ if (route->input == 0)
val |= 0x40; /* CBSWAP */
else
val &= ~0x40; /* !CBSWAP */
@@ -175,15 +151,15 @@ static int bt866_command(struct i2c_client *client, unsigned cmd, void *arg)
bt866_write(client, 0xdc, val);
val = encoder->reg[0xcc];
- if (*iarg == 2)
+ if (route->input == 2)
val |= 0x01; /* OSDBAR */
else
val &= ~0x01; /* !OSDBAR */
bt866_write(client, 0xcc, val);
- v4l_dbg(1, debug, client, "set input %d\n", *iarg);
+ v4l_dbg(1, debug, client, "set input %d\n", route->input);
- switch (*iarg) {
+ switch (route->input) {
case 0:
break;
case 1:
@@ -194,27 +170,6 @@ static int bt866_command(struct i2c_client *client, unsigned cmd, void *arg)
break;
}
- case ENCODER_SET_OUTPUT:
- {
- int *iarg = arg;
-
- v4l_dbg(1, debug, client, "set output %d\n", *iarg);
-
- /* not much choice of outputs */
- if (*iarg != 0)
- return -EINVAL;
- break;
- }
-
- case ENCODER_ENABLE_OUTPUT:
- {
- int *iarg = arg;
- encoder->enable = !!*iarg;
-
- v4l_dbg(1, debug, client, "enable output %d\n", encoder->enable);
- break;
- }
-
case 4711:
{
int *iarg = arg;