aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-03-23 17:39:09 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-23 17:39:09 -0400
commite317234975cb7463b8ca21a93bb6862d9dcf113f (patch)
tree4446fa3a21364f3cba23a22aa2a94027f169d8df /drivers/staging
parentf37ab0fba271e43edab0e3ae9fe644fcda455402 (diff)
parent7483d45f0aee3afc0646d185cabd4af9f6cab58c (diff)
Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
Pull media updates from Mauro Carvalho Chehab: - V4L2 API additions to better support JPEG compression control - media API additions to properly support MPEG decoders - V4L2 API additions for image crop/scaling - a few other V4L2 API DocBook fixes/improvements - two new DVB frontend drivers: m88rs2000 and rtl2830 - two new DVB drivers: az6007 and rtl28xxu - a framework for ISA drivers, that removed lots of common code found at the ISA radio drivers - a new FM transmitter driver (radio-keene) - a GPIO-based IR receiver driver - a new sensor driver: mt9m032 - some new video drivers: adv7183, blackfin, mx2_emmaprp, sii9234_drv, vs6624 - several new board additions, driver fixes, improvements and cleanups. * 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (295 commits) [media] update CARDLIST.em28xx [media] partially reverts changeset fa5527c [media] stb0899: fix the limits for signal strength values [media] em28xx: support for 2304:0242 PCTV QuatroStick (510e) [media] em28xx: support for 2013:0251 PCTV QuatroStick nano (520e) [media] -EINVAL -> -ENOTTY [media] gspca - sn9c20x: Cleanup source [media] gspca - sn9c20x: Simplify register write for capture start/stop [media] gspca - sn9c20x: Add automatic JPEG compression mechanism [media] gspca - sn9c20x: Greater delay in case of sensor no response [media] gspca - sn9c20x: Optimize the code of write sequences [media] gspca - sn9c20x: Add the JPEG compression quality control [media] gspca - sn9c20x: Add a delay after Omnivision sensor reset [media] gspca - sn9c20x: Propagate USB errors to higher level [media] gspca - sn9c20x: Use the new video control mechanism [media] gspca - sn9c20x: Fix loss of frame start [media] gspca - zc3xx: Lack of register 08 value for sensor cs2102k [media] gspca - ov534_9: Add brightness to OmniVision 5621 sensor [media] gspca - zc3xx: Add V4L2_CID_JPEG_COMPRESSION_QUALITY control support [media] pvrusb2: fix 7MHz & 8MHz DVB-T tuner support for HVR1900 rev D1F5 ...
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/media/Kconfig2
-rw-r--r--drivers/staging/media/as102/as102_drv.c2
-rw-r--r--drivers/staging/media/as102/as102_drv.h2
-rw-r--r--drivers/staging/media/as102/as102_fe.c6
-rw-r--r--drivers/staging/media/as102/as102_fw.h2
-rw-r--r--drivers/staging/media/as102/as102_usb_drv.c17
-rw-r--r--drivers/staging/media/as102/as10x_cmd.h80
-rw-r--r--drivers/staging/media/as102/as10x_types.h2
-rw-r--r--drivers/staging/media/easycap/easycap_main.c242
-rw-r--r--drivers/staging/media/go7007/go7007-v4l2.c8
-rw-r--r--drivers/staging/media/go7007/s2250-board.c16
-rw-r--r--drivers/staging/media/lirc/lirc_serial.c2
-rw-r--r--drivers/staging/media/solo6x10/Kconfig2
-rw-r--r--drivers/staging/media/solo6x10/core.c32
14 files changed, 174 insertions, 241 deletions
diff --git a/drivers/staging/media/Kconfig b/drivers/staging/media/Kconfig
index 7e5caa39ed3f..4f4b7d6281a7 100644
--- a/drivers/staging/media/Kconfig
+++ b/drivers/staging/media/Kconfig
@@ -6,7 +6,7 @@ menuconfig STAGING_MEDIA
6 don't have the "normal" Linux kernel quality level. 6 don't have the "normal" Linux kernel quality level.
7 Most of them don't follow properly the V4L, DVB and/or RC API's, 7 Most of them don't follow properly the V4L, DVB and/or RC API's,
8 so, they won't likely work fine with the existing applications. 8 so, they won't likely work fine with the existing applications.
9 That also means that, one fixed, their API's will change to match 9 That also means that, once fixed, their API's will change to match
10 the existing ones. 10 the existing ones.
11 11
12 If you wish to work on these drivers, to help improve them, or 12 If you wish to work on these drivers, to help improve them, or
diff --git a/drivers/staging/media/as102/as102_drv.c b/drivers/staging/media/as102/as102_drv.c
index aae0505a36c4..ea4f992de235 100644
--- a/drivers/staging/media/as102/as102_drv.c
+++ b/drivers/staging/media/as102/as102_drv.c
@@ -27,7 +27,7 @@
27#include <linux/uaccess.h> 27#include <linux/uaccess.h>
28#include <linux/usb.h> 28#include <linux/usb.h>
29 29
30/* header file for Usb device driver*/ 30/* header file for usb device driver*/
31#include "as102_drv.h" 31#include "as102_drv.h"
32#include "as102_fw.h" 32#include "as102_fw.h"
33#include "dvbdev.h" 33#include "dvbdev.h"
diff --git a/drivers/staging/media/as102/as102_drv.h b/drivers/staging/media/as102/as102_drv.h
index 957f0ed0d81a..b0e5a23bd532 100644
--- a/drivers/staging/media/as102/as102_drv.h
+++ b/drivers/staging/media/as102/as102_drv.h
@@ -76,7 +76,7 @@ struct as102_dev_t {
76 struct as10x_bus_adapter_t bus_adap; 76 struct as10x_bus_adapter_t bus_adap;
77 struct list_head device_entry; 77 struct list_head device_entry;
78 struct kref kref; 78 struct kref kref;
79 unsigned long minor; 79 uint8_t elna_cfg;
80 80
81 struct dvb_adapter dvb_adap; 81 struct dvb_adapter dvb_adap;
82 struct dvb_frontend dvb_fe; 82 struct dvb_frontend dvb_fe;
diff --git a/drivers/staging/media/as102/as102_fe.c b/drivers/staging/media/as102/as102_fe.c
index bdc5a38cddf7..5917657b9d0f 100644
--- a/drivers/staging/media/as102/as102_fe.c
+++ b/drivers/staging/media/as102/as102_fe.c
@@ -265,7 +265,7 @@ static int as102_fe_ts_bus_ctrl(struct dvb_frontend *fe, int acquire)
265 265
266 if (acquire) { 266 if (acquire) {
267 if (elna_enable) 267 if (elna_enable)
268 as10x_cmd_set_context(&dev->bus_adap, 1010, 0xC0); 268 as10x_cmd_set_context(&dev->bus_adap, CONTEXT_LNA, dev->elna_cfg);
269 269
270 ret = as10x_cmd_turn_on(&dev->bus_adap); 270 ret = as10x_cmd_turn_on(&dev->bus_adap);
271 } else { 271 } else {
@@ -337,7 +337,7 @@ int as102_dvb_register_fe(struct as102_dev_t *as102_dev,
337 strncpy(dvb_fe->ops.info.name, as102_dev->name, 337 strncpy(dvb_fe->ops.info.name, as102_dev->name,
338 sizeof(dvb_fe->ops.info.name)); 338 sizeof(dvb_fe->ops.info.name));
339 339
340 /* register dbvb frontend */ 340 /* register dvb frontend */
341 errno = dvb_register_frontend(dvb_adap, dvb_fe); 341 errno = dvb_register_frontend(dvb_adap, dvb_fe);
342 if (errno == 0) 342 if (errno == 0)
343 dvb_fe->tuner_priv = as102_dev; 343 dvb_fe->tuner_priv = as102_dev;
@@ -349,7 +349,7 @@ static void as10x_fe_copy_tps_parameters(struct dtv_frontend_properties *fe_tps,
349 struct as10x_tps *as10x_tps) 349 struct as10x_tps *as10x_tps)
350{ 350{
351 351
352 /* extract consteallation */ 352 /* extract constellation */
353 switch (as10x_tps->modulation) { 353 switch (as10x_tps->modulation) {
354 case CONST_QPSK: 354 case CONST_QPSK:
355 fe_tps->modulation = QPSK; 355 fe_tps->modulation = QPSK;
diff --git a/drivers/staging/media/as102/as102_fw.h b/drivers/staging/media/as102/as102_fw.h
index bd21f0554392..4bfc6849d95a 100644
--- a/drivers/staging/media/as102/as102_fw.h
+++ b/drivers/staging/media/as102/as102_fw.h
@@ -29,7 +29,7 @@ struct as10x_fw_pkt_t {
29 union { 29 union {
30 unsigned char request[2]; 30 unsigned char request[2];
31 unsigned char length[2]; 31 unsigned char length[2];
32 } u; 32 } __packed u;
33 struct as10x_raw_fw_pkt raw; 33 struct as10x_raw_fw_pkt raw;
34} __packed; 34} __packed;
35 35
diff --git a/drivers/staging/media/as102/as102_usb_drv.c b/drivers/staging/media/as102/as102_usb_drv.c
index d775be0173ea..0f6bfe7eccba 100644
--- a/drivers/staging/media/as102/as102_usb_drv.c
+++ b/drivers/staging/media/as102/as102_usb_drv.c
@@ -57,6 +57,17 @@ static const char * const as102_device_names[] = {
57 NULL /* Terminating entry */ 57 NULL /* Terminating entry */
58}; 58};
59 59
60/* eLNA configuration: devices built on the reference design work best
61 with 0xA0, while custom designs seem to require 0xC0 */
62static uint8_t const as102_elna_cfg[] = {
63 0xA0,
64 0xC0,
65 0xC0,
66 0xA0,
67 0xA0,
68 0x00 /* Terminating entry */
69};
70
60struct usb_driver as102_usb_driver = { 71struct usb_driver as102_usb_driver = {
61 .name = DRIVER_FULL_NAME, 72 .name = DRIVER_FULL_NAME,
62 .probe = as102_usb_probe, 73 .probe = as102_usb_probe,
@@ -270,6 +281,8 @@ static int as102_alloc_usb_stream_buffer(struct as102_dev_t *dev)
270 } 281 }
271 282
272 urb->transfer_buffer = dev->stream + (i * AS102_USB_BUF_SIZE); 283 urb->transfer_buffer = dev->stream + (i * AS102_USB_BUF_SIZE);
284 urb->transfer_dma = dev->dma_addr + (i * AS102_USB_BUF_SIZE);
285 urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP;
273 urb->transfer_buffer_length = AS102_USB_BUF_SIZE; 286 urb->transfer_buffer_length = AS102_USB_BUF_SIZE;
274 287
275 dev->stream_urb[i] = urb; 288 dev->stream_urb[i] = urb;
@@ -369,8 +382,10 @@ static int as102_usb_probe(struct usb_interface *intf,
369 /* Assign the user-friendly device name */ 382 /* Assign the user-friendly device name */
370 for (i = 0; i < (sizeof(as102_usb_id_table) / 383 for (i = 0; i < (sizeof(as102_usb_id_table) /
371 sizeof(struct usb_device_id)); i++) { 384 sizeof(struct usb_device_id)); i++) {
372 if (id == &as102_usb_id_table[i]) 385 if (id == &as102_usb_id_table[i]) {
373 as102_dev->name = as102_device_names[i]; 386 as102_dev->name = as102_device_names[i];
387 as102_dev->elna_cfg = as102_elna_cfg[i];
388 }
374 } 389 }
375 390
376 if (as102_dev->name == NULL) 391 if (as102_dev->name == NULL)
diff --git a/drivers/staging/media/as102/as10x_cmd.h b/drivers/staging/media/as102/as10x_cmd.h
index 4ea249e7adab..e21ec6c702a9 100644
--- a/drivers/staging/media/as102/as10x_cmd.h
+++ b/drivers/staging/media/as102/as10x_cmd.h
@@ -99,14 +99,14 @@ union as10x_turn_on {
99 struct { 99 struct {
100 /* request identifier */ 100 /* request identifier */
101 uint16_t proc_id; 101 uint16_t proc_id;
102 } req; 102 } __packed req;
103 /* response */ 103 /* response */
104 struct { 104 struct {
105 /* response identifier */ 105 /* response identifier */
106 uint16_t proc_id; 106 uint16_t proc_id;
107 /* error */ 107 /* error */
108 uint8_t error; 108 uint8_t error;
109 } rsp; 109 } __packed rsp;
110} __packed; 110} __packed;
111 111
112union as10x_turn_off { 112union as10x_turn_off {
@@ -114,14 +114,14 @@ union as10x_turn_off {
114 struct { 114 struct {
115 /* request identifier */ 115 /* request identifier */
116 uint16_t proc_id; 116 uint16_t proc_id;
117 } req; 117 } __packed req;
118 /* response */ 118 /* response */
119 struct { 119 struct {
120 /* response identifier */ 120 /* response identifier */
121 uint16_t proc_id; 121 uint16_t proc_id;
122 /* error */ 122 /* error */
123 uint8_t err; 123 uint8_t err;
124 } rsp; 124 } __packed rsp;
125} __packed; 125} __packed;
126 126
127union as10x_set_tune { 127union as10x_set_tune {
@@ -131,14 +131,14 @@ union as10x_set_tune {
131 uint16_t proc_id; 131 uint16_t proc_id;
132 /* tune params */ 132 /* tune params */
133 struct as10x_tune_args args; 133 struct as10x_tune_args args;
134 } req; 134 } __packed req;
135 /* response */ 135 /* response */
136 struct { 136 struct {
137 /* response identifier */ 137 /* response identifier */
138 uint16_t proc_id; 138 uint16_t proc_id;
139 /* response error */ 139 /* response error */
140 uint8_t error; 140 uint8_t error;
141 } rsp; 141 } __packed rsp;
142} __packed; 142} __packed;
143 143
144union as10x_get_tune_status { 144union as10x_get_tune_status {
@@ -146,7 +146,7 @@ union as10x_get_tune_status {
146 struct { 146 struct {
147 /* request identifier */ 147 /* request identifier */
148 uint16_t proc_id; 148 uint16_t proc_id;
149 } req; 149 } __packed req;
150 /* response */ 150 /* response */
151 struct { 151 struct {
152 /* response identifier */ 152 /* response identifier */
@@ -155,7 +155,7 @@ union as10x_get_tune_status {
155 uint8_t error; 155 uint8_t error;
156 /* tune status */ 156 /* tune status */
157 struct as10x_tune_status sts; 157 struct as10x_tune_status sts;
158 } rsp; 158 } __packed rsp;
159} __packed; 159} __packed;
160 160
161union as10x_get_tps { 161union as10x_get_tps {
@@ -163,7 +163,7 @@ union as10x_get_tps {
163 struct { 163 struct {
164 /* request identifier */ 164 /* request identifier */
165 uint16_t proc_id; 165 uint16_t proc_id;
166 } req; 166 } __packed req;
167 /* response */ 167 /* response */
168 struct { 168 struct {
169 /* response identifier */ 169 /* response identifier */
@@ -172,7 +172,7 @@ union as10x_get_tps {
172 uint8_t error; 172 uint8_t error;
173 /* tps details */ 173 /* tps details */
174 struct as10x_tps tps; 174 struct as10x_tps tps;
175 } rsp; 175 } __packed rsp;
176} __packed; 176} __packed;
177 177
178union as10x_common { 178union as10x_common {
@@ -180,14 +180,14 @@ union as10x_common {
180 struct { 180 struct {
181 /* request identifier */ 181 /* request identifier */
182 uint16_t proc_id; 182 uint16_t proc_id;
183 } req; 183 } __packed req;
184 /* response */ 184 /* response */
185 struct { 185 struct {
186 /* response identifier */ 186 /* response identifier */
187 uint16_t proc_id; 187 uint16_t proc_id;
188 /* response error */ 188 /* response error */
189 uint8_t error; 189 uint8_t error;
190 } rsp; 190 } __packed rsp;
191} __packed; 191} __packed;
192 192
193union as10x_add_pid_filter { 193union as10x_add_pid_filter {
@@ -201,7 +201,7 @@ union as10x_add_pid_filter {
201 uint8_t stream_type; 201 uint8_t stream_type;
202 /* PID index in filter table */ 202 /* PID index in filter table */
203 uint8_t idx; 203 uint8_t idx;
204 } req; 204 } __packed req;
205 /* response */ 205 /* response */
206 struct { 206 struct {
207 /* response identifier */ 207 /* response identifier */
@@ -210,7 +210,7 @@ union as10x_add_pid_filter {
210 uint8_t error; 210 uint8_t error;
211 /* Filter id */ 211 /* Filter id */
212 uint8_t filter_id; 212 uint8_t filter_id;
213 } rsp; 213 } __packed rsp;
214} __packed; 214} __packed;
215 215
216union as10x_del_pid_filter { 216union as10x_del_pid_filter {
@@ -220,14 +220,14 @@ union as10x_del_pid_filter {
220 uint16_t proc_id; 220 uint16_t proc_id;
221 /* PID to remove */ 221 /* PID to remove */
222 uint16_t pid; 222 uint16_t pid;
223 } req; 223 } __packed req;
224 /* response */ 224 /* response */
225 struct { 225 struct {
226 /* response identifier */ 226 /* response identifier */
227 uint16_t proc_id; 227 uint16_t proc_id;
228 /* response error */ 228 /* response error */
229 uint8_t error; 229 uint8_t error;
230 } rsp; 230 } __packed rsp;
231} __packed; 231} __packed;
232 232
233union as10x_start_streaming { 233union as10x_start_streaming {
@@ -235,14 +235,14 @@ union as10x_start_streaming {
235 struct { 235 struct {
236 /* request identifier */ 236 /* request identifier */
237 uint16_t proc_id; 237 uint16_t proc_id;
238 } req; 238 } __packed req;
239 /* response */ 239 /* response */
240 struct { 240 struct {
241 /* response identifier */ 241 /* response identifier */
242 uint16_t proc_id; 242 uint16_t proc_id;
243 /* error */ 243 /* error */
244 uint8_t error; 244 uint8_t error;
245 } rsp; 245 } __packed rsp;
246} __packed; 246} __packed;
247 247
248union as10x_stop_streaming { 248union as10x_stop_streaming {
@@ -250,14 +250,14 @@ union as10x_stop_streaming {
250 struct { 250 struct {
251 /* request identifier */ 251 /* request identifier */
252 uint16_t proc_id; 252 uint16_t proc_id;
253 } req; 253 } __packed req;
254 /* response */ 254 /* response */
255 struct { 255 struct {
256 /* response identifier */ 256 /* response identifier */
257 uint16_t proc_id; 257 uint16_t proc_id;
258 /* error */ 258 /* error */
259 uint8_t error; 259 uint8_t error;
260 } rsp; 260 } __packed rsp;
261} __packed; 261} __packed;
262 262
263union as10x_get_demod_stats { 263union as10x_get_demod_stats {
@@ -265,7 +265,7 @@ union as10x_get_demod_stats {
265 struct { 265 struct {
266 /* request identifier */ 266 /* request identifier */
267 uint16_t proc_id; 267 uint16_t proc_id;
268 } req; 268 } __packed req;
269 /* response */ 269 /* response */
270 struct { 270 struct {
271 /* response identifier */ 271 /* response identifier */
@@ -274,7 +274,7 @@ union as10x_get_demod_stats {
274 uint8_t error; 274 uint8_t error;
275 /* demod stats */ 275 /* demod stats */
276 struct as10x_demod_stats stats; 276 struct as10x_demod_stats stats;
277 } rsp; 277 } __packed rsp;
278} __packed; 278} __packed;
279 279
280union as10x_get_impulse_resp { 280union as10x_get_impulse_resp {
@@ -282,7 +282,7 @@ union as10x_get_impulse_resp {
282 struct { 282 struct {
283 /* request identifier */ 283 /* request identifier */
284 uint16_t proc_id; 284 uint16_t proc_id;
285 } req; 285 } __packed req;
286 /* response */ 286 /* response */
287 struct { 287 struct {
288 /* response identifier */ 288 /* response identifier */
@@ -291,7 +291,7 @@ union as10x_get_impulse_resp {
291 uint8_t error; 291 uint8_t error;
292 /* impulse response ready */ 292 /* impulse response ready */
293 uint8_t is_ready; 293 uint8_t is_ready;
294 } rsp; 294 } __packed rsp;
295} __packed; 295} __packed;
296 296
297union as10x_fw_context { 297union as10x_fw_context {
@@ -305,7 +305,7 @@ union as10x_fw_context {
305 uint16_t tag; 305 uint16_t tag;
306 /* context request type */ 306 /* context request type */
307 uint16_t type; 307 uint16_t type;
308 } req; 308 } __packed req;
309 /* response */ 309 /* response */
310 struct { 310 struct {
311 /* response identifier */ 311 /* response identifier */
@@ -316,7 +316,7 @@ union as10x_fw_context {
316 uint16_t type; 316 uint16_t type;
317 /* error */ 317 /* error */
318 uint8_t error; 318 uint8_t error;
319 } rsp; 319 } __packed rsp;
320} __packed; 320} __packed;
321 321
322union as10x_set_register { 322union as10x_set_register {
@@ -328,14 +328,14 @@ union as10x_set_register {
328 struct as10x_register_addr reg_addr; 328 struct as10x_register_addr reg_addr;
329 /* register content */ 329 /* register content */
330 struct as10x_register_value reg_val; 330 struct as10x_register_value reg_val;
331 } req; 331 } __packed req;
332 /* response */ 332 /* response */
333 struct { 333 struct {
334 /* response identifier */ 334 /* response identifier */
335 uint16_t proc_id; 335 uint16_t proc_id;
336 /* error */ 336 /* error */
337 uint8_t error; 337 uint8_t error;
338 } rsp; 338 } __packed rsp;
339} __packed; 339} __packed;
340 340
341union as10x_get_register { 341union as10x_get_register {
@@ -345,7 +345,7 @@ union as10x_get_register {
345 uint16_t proc_id; 345 uint16_t proc_id;
346 /* register description */ 346 /* register description */
347 struct as10x_register_addr reg_addr; 347 struct as10x_register_addr reg_addr;
348 } req; 348 } __packed req;
349 /* response */ 349 /* response */
350 struct { 350 struct {
351 /* response identifier */ 351 /* response identifier */
@@ -354,7 +354,7 @@ union as10x_get_register {
354 uint8_t error; 354 uint8_t error;
355 /* register content */ 355 /* register content */
356 struct as10x_register_value reg_val; 356 struct as10x_register_value reg_val;
357 } rsp; 357 } __packed rsp;
358} __packed; 358} __packed;
359 359
360union as10x_cfg_change_mode { 360union as10x_cfg_change_mode {
@@ -364,14 +364,14 @@ union as10x_cfg_change_mode {
364 uint16_t proc_id; 364 uint16_t proc_id;
365 /* mode */ 365 /* mode */
366 uint8_t mode; 366 uint8_t mode;
367 } req; 367 } __packed req;
368 /* response */ 368 /* response */
369 struct { 369 struct {
370 /* response identifier */ 370 /* response identifier */
371 uint16_t proc_id; 371 uint16_t proc_id;
372 /* error */ 372 /* error */
373 uint8_t error; 373 uint8_t error;
374 } rsp; 374 } __packed rsp;
375} __packed; 375} __packed;
376 376
377struct as10x_cmd_header_t { 377struct as10x_cmd_header_t {
@@ -394,7 +394,7 @@ union as10x_dump_memory {
394 struct as10x_register_addr reg_addr; 394 struct as10x_register_addr reg_addr;
395 /* nb blocks to read */ 395 /* nb blocks to read */
396 uint16_t num_blocks; 396 uint16_t num_blocks;
397 } req; 397 } __packed req;
398 /* response */ 398 /* response */
399 struct { 399 struct {
400 /* response identifier */ 400 /* response identifier */
@@ -408,8 +408,8 @@ union as10x_dump_memory {
408 uint8_t data8[DUMP_BLOCK_SIZE]; 408 uint8_t data8[DUMP_BLOCK_SIZE];
409 uint16_t data16[DUMP_BLOCK_SIZE / sizeof(uint16_t)]; 409 uint16_t data16[DUMP_BLOCK_SIZE / sizeof(uint16_t)];
410 uint32_t data32[DUMP_BLOCK_SIZE / sizeof(uint32_t)]; 410 uint32_t data32[DUMP_BLOCK_SIZE / sizeof(uint32_t)];
411 } u; 411 } __packed u;
412 } rsp; 412 } __packed rsp;
413} __packed; 413} __packed;
414 414
415union as10x_dumplog_memory { 415union as10x_dumplog_memory {
@@ -418,7 +418,7 @@ union as10x_dumplog_memory {
418 uint16_t proc_id; 418 uint16_t proc_id;
419 /* dump memory type request */ 419 /* dump memory type request */
420 uint8_t dump_req; 420 uint8_t dump_req;
421 } req; 421 } __packed req;
422 struct { 422 struct {
423 /* request identifier */ 423 /* request identifier */
424 uint16_t proc_id; 424 uint16_t proc_id;
@@ -428,7 +428,7 @@ union as10x_dumplog_memory {
428 uint8_t dump_rsp; 428 uint8_t dump_rsp;
429 /* dump data */ 429 /* dump data */
430 uint8_t data[DUMP_BLOCK_SIZE]; 430 uint8_t data[DUMP_BLOCK_SIZE];
431 } rsp; 431 } __packed rsp;
432} __packed; 432} __packed;
433 433
434union as10x_raw_data { 434union as10x_raw_data {
@@ -437,14 +437,14 @@ union as10x_raw_data {
437 uint16_t proc_id; 437 uint16_t proc_id;
438 uint8_t data[64 - sizeof(struct as10x_cmd_header_t) 438 uint8_t data[64 - sizeof(struct as10x_cmd_header_t)
439 - 2 /* proc_id */]; 439 - 2 /* proc_id */];
440 } req; 440 } __packed req;
441 /* response */ 441 /* response */
442 struct { 442 struct {
443 uint16_t proc_id; 443 uint16_t proc_id;
444 uint8_t error; 444 uint8_t error;
445 uint8_t data[64 - sizeof(struct as10x_cmd_header_t) 445 uint8_t data[64 - sizeof(struct as10x_cmd_header_t)
446 - 2 /* proc_id */ - 1 /* rc */]; 446 - 2 /* proc_id */ - 1 /* rc */];
447 } rsp; 447 } __packed rsp;
448} __packed; 448} __packed;
449 449
450struct as10x_cmd_t { 450struct as10x_cmd_t {
@@ -469,7 +469,7 @@ struct as10x_cmd_t {
469 union as10x_dump_memory dump_memory; 469 union as10x_dump_memory dump_memory;
470 union as10x_dumplog_memory dumplog_memory; 470 union as10x_dumplog_memory dumplog_memory;
471 union as10x_raw_data raw_data; 471 union as10x_raw_data raw_data;
472 } body; 472 } __packed body;
473} __packed; 473} __packed;
474 474
475struct as10x_token_cmd_t { 475struct as10x_token_cmd_t {
diff --git a/drivers/staging/media/as102/as10x_types.h b/drivers/staging/media/as102/as10x_types.h
index fde8140ae88b..af26e057d9a2 100644
--- a/drivers/staging/media/as102/as10x_types.h
+++ b/drivers/staging/media/as102/as10x_types.h
@@ -181,7 +181,7 @@ struct as10x_register_value {
181 uint8_t value8; /* 8 bit value */ 181 uint8_t value8; /* 8 bit value */
182 uint16_t value16; /* 16 bit value */ 182 uint16_t value16; /* 16 bit value */
183 uint32_t value32; /* 32 bit value */ 183 uint32_t value32; /* 32 bit value */
184 } u; 184 } __packed u;
185} __packed; 185} __packed;
186 186
187struct as10x_register_addr { 187struct as10x_register_addr {
diff --git a/drivers/staging/media/easycap/easycap_main.c b/drivers/staging/media/easycap/easycap_main.c
index 3d439b790cc6..d0fe34afc2e5 100644
--- a/drivers/staging/media/easycap/easycap_main.c
+++ b/drivers/staging/media/easycap/easycap_main.c
@@ -2849,13 +2849,11 @@ static const struct v4l2_file_operations v4l2_fops = {
2849 .poll = easycap_poll, 2849 .poll = easycap_poll,
2850 .mmap = easycap_mmap, 2850 .mmap = easycap_mmap,
2851}; 2851};
2852/*****************************************************************************/ 2852
2853/*---------------------------------------------------------------------------*/
2854/* 2853/*
2855 * WHEN THE EasyCAP IS PHYSICALLY PLUGGED IN, THIS FUNCTION IS CALLED THREE 2854 * When the device is plugged, this function is called three times,
2856 * TIMES, ONCE FOR EACH OF THE THREE INTERFACES. BEWARE. 2855 * one for each interface.
2857 */ 2856 */
2858/*---------------------------------------------------------------------------*/
2859static int easycap_usb_probe(struct usb_interface *intf, 2857static int easycap_usb_probe(struct usb_interface *intf,
2860 const struct usb_device_id *id) 2858 const struct usb_device_id *id)
2861{ 2859{
@@ -2884,7 +2882,6 @@ static int easycap_usb_probe(struct usb_interface *intf,
2884 2882
2885 usbdev = interface_to_usbdev(intf); 2883 usbdev = interface_to_usbdev(intf);
2886 2884
2887/*---------------------------------------------------------------------------*/
2888 alt = usb_altnum_to_altsetting(intf, 0); 2885 alt = usb_altnum_to_altsetting(intf, 0);
2889 if (!alt) { 2886 if (!alt) {
2890 SAY("ERROR: usb_host_interface not found\n"); 2887 SAY("ERROR: usb_host_interface not found\n");
@@ -2896,11 +2893,8 @@ static int easycap_usb_probe(struct usb_interface *intf,
2896 SAY("ERROR: intf_descriptor is NULL\n"); 2893 SAY("ERROR: intf_descriptor is NULL\n");
2897 return -EFAULT; 2894 return -EFAULT;
2898 } 2895 }
2899/*---------------------------------------------------------------------------*/ 2896
2900/* 2897 /* Get properties of probed interface */
2901 * GET PROPERTIES OF PROBED INTERFACE
2902 */
2903/*---------------------------------------------------------------------------*/
2904 bInterfaceNumber = interface->bInterfaceNumber; 2898 bInterfaceNumber = interface->bInterfaceNumber;
2905 bInterfaceClass = interface->bInterfaceClass; 2899 bInterfaceClass = interface->bInterfaceClass;
2906 bInterfaceSubClass = interface->bInterfaceSubClass; 2900 bInterfaceSubClass = interface->bInterfaceSubClass;
@@ -2912,28 +2906,23 @@ static int easycap_usb_probe(struct usb_interface *intf,
2912 (long int)(intf->cur_altsetting - intf->altsetting)); 2906 (long int)(intf->cur_altsetting - intf->altsetting));
2913 JOT(4, "intf[%i]: bInterfaceClass=0x%02X bInterfaceSubClass=0x%02X\n", 2907 JOT(4, "intf[%i]: bInterfaceClass=0x%02X bInterfaceSubClass=0x%02X\n",
2914 bInterfaceNumber, bInterfaceClass, bInterfaceSubClass); 2908 bInterfaceNumber, bInterfaceClass, bInterfaceSubClass);
2915/*---------------------------------------------------------------------------*/ 2909
2916/* 2910 /*
2917 * A NEW struct easycap IS ALWAYS ALLOCATED WHEN INTERFACE 0 IS PROBED. 2911 * A new struct easycap is always allocated when interface 0 is probed.
2918 * IT IS NOT POSSIBLE HERE TO FREE ANY EXISTING struct easycap. THIS 2912 * It is not possible here to free any existing struct easycap.
2919 * SHOULD HAVE BEEN DONE BY easycap_delete() WHEN THE EasyCAP WAS 2913 * This should have been done by easycap_delete() when the device was
2920 * PHYSICALLY UNPLUGGED. 2914 * physically unplugged.
2921 * 2915 * The allocated struct easycap is saved for later usage when
2922 * THE POINTER peasycap TO THE struct easycap IS REMEMBERED WHEN 2916 * interfaces 1 and 2 are probed.
2923 * INTERFACES 1 AND 2 ARE PROBED. 2917 */
2924*/
2925/*---------------------------------------------------------------------------*/
2926 if (0 == bInterfaceNumber) { 2918 if (0 == bInterfaceNumber) {
2927 peasycap = kzalloc(sizeof(struct easycap), GFP_KERNEL); 2919 peasycap = kzalloc(sizeof(struct easycap), GFP_KERNEL);
2928 if (!peasycap) { 2920 if (!peasycap) {
2929 SAY("ERROR: Could not allocate peasycap\n"); 2921 SAY("ERROR: Could not allocate peasycap\n");
2930 return -ENOMEM; 2922 return -ENOMEM;
2931 } 2923 }
2932/*---------------------------------------------------------------------------*/ 2924
2933/* 2925 /* Perform urgent initializations */
2934 * PERFORM URGENT INTIALIZATIONS ...
2935*/
2936/*---------------------------------------------------------------------------*/
2937 peasycap->minor = -1; 2926 peasycap->minor = -1;
2938 kref_init(&peasycap->kref); 2927 kref_init(&peasycap->kref);
2939 JOM(8, "intf[%i]: after kref_init(..._video) " 2928 JOM(8, "intf[%i]: after kref_init(..._video) "
@@ -2976,11 +2965,7 @@ static int easycap_usb_probe(struct usb_interface *intf,
2976 2965
2977 peasycap->allocation_video_struct = sizeof(struct easycap); 2966 peasycap->allocation_video_struct = sizeof(struct easycap);
2978 2967
2979/*---------------------------------------------------------------------------*/ 2968 /* and further initialize the structure */
2980/*
2981 * ... AND FURTHER INITIALIZE THE STRUCTURE
2982*/
2983/*---------------------------------------------------------------------------*/
2984 peasycap->pusb_device = usbdev; 2969 peasycap->pusb_device = usbdev;
2985 peasycap->pusb_interface = intf; 2970 peasycap->pusb_interface = intf;
2986 2971
@@ -3002,11 +2987,7 @@ static int easycap_usb_probe(struct usb_interface *intf,
3002 2987
3003 peasycap->frame_buffer_many = FRAME_BUFFER_MANY; 2988 peasycap->frame_buffer_many = FRAME_BUFFER_MANY;
3004 2989
3005/*---------------------------------------------------------------------------*/ 2990 /* Dynamically fill in the available formats */
3006/*
3007 * DYNAMICALLY FILL IN THE AVAILABLE FORMATS ...
3008 */
3009/*---------------------------------------------------------------------------*/
3010 rc = easycap_video_fillin_formats(); 2991 rc = easycap_video_fillin_formats();
3011 if (0 > rc) { 2992 if (0 > rc) {
3012 SAM("ERROR: fillin_formats() rc = %i\n", rc); 2993 SAM("ERROR: fillin_formats() rc = %i\n", rc);
@@ -3014,10 +2995,8 @@ static int easycap_usb_probe(struct usb_interface *intf,
3014 } 2995 }
3015 JOM(4, "%i formats available\n", rc); 2996 JOM(4, "%i formats available\n", rc);
3016 2997
3017 /* ... AND POPULATE easycap.inputset[] */ 2998 /* Populate easycap.inputset[] */
3018
3019 inputset = peasycap->inputset; 2999 inputset = peasycap->inputset;
3020
3021 fmtidx = peasycap->ntsc ? NTSC_M : PAL_BGHIN; 3000 fmtidx = peasycap->ntsc ? NTSC_M : PAL_BGHIN;
3022 m = 0; 3001 m = 0;
3023 mask = 0; 3002 mask = 0;
@@ -3030,7 +3009,6 @@ static int easycap_usb_probe(struct usb_interface *intf,
3030 mask = easycap_standard[i].mask; 3009 mask = easycap_standard[i].mask;
3031 } 3010 }
3032 } 3011 }
3033
3034 if (1 != m) { 3012 if (1 != m) {
3035 SAM("ERROR: " 3013 SAM("ERROR: "
3036 "inputset->standard_offset unpopulated, %i=m\n", m); 3014 "inputset->standard_offset unpopulated, %i=m\n", m);
@@ -3089,14 +3067,13 @@ static int easycap_usb_probe(struct usb_interface *intf,
3089 JOM(4, "populated inputset[]\n"); 3067 JOM(4, "populated inputset[]\n");
3090 JOM(4, "finished initialization\n"); 3068 JOM(4, "finished initialization\n");
3091 } else { 3069 } else {
3092/*---------------------------------------------------------------------------*/ 3070
3093/* 3071 /*
3094 * FIXME 3072 * FIXME: Identify the appropriate pointer
3095 * 3073 * peasycap for interfaces 1 and 2.
3096 * IDENTIFY THE APPROPRIATE POINTER peasycap FOR INTERFACES 1 AND 2. 3074 * The address of peasycap->pusb_device
3097 * THE ADDRESS OF peasycap->pusb_device IS RELUCTANTLY USED FOR THIS PURPOSE. 3075 * is reluctantly used for this purpose.
3098 */ 3076 */
3099/*---------------------------------------------------------------------------*/
3100 for (ndong = 0; ndong < DONGLE_MANY; ndong++) { 3077 for (ndong = 0; ndong < DONGLE_MANY; ndong++) {
3101 if (usbdev == easycapdc60_dongle[ndong].peasycap-> 3078 if (usbdev == easycapdc60_dongle[ndong].peasycap->
3102 pusb_device) { 3079 pusb_device) {
@@ -3117,7 +3094,7 @@ static int easycap_usb_probe(struct usb_interface *intf,
3117 return -ENODEV; 3094 return -ENODEV;
3118 } 3095 }
3119 } 3096 }
3120/*---------------------------------------------------------------------------*/ 3097
3121 if ((USB_CLASS_VIDEO == bInterfaceClass) || 3098 if ((USB_CLASS_VIDEO == bInterfaceClass) ||
3122 (USB_CLASS_VENDOR_SPEC == bInterfaceClass)) { 3099 (USB_CLASS_VENDOR_SPEC == bInterfaceClass)) {
3123 if (-1 == peasycap->video_interface) { 3100 if (-1 == peasycap->video_interface) {
@@ -3149,14 +3126,12 @@ static int easycap_usb_probe(struct usb_interface *intf,
3149 } 3126 }
3150 } 3127 }
3151 } 3128 }
3152/*---------------------------------------------------------------------------*/
3153/*
3154 * INVESTIGATE ALL ALTSETTINGS.
3155 * DONE IN DETAIL BECAUSE USB DEVICE 05e1:0408 HAS DISPARATE INCARNATIONS.
3156 */
3157/*---------------------------------------------------------------------------*/
3158 isokalt = 0;
3159 3129
3130 /*
3131 * Investigate all altsettings. This is done in detail
3132 * because USB device 05e1:0408 has disparate incarnations.
3133 */
3134 isokalt = 0;
3160 for (i = 0; i < intf->num_altsetting; i++) { 3135 for (i = 0; i < intf->num_altsetting; i++) {
3161 alt = usb_altnum_to_altsetting(intf, i); 3136 alt = usb_altnum_to_altsetting(intf, i);
3162 if (!alt) { 3137 if (!alt) {
@@ -3172,7 +3147,6 @@ static int easycap_usb_probe(struct usb_interface *intf,
3172 if (0 == interface->bNumEndpoints) 3147 if (0 == interface->bNumEndpoints)
3173 JOM(4, "intf[%i]alt[%i] has no endpoints\n", 3148 JOM(4, "intf[%i]alt[%i] has no endpoints\n",
3174 bInterfaceNumber, i); 3149 bInterfaceNumber, i);
3175/*---------------------------------------------------------------------------*/
3176 for (j = 0; j < interface->bNumEndpoints; j++) { 3150 for (j = 0; j < interface->bNumEndpoints; j++) {
3177 ep = &alt->endpoint[j].desc; 3151 ep = &alt->endpoint[j].desc;
3178 if (!ep) { 3152 if (!ep) {
@@ -3312,19 +3286,12 @@ static int easycap_usb_probe(struct usb_interface *intf,
3312 } 3286 }
3313 } 3287 }
3314 } 3288 }
3315/*---------------------------------------------------------------------------*/ 3289
3316/* 3290 /* Perform initialization of the probed interface */
3317 * PERFORM INITIALIZATION OF THE PROBED INTERFACE
3318 */
3319/*---------------------------------------------------------------------------*/
3320 JOM(4, "initialization begins for interface %i\n", 3291 JOM(4, "initialization begins for interface %i\n",
3321 interface->bInterfaceNumber); 3292 interface->bInterfaceNumber);
3322 switch (bInterfaceNumber) { 3293 switch (bInterfaceNumber) {
3323/*---------------------------------------------------------------------------*/ 3294 /* 0: Video interface */
3324/*
3325 * INTERFACE 0 IS THE VIDEO INTERFACE
3326 */
3327/*---------------------------------------------------------------------------*/
3328 case 0: { 3295 case 0: {
3329 if (!peasycap) { 3296 if (!peasycap) {
3330 SAM("MISTAKE: peasycap is NULL\n"); 3297 SAM("MISTAKE: peasycap is NULL\n");
@@ -3337,11 +3304,8 @@ static int easycap_usb_probe(struct usb_interface *intf,
3337 peasycap->video_altsetting_on = okalt[isokalt - 1]; 3304 peasycap->video_altsetting_on = okalt[isokalt - 1];
3338 JOM(4, "%i=video_altsetting_on <====\n", 3305 JOM(4, "%i=video_altsetting_on <====\n",
3339 peasycap->video_altsetting_on); 3306 peasycap->video_altsetting_on);
3340/*---------------------------------------------------------------------------*/ 3307
3341/* 3308 /* Decide video streaming parameters */
3342 * DECIDE THE VIDEO STREAMING PARAMETERS
3343 */
3344/*---------------------------------------------------------------------------*/
3345 peasycap->video_endpointnumber = okepn[isokalt - 1]; 3309 peasycap->video_endpointnumber = okepn[isokalt - 1];
3346 JOM(4, "%i=video_endpointnumber\n", peasycap->video_endpointnumber); 3310 JOM(4, "%i=video_endpointnumber\n", peasycap->video_endpointnumber);
3347 maxpacketsize = okmps[isokalt - 1]; 3311 maxpacketsize = okmps[isokalt - 1];
@@ -3373,7 +3337,6 @@ static int easycap_usb_probe(struct usb_interface *intf,
3373 SAM("MISTAKE: peasycap->video_isoc_buffer_size too big\n"); 3337 SAM("MISTAKE: peasycap->video_isoc_buffer_size too big\n");
3374 return -EFAULT; 3338 return -EFAULT;
3375 } 3339 }
3376/*---------------------------------------------------------------------------*/
3377 if (-1 == peasycap->video_interface) { 3340 if (-1 == peasycap->video_interface) {
3378 SAM("MISTAKE: video_interface is unset\n"); 3341 SAM("MISTAKE: video_interface is unset\n");
3379 return -EFAULT; 3342 return -EFAULT;
@@ -3398,14 +3361,13 @@ static int easycap_usb_probe(struct usb_interface *intf,
3398 SAM("MISTAKE: video_isoc_buffer_size is unset\n"); 3361 SAM("MISTAKE: video_isoc_buffer_size is unset\n");
3399 return -EFAULT; 3362 return -EFAULT;
3400 } 3363 }
3401/*---------------------------------------------------------------------------*/ 3364
3402/* 3365 /*
3403 * ALLOCATE MEMORY FOR VIDEO BUFFERS. LISTS MUST BE INITIALIZED FIRST. 3366 * Allocate memory for video buffers.
3404 */ 3367 * Lists must be initialized first.
3405/*---------------------------------------------------------------------------*/ 3368 */
3406 INIT_LIST_HEAD(&(peasycap->urb_video_head)); 3369 INIT_LIST_HEAD(&(peasycap->urb_video_head));
3407 peasycap->purb_video_head = &(peasycap->urb_video_head); 3370 peasycap->purb_video_head = &(peasycap->urb_video_head);
3408/*---------------------------------------------------------------------------*/
3409 JOM(4, "allocating %i frame buffers of size %li\n", 3371 JOM(4, "allocating %i frame buffers of size %li\n",
3410 FRAME_BUFFER_MANY, (long int)FRAME_BUFFER_SIZE); 3372 FRAME_BUFFER_MANY, (long int)FRAME_BUFFER_SIZE);
3411 JOM(4, ".... each scattered over %li pages\n", 3373 JOM(4, ".... each scattered over %li pages\n",
@@ -3436,7 +3398,6 @@ static int easycap_usb_probe(struct usb_interface *intf,
3436 peasycap->frame_read = 0; 3398 peasycap->frame_read = 0;
3437 JOM(4, "allocation of frame buffers done: %i pages\n", k * 3399 JOM(4, "allocation of frame buffers done: %i pages\n", k *
3438 m); 3400 m);
3439/*---------------------------------------------------------------------------*/
3440 JOM(4, "allocating %i field buffers of size %li\n", 3401 JOM(4, "allocating %i field buffers of size %li\n",
3441 FIELD_BUFFER_MANY, (long int)FIELD_BUFFER_SIZE); 3402 FIELD_BUFFER_MANY, (long int)FIELD_BUFFER_SIZE);
3442 JOM(4, ".... each scattered over %li pages\n", 3403 JOM(4, ".... each scattered over %li pages\n",
@@ -3468,7 +3429,6 @@ static int easycap_usb_probe(struct usb_interface *intf,
3468 peasycap->field_read = 0; 3429 peasycap->field_read = 0;
3469 JOM(4, "allocation of field buffers done: %i pages\n", k * 3430 JOM(4, "allocation of field buffers done: %i pages\n", k *
3470 m); 3431 m);
3471/*---------------------------------------------------------------------------*/
3472 JOM(4, "allocating %i isoc video buffers of size %i\n", 3432 JOM(4, "allocating %i isoc video buffers of size %i\n",
3473 VIDEO_ISOC_BUFFER_MANY, 3433 VIDEO_ISOC_BUFFER_MANY,
3474 peasycap->video_isoc_buffer_size); 3434 peasycap->video_isoc_buffer_size);
@@ -3492,11 +3452,8 @@ static int easycap_usb_probe(struct usb_interface *intf,
3492 } 3452 }
3493 JOM(4, "allocation of isoc video buffers done: %i pages\n", 3453 JOM(4, "allocation of isoc video buffers done: %i pages\n",
3494 k * (0x01 << VIDEO_ISOC_ORDER)); 3454 k * (0x01 << VIDEO_ISOC_ORDER));
3495/*---------------------------------------------------------------------------*/ 3455
3496/* 3456 /* Allocate and initialize multiple struct usb */
3497 * ALLOCATE AND INITIALIZE MULTIPLE struct urb ...
3498 */
3499/*---------------------------------------------------------------------------*/
3500 JOM(4, "allocating %i struct urb.\n", VIDEO_ISOC_BUFFER_MANY); 3457 JOM(4, "allocating %i struct urb.\n", VIDEO_ISOC_BUFFER_MANY);
3501 JOM(4, "using %i=peasycap->video_isoc_framesperdesc\n", 3458 JOM(4, "using %i=peasycap->video_isoc_framesperdesc\n",
3502 peasycap->video_isoc_framesperdesc); 3459 peasycap->video_isoc_framesperdesc);
@@ -3515,7 +3472,6 @@ static int easycap_usb_probe(struct usb_interface *intf,
3515 } 3472 }
3516 3473
3517 peasycap->allocation_video_urb += 1; 3474 peasycap->allocation_video_urb += 1;
3518/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3519 pdata_urb = kzalloc(sizeof(struct data_urb), GFP_KERNEL); 3475 pdata_urb = kzalloc(sizeof(struct data_urb), GFP_KERNEL);
3520 if (!pdata_urb) { 3476 if (!pdata_urb) {
3521 SAM("ERROR: Could not allocate struct data_urb.\n"); 3477 SAM("ERROR: Could not allocate struct data_urb.\n");
@@ -3530,11 +3486,8 @@ static int easycap_usb_probe(struct usb_interface *intf,
3530 pdata_urb->length = 0; 3486 pdata_urb->length = 0;
3531 list_add_tail(&(pdata_urb->list_head), 3487 list_add_tail(&(pdata_urb->list_head),
3532 peasycap->purb_video_head); 3488 peasycap->purb_video_head);
3533/*---------------------------------------------------------------------------*/ 3489
3534/* 3490 /* Initialize allocated urbs */
3535 * ... AND INITIALIZE THEM
3536 */
3537/*---------------------------------------------------------------------------*/
3538 if (!k) { 3491 if (!k) {
3539 JOM(4, "initializing video urbs thus:\n"); 3492 JOM(4, "initializing video urbs thus:\n");
3540 JOM(4, " purb->interval = 1;\n"); 3493 JOM(4, " purb->interval = 1;\n");
@@ -3582,20 +3535,16 @@ static int easycap_usb_probe(struct usb_interface *intf,
3582 } 3535 }
3583 } 3536 }
3584 JOM(4, "allocation of %i struct urb done.\n", k); 3537 JOM(4, "allocation of %i struct urb done.\n", k);
3585/*--------------------------------------------------------------------------*/ 3538
3586/* 3539 /* Save pointer peasycap in this interface */
3587 * SAVE POINTER peasycap IN THIS INTERFACE.
3588 */
3589/*--------------------------------------------------------------------------*/
3590 usb_set_intfdata(intf, peasycap); 3540 usb_set_intfdata(intf, peasycap);
3591/*---------------------------------------------------------------------------*/ 3541
3592/* 3542 /*
3593 * IT IS ESSENTIAL TO INITIALIZE THE HARDWARE BEFORE, RATHER THAN AFTER, 3543 * It is essential to initialize the hardware before,
3594 * THE DEVICE IS REGISTERED, BECAUSE SOME VERSIONS OF THE videodev MODULE 3544 * rather than after, the device is registered,
3595 * CALL easycap_open() IMMEDIATELY AFTER REGISTRATION, CAUSING A CLASH. 3545 * because some udev rules triggers easycap_open()
3596 * BEWARE. 3546 * immediately after registration, causing a clash.
3597*/ 3547 */
3598/*---------------------------------------------------------------------------*/
3599 peasycap->ntsc = easycap_ntsc; 3548 peasycap->ntsc = easycap_ntsc;
3600 JOM(8, "defaulting initially to %s\n", 3549 JOM(8, "defaulting initially to %s\n",
3601 easycap_ntsc ? "NTSC" : "PAL"); 3550 easycap_ntsc ? "NTSC" : "PAL");
@@ -3604,27 +3553,20 @@ static int easycap_usb_probe(struct usb_interface *intf,
3604 SAM("ERROR: reset() rc = %i\n", rc); 3553 SAM("ERROR: reset() rc = %i\n", rc);
3605 return -EFAULT; 3554 return -EFAULT;
3606 } 3555 }
3607/*--------------------------------------------------------------------------*/ 3556
3608/* 3557 /* The video device can now be registered */
3609 * THE VIDEO DEVICE CAN BE REGISTERED NOW, AS IT IS READY.
3610 */
3611/*--------------------------------------------------------------------------*/
3612 if (v4l2_device_register(&intf->dev, &peasycap->v4l2_device)) { 3558 if (v4l2_device_register(&intf->dev, &peasycap->v4l2_device)) {
3613 SAM("v4l2_device_register() failed\n"); 3559 SAM("v4l2_device_register() failed\n");
3614 return -ENODEV; 3560 return -ENODEV;
3615 } 3561 }
3616 JOM(4, "registered device instance: %s\n", 3562 JOM(4, "registered device instance: %s\n",
3617 peasycap->v4l2_device.name); 3563 peasycap->v4l2_device.name);
3618/*---------------------------------------------------------------------------*/ 3564
3619/* 3565 /*
3620 * FIXME 3566 * FIXME: This is believed to be harmless,
3621 * 3567 * but may well be unnecessary or wrong.
3622 * 3568 */
3623 * THIS IS BELIEVED TO BE HARMLESS, BUT MAY WELL BE UNNECESSARY OR WRONG:
3624*/
3625/*---------------------------------------------------------------------------*/
3626 peasycap->video_device.v4l2_dev = NULL; 3569 peasycap->video_device.v4l2_dev = NULL;
3627/*---------------------------------------------------------------------------*/
3628 3570
3629 3571
3630 strcpy(&peasycap->video_device.name[0], "easycapdc60"); 3572 strcpy(&peasycap->video_device.name[0], "easycapdc60");
@@ -3648,28 +3590,19 @@ static int easycap_usb_probe(struct usb_interface *intf,
3648 3590
3649 break; 3591 break;
3650 } 3592 }
3651/*--------------------------------------------------------------------------*/ 3593 /* 1: Audio control */
3652/*
3653 * INTERFACE 1 IS THE AUDIO CONTROL INTERFACE
3654 * INTERFACE 2 IS THE AUDIO STREAMING INTERFACE
3655 */
3656/*--------------------------------------------------------------------------*/
3657 case 1: { 3594 case 1: {
3658 if (!peasycap) { 3595 if (!peasycap) {
3659 SAM("MISTAKE: peasycap is NULL\n"); 3596 SAM("MISTAKE: peasycap is NULL\n");
3660 return -EFAULT; 3597 return -EFAULT;
3661 } 3598 }
3662/*--------------------------------------------------------------------------*/ 3599 /* Save pointer peasycap in this interface */
3663/*
3664 * SAVE POINTER peasycap IN INTERFACE 1
3665 */
3666/*--------------------------------------------------------------------------*/
3667 usb_set_intfdata(intf, peasycap); 3600 usb_set_intfdata(intf, peasycap);
3668 JOM(4, "no initialization required for interface %i\n", 3601 JOM(4, "no initialization required for interface %i\n",
3669 interface->bInterfaceNumber); 3602 interface->bInterfaceNumber);
3670 break; 3603 break;
3671 } 3604 }
3672/*--------------------------------------------------------------------------*/ 3605 /* 2: Audio streaming */
3673 case 2: { 3606 case 2: {
3674 if (!peasycap) { 3607 if (!peasycap) {
3675 SAM("MISTAKE: peasycap is NULL\n"); 3608 SAM("MISTAKE: peasycap is NULL\n");
@@ -3769,15 +3702,14 @@ static int easycap_usb_probe(struct usb_interface *intf,
3769 SAM("MISTAKE: audio_isoc_buffer_size is unset\n"); 3702 SAM("MISTAKE: audio_isoc_buffer_size is unset\n");
3770 return -EFAULT; 3703 return -EFAULT;
3771 } 3704 }
3772/*---------------------------------------------------------------------------*/ 3705
3773/* 3706 /*
3774 * ALLOCATE MEMORY FOR AUDIO BUFFERS. LISTS MUST BE INITIALIZED FIRST. 3707 * Allocate memory for audio buffers.
3775 */ 3708 * Lists must be initialized first.
3776/*---------------------------------------------------------------------------*/ 3709 */
3777 INIT_LIST_HEAD(&(peasycap->urb_audio_head)); 3710 INIT_LIST_HEAD(&(peasycap->urb_audio_head));
3778 peasycap->purb_audio_head = &(peasycap->urb_audio_head); 3711 peasycap->purb_audio_head = &(peasycap->urb_audio_head);
3779 3712
3780/*---------------------------------------------------------------------------*/
3781 JOM(4, "allocating %i isoc audio buffers of size %i\n", 3713 JOM(4, "allocating %i isoc audio buffers of size %i\n",
3782 AUDIO_ISOC_BUFFER_MANY, 3714 AUDIO_ISOC_BUFFER_MANY,
3783 peasycap->audio_isoc_buffer_size); 3715 peasycap->audio_isoc_buffer_size);
@@ -3800,11 +3732,8 @@ static int easycap_usb_probe(struct usb_interface *intf,
3800 peasycap->audio_isoc_buffer[k].kount = k; 3732 peasycap->audio_isoc_buffer[k].kount = k;
3801 } 3733 }
3802 JOM(4, "allocation of isoc audio buffers done.\n"); 3734 JOM(4, "allocation of isoc audio buffers done.\n");
3803/*---------------------------------------------------------------------------*/ 3735
3804/* 3736 /* Allocate and initialize urbs */
3805 * ALLOCATE AND INITIALIZE MULTIPLE struct urb ...
3806 */
3807/*---------------------------------------------------------------------------*/
3808 JOM(4, "allocating %i struct urb.\n", AUDIO_ISOC_BUFFER_MANY); 3737 JOM(4, "allocating %i struct urb.\n", AUDIO_ISOC_BUFFER_MANY);
3809 JOM(4, "using %i=peasycap->audio_isoc_framesperdesc\n", 3738 JOM(4, "using %i=peasycap->audio_isoc_framesperdesc\n",
3810 peasycap->audio_isoc_framesperdesc); 3739 peasycap->audio_isoc_framesperdesc);
@@ -3822,7 +3751,6 @@ static int easycap_usb_probe(struct usb_interface *intf,
3822 return -ENOMEM; 3751 return -ENOMEM;
3823 } 3752 }
3824 peasycap->allocation_audio_urb += 1 ; 3753 peasycap->allocation_audio_urb += 1 ;
3825/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
3826 pdata_urb = kzalloc(sizeof(struct data_urb), GFP_KERNEL); 3754 pdata_urb = kzalloc(sizeof(struct data_urb), GFP_KERNEL);
3827 if (!pdata_urb) { 3755 if (!pdata_urb) {
3828 usb_free_urb(purb); 3756 usb_free_urb(purb);
@@ -3837,11 +3765,7 @@ static int easycap_usb_probe(struct usb_interface *intf,
3837 pdata_urb->length = 0; 3765 pdata_urb->length = 0;
3838 list_add_tail(&(pdata_urb->list_head), 3766 list_add_tail(&(pdata_urb->list_head),
3839 peasycap->purb_audio_head); 3767 peasycap->purb_audio_head);
3840/*---------------------------------------------------------------------------*/ 3768
3841/*
3842 * ... AND INITIALIZE THEM
3843 */
3844/*---------------------------------------------------------------------------*/
3845 if (!k) { 3769 if (!k) {
3846 JOM(4, "initializing audio urbs thus:\n"); 3770 JOM(4, "initializing audio urbs thus:\n");
3847 JOM(4, " purb->interval = 1;\n"); 3771 JOM(4, " purb->interval = 1;\n");
@@ -3889,17 +3813,11 @@ static int easycap_usb_probe(struct usb_interface *intf,
3889 } 3813 }
3890 } 3814 }
3891 JOM(4, "allocation of %i struct urb done.\n", k); 3815 JOM(4, "allocation of %i struct urb done.\n", k);
3892/*---------------------------------------------------------------------------*/ 3816
3893/* 3817 /* Save pointer peasycap in this interface */
3894 * SAVE POINTER peasycap IN THIS INTERFACE.
3895 */
3896/*---------------------------------------------------------------------------*/
3897 usb_set_intfdata(intf, peasycap); 3818 usb_set_intfdata(intf, peasycap);
3898/*---------------------------------------------------------------------------*/ 3819
3899/* 3820 /* The audio device can now be registered */
3900 * THE AUDIO DEVICE CAN BE REGISTERED NOW, AS IT IS READY.
3901 */
3902/*---------------------------------------------------------------------------*/
3903 JOM(4, "initializing ALSA card\n"); 3821 JOM(4, "initializing ALSA card\n");
3904 3822
3905 rc = easycap_alsa_probe(peasycap); 3823 rc = easycap_alsa_probe(peasycap);
@@ -3915,11 +3833,7 @@ static int easycap_usb_probe(struct usb_interface *intf,
3915 peasycap->registered_audio++; 3833 peasycap->registered_audio++;
3916 break; 3834 break;
3917 } 3835 }
3918/*---------------------------------------------------------------------------*/ 3836 /* Interfaces other than 0,1,2 are unexpected */
3919/*
3920 * INTERFACES OTHER THAN 0, 1 AND 2 ARE UNEXPECTED
3921 */
3922/*---------------------------------------------------------------------------*/
3923 default: 3837 default:
3924 JOM(4, "ERROR: unexpected interface %i\n", bInterfaceNumber); 3838 JOM(4, "ERROR: unexpected interface %i\n", bInterfaceNumber);
3925 return -EINVAL; 3839 return -EINVAL;
diff --git a/drivers/staging/media/go7007/go7007-v4l2.c b/drivers/staging/media/go7007/go7007-v4l2.c
index 2b27d8da70a2..f91658670e34 100644
--- a/drivers/staging/media/go7007/go7007-v4l2.c
+++ b/drivers/staging/media/go7007/go7007-v4l2.c
@@ -1050,15 +1050,15 @@ static int vidioc_s_parm(struct file *filp, void *priv,
1050 return 0; 1050 return 0;
1051} 1051}
1052 1052
1053/* VIDIOC_ENUMSTD on go7007 were used for enumberating the supported fps and 1053/* VIDIOC_ENUMSTD on go7007 were used for enumerating the supported fps and
1054 its resolution, when the device is not connected to TV. 1054 its resolution, when the device is not connected to TV.
1055 This were an API abuse, probably used by the lack of specific IOCTL's to 1055 This is were an API abuse, probably used by the lack of specific IOCTL's to
1056 enumberate it, by the time the driver were written. 1056 enumerate it, by the time the driver was written.
1057 1057
1058 However, since kernel 2.6.19, two new ioctls (VIDIOC_ENUM_FRAMEINTERVALS 1058 However, since kernel 2.6.19, two new ioctls (VIDIOC_ENUM_FRAMEINTERVALS
1059 and VIDIOC_ENUM_FRAMESIZES) were added for this purpose. 1059 and VIDIOC_ENUM_FRAMESIZES) were added for this purpose.
1060 1060
1061 The two functions bellow implements the newer ioctls 1061 The two functions below implement the newer ioctls
1062*/ 1062*/
1063static int vidioc_enum_framesizes(struct file *filp, void *priv, 1063static int vidioc_enum_framesizes(struct file *filp, void *priv,
1064 struct v4l2_frmsizeenum *fsize) 1064 struct v4l2_frmsizeenum *fsize)
diff --git a/drivers/staging/media/go7007/s2250-board.c b/drivers/staging/media/go7007/s2250-board.c
index e7736a915530..014d38410c99 100644
--- a/drivers/staging/media/go7007/s2250-board.c
+++ b/drivers/staging/media/go7007/s2250-board.c
@@ -192,6 +192,7 @@ static int write_reg_fp(struct i2c_client *client, u16 addr, u16 val)
192{ 192{
193 struct go7007 *go = i2c_get_adapdata(client->adapter); 193 struct go7007 *go = i2c_get_adapdata(client->adapter);
194 struct go7007_usb *usb; 194 struct go7007_usb *usb;
195 int rc;
195 u8 *buf; 196 u8 *buf;
196 struct s2250 *dec = i2c_get_clientdata(client); 197 struct s2250 *dec = i2c_get_clientdata(client);
197 198
@@ -216,12 +217,13 @@ static int write_reg_fp(struct i2c_client *client, u16 addr, u16 val)
216 kfree(buf); 217 kfree(buf);
217 return -EINTR; 218 return -EINTR;
218 } 219 }
219 if (go7007_usb_vendor_request(go, 0x57, addr, val, buf, 16, 1) < 0) { 220 rc = go7007_usb_vendor_request(go, 0x57, addr, val, buf, 16, 1);
221 mutex_unlock(&usb->i2c_lock);
222 if (rc < 0) {
220 kfree(buf); 223 kfree(buf);
221 return -EFAULT; 224 return rc;
222 } 225 }
223 226
224 mutex_unlock(&usb->i2c_lock);
225 if (buf[0] == 0) { 227 if (buf[0] == 0) {
226 unsigned int subaddr, val_read; 228 unsigned int subaddr, val_read;
227 229
@@ -254,6 +256,7 @@ static int read_reg_fp(struct i2c_client *client, u16 addr, u16 *val)
254{ 256{
255 struct go7007 *go = i2c_get_adapdata(client->adapter); 257 struct go7007 *go = i2c_get_adapdata(client->adapter);
256 struct go7007_usb *usb; 258 struct go7007_usb *usb;
259 int rc;
257 u8 *buf; 260 u8 *buf;
258 261
259 if (go == NULL) 262 if (go == NULL)
@@ -276,11 +279,12 @@ static int read_reg_fp(struct i2c_client *client, u16 addr, u16 *val)
276 kfree(buf); 279 kfree(buf);
277 return -EINTR; 280 return -EINTR;
278 } 281 }
279 if (go7007_usb_vendor_request(go, 0x58, addr, 0, buf, 16, 1) < 0) { 282 rc = go7007_usb_vendor_request(go, 0x58, addr, 0, buf, 16, 1);
283 mutex_unlock(&usb->i2c_lock);
284 if (rc < 0) {
280 kfree(buf); 285 kfree(buf);
281 return -EFAULT; 286 return rc;
282 } 287 }
283 mutex_unlock(&usb->i2c_lock);
284 288
285 *val = (buf[0] << 8) | buf[1]; 289 *val = (buf[0] << 8) | buf[1];
286 kfree(buf); 290 kfree(buf);
diff --git a/drivers/staging/media/lirc/lirc_serial.c b/drivers/staging/media/lirc/lirc_serial.c
index 8dd8897ad860..97352cf6bd98 100644
--- a/drivers/staging/media/lirc/lirc_serial.c
+++ b/drivers/staging/media/lirc/lirc_serial.c
@@ -1282,7 +1282,7 @@ MODULE_PARM_DESC(iommap, "physical base for memory mapped I/O"
1282/* 1282/*
1283 * some architectures (e.g. intel xscale) align the 8bit serial registers 1283 * some architectures (e.g. intel xscale) align the 8bit serial registers
1284 * on 32bit word boundaries. 1284 * on 32bit word boundaries.
1285 * See linux-kernel/serial/8250.c serial_in()/out() 1285 * See linux-kernel/drivers/tty/serial/8250/8250.c serial_in()/out()
1286 */ 1286 */
1287module_param(ioshift, int, S_IRUGO); 1287module_param(ioshift, int, S_IRUGO);
1288MODULE_PARM_DESC(ioshift, "shift I/O register offset (0 = no shift)"); 1288MODULE_PARM_DESC(ioshift, "shift I/O register offset (0 = no shift)");
diff --git a/drivers/staging/media/solo6x10/Kconfig b/drivers/staging/media/solo6x10/Kconfig
index 03dcac4ea4d0..63352de5eabf 100644
--- a/drivers/staging/media/solo6x10/Kconfig
+++ b/drivers/staging/media/solo6x10/Kconfig
@@ -5,4 +5,4 @@ config SOLO6X10
5 select SND_PCM 5 select SND_PCM
6 ---help--- 6 ---help---
7 This driver supports the Softlogic based MPEG-4 and h.264 codec 7 This driver supports the Softlogic based MPEG-4 and h.264 codec
8 codec cards. 8 cards.
diff --git a/drivers/staging/media/solo6x10/core.c b/drivers/staging/media/solo6x10/core.c
index f974f6412ad7..d2fd842e37cf 100644
--- a/drivers/staging/media/solo6x10/core.c
+++ b/drivers/staging/media/solo6x10/core.c
@@ -195,28 +195,28 @@ static int __devinit solo_pci_probe(struct pci_dev *pdev,
195 SOLO6010_SYS_CFG_OUTDIV(3); 195 SOLO6010_SYS_CFG_OUTDIV(3);
196 solo_reg_write(solo_dev, SOLO_SYS_CFG, reg); 196 solo_reg_write(solo_dev, SOLO_SYS_CFG, reg);
197 197
198 if (solo_dev->flags & FLAGS_6110) { 198 if (solo_dev->flags & FLAGS_6110) {
199 u32 sys_clock_MHz = SOLO_CLOCK_MHZ; 199 u32 sys_clock_MHz = SOLO_CLOCK_MHZ;
200 u32 pll_DIVQ; 200 u32 pll_DIVQ;
201 u32 pll_DIVF; 201 u32 pll_DIVF;
202 202
203 if (sys_clock_MHz < 125) { 203 if (sys_clock_MHz < 125) {
204 pll_DIVQ = 3; 204 pll_DIVQ = 3;
205 pll_DIVF = (sys_clock_MHz * 4) / 3; 205 pll_DIVF = (sys_clock_MHz * 4) / 3;
206 } else { 206 } else {
207 pll_DIVQ = 2; 207 pll_DIVQ = 2;
208 pll_DIVF = (sys_clock_MHz * 2) / 3; 208 pll_DIVF = (sys_clock_MHz * 2) / 3;
209 } 209 }
210 210
211 solo_reg_write(solo_dev, SOLO6110_PLL_CONFIG, 211 solo_reg_write(solo_dev, SOLO6110_PLL_CONFIG,
212 SOLO6110_PLL_RANGE_5_10MHZ | 212 SOLO6110_PLL_RANGE_5_10MHZ |
213 SOLO6110_PLL_DIVR(9) | 213 SOLO6110_PLL_DIVR(9) |
214 SOLO6110_PLL_DIVQ_EXP(pll_DIVQ) | 214 SOLO6110_PLL_DIVQ_EXP(pll_DIVQ) |
215 SOLO6110_PLL_DIVF(pll_DIVF) | SOLO6110_PLL_FSEN); 215 SOLO6110_PLL_DIVF(pll_DIVF) | SOLO6110_PLL_FSEN);
216 mdelay(1); // PLL Locking time (1ms) 216 mdelay(1); /* PLL Locking time (1ms) */
217 217
218 solo_reg_write(solo_dev, SOLO_DMA_CTRL1, 3 << 8); /* ? */ 218 solo_reg_write(solo_dev, SOLO_DMA_CTRL1, 3 << 8); /* ? */
219 } else 219 } else
220 solo_reg_write(solo_dev, SOLO_DMA_CTRL1, 1 << 8); /* ? */ 220 solo_reg_write(solo_dev, SOLO_DMA_CTRL1, 1 << 8); /* ? */
221 221
222 solo_reg_write(solo_dev, SOLO_TIMER_CLOCK_NUM, SOLO_CLOCK_MHZ - 1); 222 solo_reg_write(solo_dev, SOLO_TIMER_CLOCK_NUM, SOLO_CLOCK_MHZ - 1);