aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/bt866.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2009-02-18 15:26:06 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-30 11:42:57 -0400
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)");
52struct bt866 { 52struct bt866 {
53 u8 reg[256]; 53 u8 reg[256];
54 54
55 int norm; 55 v4l2_std_id norm;
56 int enable;
57 int bright; 56 int bright;
58 int contrast; 57 int contrast;
59 int hue; 58 int hue;
@@ -94,44 +93,21 @@ static int bt866_command(struct i2c_client *client, unsigned cmd, void *arg)
94 struct bt866 *encoder = i2c_get_clientdata(client); 93 struct bt866 *encoder = i2c_get_clientdata(client);
95 94
96 switch (cmd) { 95 switch (cmd) {
97 case ENCODER_GET_CAPABILITIES: 96 case VIDIOC_INT_S_STD_OUTPUT:
98 { 97 {
99 struct video_encoder_capability *cap = arg; 98 v4l2_std_id *iarg = arg;
100 99
101 v4l_dbg(1, debug, client, "get capabilities\n"); 100 v4l_dbg(1, debug, client, "set norm %llx\n", *iarg);
102 101
103 cap->flags 102 if (!(*iarg & (V4L2_STD_NTSC | V4L2_STD_PAL)))
104 = VIDEO_ENCODER_PAL
105 | VIDEO_ENCODER_NTSC
106 | VIDEO_ENCODER_CCIR;
107 cap->inputs = 2;
108 cap->outputs = 1;
109 break;
110 }
111
112 case ENCODER_SET_NORM:
113 {
114 int *iarg = arg;
115
116 v4l_dbg(1, debug, client, "set norm %d\n", *iarg);
117
118 switch (*iarg) {
119 case VIDEO_MODE_NTSC:
120 break;
121
122 case VIDEO_MODE_PAL:
123 break;
124
125 default:
126 return -EINVAL; 103 return -EINVAL;
127 }
128 encoder->norm = *iarg; 104 encoder->norm = *iarg;
129 break; 105 break;
130 } 106 }
131 107
132 case ENCODER_SET_INPUT: 108 case VIDIOC_INT_S_VIDEO_ROUTING:
133 { 109 {
134 int *iarg = arg; 110 struct v4l2_routing *route = arg;
135 static const __u8 init[] = { 111 static const __u8 init[] = {
136 0xc8, 0xcc, /* CRSCALE */ 112 0xc8, 0xcc, /* CRSCALE */
137 0xca, 0x91, /* CBSCALE */ 113 0xca, 0x91, /* CBSCALE */
@@ -167,7 +143,7 @@ static int bt866_command(struct i2c_client *client, unsigned cmd, void *arg)
167 143
168 val = encoder->reg[0xdc]; 144 val = encoder->reg[0xdc];
169 145
170 if (*iarg == 0) 146 if (route->input == 0)
171 val |= 0x40; /* CBSWAP */ 147 val |= 0x40; /* CBSWAP */
172 else 148 else
173 val &= ~0x40; /* !CBSWAP */ 149 val &= ~0x40; /* !CBSWAP */
@@ -175,15 +151,15 @@ static int bt866_command(struct i2c_client *client, unsigned cmd, void *arg)
175 bt866_write(client, 0xdc, val); 151 bt866_write(client, 0xdc, val);
176 152
177 val = encoder->reg[0xcc]; 153 val = encoder->reg[0xcc];
178 if (*iarg == 2) 154 if (route->input == 2)
179 val |= 0x01; /* OSDBAR */ 155 val |= 0x01; /* OSDBAR */
180 else 156 else
181 val &= ~0x01; /* !OSDBAR */ 157 val &= ~0x01; /* !OSDBAR */
182 bt866_write(client, 0xcc, val); 158 bt866_write(client, 0xcc, val);
183 159
184 v4l_dbg(1, debug, client, "set input %d\n", *iarg); 160 v4l_dbg(1, debug, client, "set input %d\n", route->input);
185 161
186 switch (*iarg) { 162 switch (route->input) {
187 case 0: 163 case 0:
188 break; 164 break;
189 case 1: 165 case 1:
@@ -194,27 +170,6 @@ static int bt866_command(struct i2c_client *client, unsigned cmd, void *arg)
194 break; 170 break;
195 } 171 }
196 172
197 case ENCODER_SET_OUTPUT:
198 {
199 int *iarg = arg;
200
201 v4l_dbg(1, debug, client, "set output %d\n", *iarg);
202
203 /* not much choice of outputs */
204 if (*iarg != 0)
205 return -EINVAL;
206 break;
207 }
208
209 case ENCODER_ENABLE_OUTPUT:
210 {
211 int *iarg = arg;
212 encoder->enable = !!*iarg;
213
214 v4l_dbg(1, debug, client, "enable output %d\n", encoder->enable);
215 break;
216 }
217
218 case 4711: 173 case 4711:
219 { 174 {
220 int *iarg = arg; 175 int *iarg = arg;