summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/saa7185.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2009-02-18 21:26:06 +0100
committerHans Verkuil <hverkuil@xs4all.nl>2009-02-18 21:26:06 +0100
commit441ce16cab1f8d7a546eeb785da0f9caf28ef7cc (patch)
tree82b268d6a7e71c30dd95f8f22bf653b7aaced6c7 /linux/drivers/media/video/saa7185.c
parent42175ea795fa141cd724faf722cdbbd59358ad3c (diff)
downloadmediapointer-dvb-s2-441ce16cab1f8d7a546eeb785da0f9caf28ef7cc.tar.gz
mediapointer-dvb-s2-441ce16cab1f8d7a546eeb785da0f9caf28ef7cc.tar.bz2
zoran et al: convert zoran i2c modules to V4L2.
From: Hans Verkuil <hverkuil@xs4all.nl> 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. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Diffstat (limited to 'linux/drivers/media/video/saa7185.c')
-rw-r--r--linux/drivers/media/video/saa7185.c78
1 files changed, 15 insertions, 63 deletions
diff --git a/linux/drivers/media/video/saa7185.c b/linux/drivers/media/video/saa7185.c
index 68bec4d5d..08cc04138 100644
--- a/linux/drivers/media/video/saa7185.c
+++ b/linux/drivers/media/video/saa7185.c
@@ -50,8 +50,7 @@ MODULE_PARM_DESC(debug, "Debug level (0-1)");
struct saa7185 {
unsigned char reg[128];
- int norm;
- int enable;
+ v4l2_std_id norm;
int bright;
int contrast;
int hue;
@@ -219,68 +218,43 @@ static int saa7185_command(struct i2c_client *client, unsigned cmd, void *arg)
struct saa7185 *encoder = i2c_get_clientdata(client);
switch (cmd) {
- case 0:
+ case VIDIOC_INT_INIT:
saa7185_write_block(client, init_common,
sizeof(init_common));
- switch (encoder->norm) {
-
- case VIDEO_MODE_NTSC:
+ if (encoder->norm & V4L2_STD_NTSC)
saa7185_write_block(client, init_ntsc,
sizeof(init_ntsc));
- break;
-
- case VIDEO_MODE_PAL:
+ else
saa7185_write_block(client, init_pal,
sizeof(init_pal));
- break;
- }
- break;
-
- case ENCODER_GET_CAPABILITIES:
- {
- struct video_encoder_capability *cap = arg;
-
- cap->flags =
- VIDEO_ENCODER_PAL | VIDEO_ENCODER_NTSC |
- VIDEO_ENCODER_SECAM | VIDEO_ENCODER_CCIR;
- cap->inputs = 1;
- cap->outputs = 1;
break;
- }
- case ENCODER_SET_NORM:
+ case VIDIOC_INT_S_STD_OUTPUT:
{
- int *iarg = arg;
+ v4l2_std_id *iarg = arg;
//saa7185_write_block(client, init_common, sizeof(init_common));
- switch (*iarg) {
- case VIDEO_MODE_NTSC:
+ if (*iarg & V4L2_STD_NTSC)
saa7185_write_block(client, init_ntsc,
sizeof(init_ntsc));
- break;
-
- case VIDEO_MODE_PAL:
+ else if (*iarg & V4L2_STD_PAL)
saa7185_write_block(client, init_pal,
sizeof(init_pal));
- break;
-
- case VIDEO_MODE_SECAM:
- default:
+ else
return -EINVAL;
- }
encoder->norm = *iarg;
break;
}
- case ENCODER_SET_INPUT:
+ case VIDIOC_INT_S_VIDEO_ROUTING:
{
- int *iarg = arg;
+ struct v4l2_routing *route = arg;
- /* RJ: *iarg = 0: input is from SA7111
- *iarg = 1: input is from ZR36060 */
+ /* RJ: route->input = 0: input is from SA7111
+ route->input = 1: input is from ZR36060 */
- switch (*iarg) {
+ switch (route->input) {
case 0:
/* turn off colorbar */
saa7185_write(client, 0x3a, 0x0f);
@@ -316,27 +290,6 @@ static int saa7185_command(struct i2c_client *client, unsigned cmd, void *arg)
break;
}
- case ENCODER_SET_OUTPUT:
- {
- int *iarg = arg;
-
- /* not much choice of outputs */
- if (*iarg != 0)
- return -EINVAL;
- break;
- }
-
- case ENCODER_ENABLE_OUTPUT:
- {
- int *iarg = arg;
-
- encoder->enable = !!*iarg;
- saa7185_write(client, 0x61,
- (encoder->reg[0x61] & 0xbf) |
- (encoder->enable ? 0x00 : 0x40));
- break;
- }
-
default:
return -EINVAL;
}
@@ -366,8 +319,7 @@ static int saa7185_probe(struct i2c_client *client,
encoder = kzalloc(sizeof(struct saa7185), GFP_KERNEL);
if (encoder == NULL)
return -ENOMEM;
- encoder->norm = VIDEO_MODE_NTSC;
- encoder->enable = 1;
+ encoder->norm = V4L2_STD_NTSC;
i2c_set_clientdata(client, encoder);
i = saa7185_write_block(client, init_common, sizeof(init_common));