diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2011-01-22 18:13:58 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-01-24 17:43:06 -0500 |
commit | 03389996e086fe61216692f0a2bb445051082902 (patch) | |
tree | eabfbbdf8c31a1f9a2055f15ac5152dbb3f5125f /drivers/staging/easycap | |
parent | d090bf57492bde9cb6281246c92963476c40b512 (diff) |
staging: easycap: easycap.h use indentation for first level
replace
struct {
int a;
}
with more readable
struct {
int a;
}
Cc: Mike Thomas <rmthomas@sciolus.org>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/easycap')
-rw-r--r-- | drivers/staging/easycap/easycap.h | 373 |
1 files changed, 186 insertions, 187 deletions
diff --git a/drivers/staging/easycap/easycap.h b/drivers/staging/easycap/easycap.h index f98ac6e1bb4..2f49d4af2f5 100644 --- a/drivers/staging/easycap/easycap.h +++ b/drivers/staging/easycap/easycap.h | |||
@@ -218,28 +218,28 @@ | |||
218 | */ | 218 | */ |
219 | /*---------------------------------------------------------------------------*/ | 219 | /*---------------------------------------------------------------------------*/ |
220 | enum { | 220 | enum { |
221 | AT_720x576, | 221 | AT_720x576, |
222 | AT_704x576, | 222 | AT_704x576, |
223 | AT_640x480, | 223 | AT_640x480, |
224 | AT_720x480, | 224 | AT_720x480, |
225 | AT_360x288, | 225 | AT_360x288, |
226 | AT_320x240, | 226 | AT_320x240, |
227 | AT_360x240, | 227 | AT_360x240, |
228 | RESOLUTION_MANY | 228 | RESOLUTION_MANY |
229 | }; | 229 | }; |
230 | enum { | 230 | enum { |
231 | FMT_UYVY, | 231 | FMT_UYVY, |
232 | FMT_YUY2, | 232 | FMT_YUY2, |
233 | FMT_RGB24, | 233 | FMT_RGB24, |
234 | FMT_RGB32, | 234 | FMT_RGB32, |
235 | FMT_BGR24, | 235 | FMT_BGR24, |
236 | FMT_BGR32, | 236 | FMT_BGR32, |
237 | PIXELFORMAT_MANY | 237 | PIXELFORMAT_MANY |
238 | }; | 238 | }; |
239 | enum { | 239 | enum { |
240 | FIELD_NONE, | 240 | FIELD_NONE, |
241 | FIELD_INTERLACED, | 241 | FIELD_INTERLACED, |
242 | INTERLACE_MANY | 242 | INTERLACE_MANY |
243 | }; | 243 | }; |
244 | #define SETTINGS_MANY (STANDARD_MANY * \ | 244 | #define SETTINGS_MANY (STANDARD_MANY * \ |
245 | RESOLUTION_MANY * \ | 245 | RESOLUTION_MANY * \ |
@@ -252,50 +252,50 @@ INTERLACE_MANY | |||
252 | */ | 252 | */ |
253 | /*---------------------------------------------------------------------------*/ | 253 | /*---------------------------------------------------------------------------*/ |
254 | struct easycap_dongle { | 254 | struct easycap_dongle { |
255 | struct easycap *peasycap; | 255 | struct easycap *peasycap; |
256 | struct mutex mutex_video; | 256 | struct mutex mutex_video; |
257 | struct mutex mutex_audio; | 257 | struct mutex mutex_audio; |
258 | }; | 258 | }; |
259 | /*---------------------------------------------------------------------------*/ | 259 | /*---------------------------------------------------------------------------*/ |
260 | struct data_buffer { | 260 | struct data_buffer { |
261 | struct list_head list_head; | 261 | struct list_head list_head; |
262 | void *pgo; | 262 | void *pgo; |
263 | void *pto; | 263 | void *pto; |
264 | __u16 kount; | 264 | __u16 kount; |
265 | __u16 input; | 265 | __u16 input; |
266 | }; | 266 | }; |
267 | /*---------------------------------------------------------------------------*/ | 267 | /*---------------------------------------------------------------------------*/ |
268 | struct data_urb { | 268 | struct data_urb { |
269 | struct list_head list_head; | 269 | struct list_head list_head; |
270 | struct urb *purb; | 270 | struct urb *purb; |
271 | int isbuf; | 271 | int isbuf; |
272 | int length; | 272 | int length; |
273 | }; | 273 | }; |
274 | /*---------------------------------------------------------------------------*/ | 274 | /*---------------------------------------------------------------------------*/ |
275 | struct easycap_standard { | 275 | struct easycap_standard { |
276 | __u16 mask; | 276 | __u16 mask; |
277 | struct v4l2_standard v4l2_standard; | 277 | struct v4l2_standard v4l2_standard; |
278 | }; | 278 | }; |
279 | struct easycap_format { | 279 | struct easycap_format { |
280 | __u16 mask; | 280 | __u16 mask; |
281 | char name[128]; | 281 | char name[128]; |
282 | struct v4l2_format v4l2_format; | 282 | struct v4l2_format v4l2_format; |
283 | }; | 283 | }; |
284 | struct inputset { | 284 | struct inputset { |
285 | int input; | 285 | int input; |
286 | int input_ok; | 286 | int input_ok; |
287 | int standard_offset; | 287 | int standard_offset; |
288 | int standard_offset_ok; | 288 | int standard_offset_ok; |
289 | int format_offset; | 289 | int format_offset; |
290 | int format_offset_ok; | 290 | int format_offset_ok; |
291 | int brightness; | 291 | int brightness; |
292 | int brightness_ok; | 292 | int brightness_ok; |
293 | int contrast; | 293 | int contrast; |
294 | int contrast_ok; | 294 | int contrast_ok; |
295 | int saturation; | 295 | int saturation; |
296 | int saturation_ok; | 296 | int saturation_ok; |
297 | int hue; | 297 | int hue; |
298 | int hue_ok; | 298 | int hue_ok; |
299 | }; | 299 | }; |
300 | /*---------------------------------------------------------------------------*/ | 300 | /*---------------------------------------------------------------------------*/ |
301 | /* | 301 | /* |
@@ -306,187 +306,186 @@ int hue_ok; | |||
306 | /*---------------------------------------------------------------------------*/ | 306 | /*---------------------------------------------------------------------------*/ |
307 | struct easycap { | 307 | struct easycap { |
308 | #define TELLTALE "expectedstring" | 308 | #define TELLTALE "expectedstring" |
309 | char telltale[16]; | 309 | char telltale[16]; |
310 | int isdongle; | 310 | int isdongle; |
311 | int minor; | 311 | int minor; |
312 | 312 | ||
313 | /*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/ | 313 | /*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/ |
314 | #if defined(EASYCAP_IS_VIDEODEV_CLIENT) | 314 | #if defined(EASYCAP_IS_VIDEODEV_CLIENT) |
315 | struct video_device video_device; | 315 | struct video_device video_device; |
316 | #if defined(EASYCAP_NEEDS_V4L2_DEVICE_H) | 316 | #if defined(EASYCAP_NEEDS_V4L2_DEVICE_H) |
317 | struct v4l2_device v4l2_device; | 317 | struct v4l2_device v4l2_device; |
318 | #endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/ | 318 | #endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/ |
319 | #endif /*EASYCAP_IS_VIDEODEV_CLIENT*/ | 319 | #endif /*EASYCAP_IS_VIDEODEV_CLIENT*/ |
320 | /*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ | 320 | /*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ |
321 | int status; | 321 | int status; |
322 | unsigned int audio_pages_per_fragment; | 322 | unsigned int audio_pages_per_fragment; |
323 | unsigned int audio_bytes_per_fragment; | 323 | unsigned int audio_bytes_per_fragment; |
324 | unsigned int audio_buffer_page_many; | 324 | unsigned int audio_buffer_page_many; |
325 | 325 | ||
326 | #define UPSAMPLE | 326 | #define UPSAMPLE |
327 | #if defined(UPSAMPLE) | 327 | #if defined(UPSAMPLE) |
328 | __s16 oldaudio; | 328 | __s16 oldaudio; |
329 | #endif /*UPSAMPLE*/ | 329 | #endif /*UPSAMPLE*/ |
330 | 330 | ||
331 | int ilk; | 331 | int ilk; |
332 | bool microphone; | 332 | bool microphone; |
333 | 333 | ||
334 | struct usb_device *pusb_device; | 334 | struct usb_device *pusb_device; |
335 | struct usb_interface *pusb_interface; | 335 | struct usb_interface *pusb_interface; |
336 | 336 | ||
337 | struct kref kref; | 337 | struct kref kref; |
338 | 338 | ||
339 | int queued[FRAME_BUFFER_MANY]; | 339 | int queued[FRAME_BUFFER_MANY]; |
340 | int done[FRAME_BUFFER_MANY]; | 340 | int done[FRAME_BUFFER_MANY]; |
341 | 341 | ||
342 | wait_queue_head_t wq_video; | 342 | wait_queue_head_t wq_video; |
343 | wait_queue_head_t wq_audio; | 343 | wait_queue_head_t wq_audio; |
344 | wait_queue_head_t wq_trigger; | 344 | wait_queue_head_t wq_trigger; |
345 | 345 | ||
346 | int input; | 346 | int input; |
347 | int polled; | 347 | int polled; |
348 | int standard_offset; | 348 | int standard_offset; |
349 | int format_offset; | 349 | int format_offset; |
350 | struct inputset inputset[INPUT_MANY]; | 350 | struct inputset inputset[INPUT_MANY]; |
351 | 351 | ||
352 | bool ntsc; | 352 | bool ntsc; |
353 | int fps; | 353 | int fps; |
354 | int usec; | 354 | int usec; |
355 | int tolerate; | 355 | int tolerate; |
356 | int skip; | 356 | int skip; |
357 | int skipped; | 357 | int skipped; |
358 | int lost[INPUT_MANY]; | 358 | int lost[INPUT_MANY]; |
359 | int merit[180]; | 359 | int merit[180]; |
360 | 360 | ||
361 | struct timeval timeval0; | 361 | struct timeval timeval0; |
362 | struct timeval timeval1; | 362 | struct timeval timeval1; |
363 | struct timeval timeval2; | 363 | struct timeval timeval2; |
364 | struct timeval timeval3; | 364 | struct timeval timeval3; |
365 | struct timeval timeval6; | 365 | struct timeval timeval6; |
366 | struct timeval timeval7; | 366 | struct timeval timeval7; |
367 | struct timeval timeval8; | 367 | struct timeval timeval8; |
368 | long long int dnbydt; | 368 | long long int dnbydt; |
369 | 369 | ||
370 | int video_interface; | 370 | int video_interface; |
371 | int video_altsetting_on; | 371 | int video_altsetting_on; |
372 | int video_altsetting_off; | 372 | int video_altsetting_off; |
373 | int video_endpointnumber; | 373 | int video_endpointnumber; |
374 | int video_isoc_maxframesize; | 374 | int video_isoc_maxframesize; |
375 | int video_isoc_buffer_size; | 375 | int video_isoc_buffer_size; |
376 | int video_isoc_framesperdesc; | 376 | int video_isoc_framesperdesc; |
377 | 377 | ||
378 | int video_isoc_streaming; | 378 | int video_isoc_streaming; |
379 | int video_isoc_sequence; | 379 | int video_isoc_sequence; |
380 | int video_idle; | 380 | int video_idle; |
381 | int video_eof; | 381 | int video_eof; |
382 | int video_junk; | 382 | int video_junk; |
383 | 383 | ||
384 | struct data_buffer video_isoc_buffer[VIDEO_ISOC_BUFFER_MANY]; | 384 | struct data_buffer video_isoc_buffer[VIDEO_ISOC_BUFFER_MANY]; |
385 | struct data_buffer | 385 | struct data_buffer field_buffer[FIELD_BUFFER_MANY] |
386 | field_buffer[FIELD_BUFFER_MANY][(FIELD_BUFFER_SIZE/PAGE_SIZE)]; | 386 | [(FIELD_BUFFER_SIZE/PAGE_SIZE)]; |
387 | struct data_buffer | 387 | struct data_buffer frame_buffer[FRAME_BUFFER_MANY] |
388 | frame_buffer[FRAME_BUFFER_MANY][(FRAME_BUFFER_SIZE/PAGE_SIZE)]; | 388 | [(FRAME_BUFFER_SIZE/PAGE_SIZE)]; |
389 | 389 | ||
390 | struct list_head urb_video_head; | 390 | struct list_head urb_video_head; |
391 | struct list_head *purb_video_head; | 391 | struct list_head *purb_video_head; |
392 | 392 | ||
393 | __u8 cache[8]; | 393 | __u8 cache[8]; |
394 | __u8 *pcache; | 394 | __u8 *pcache; |
395 | int video_mt; | 395 | int video_mt; |
396 | int audio_mt; | 396 | int audio_mt; |
397 | long long audio_bytes; | 397 | long long audio_bytes; |
398 | __u32 isequence; | 398 | __u32 isequence; |
399 | 399 | ||
400 | int vma_many; | 400 | int vma_many; |
401 | |||
402 | /*---------------------------------------------------------------------------*/ | 401 | /*---------------------------------------------------------------------------*/ |
403 | /* | 402 | /* |
404 | * BUFFER INDICATORS | 403 | * BUFFER INDICATORS |
405 | */ | 404 | */ |
406 | /*---------------------------------------------------------------------------*/ | 405 | /*---------------------------------------------------------------------------*/ |
407 | int field_fill; /* Field buffer being filled by easycap_complete(). */ | 406 | int field_fill; /* Field buffer being filled by easycap_complete(). */ |
408 | /* Bumped only by easycap_complete(). */ | 407 | /* Bumped only by easycap_complete(). */ |
409 | int field_page; /* Page of field buffer page being filled by */ | 408 | int field_page; /* Page of field buffer page being filled by */ |
410 | /* easycap_complete(). */ | 409 | /* easycap_complete(). */ |
411 | int field_read; /* Field buffer to be read by field2frame(). */ | 410 | int field_read; /* Field buffer to be read by field2frame(). */ |
412 | /* Bumped only by easycap_complete(). */ | 411 | /* Bumped only by easycap_complete(). */ |
413 | int frame_fill; /* Frame buffer being filled by field2frame(). */ | 412 | int frame_fill; /* Frame buffer being filled by field2frame(). */ |
414 | /* Bumped only by easycap_dqbuf() when */ | 413 | /* Bumped only by easycap_dqbuf() when */ |
415 | /* field2frame() has created a complete frame. */ | 414 | /* field2frame() has created a complete frame. */ |
416 | int frame_read; /* Frame buffer offered to user by DQBUF. */ | 415 | int frame_read; /* Frame buffer offered to user by DQBUF. */ |
417 | /* Set only by easycap_dqbuf() to trail frame_fill.*/ | 416 | /* Set only by easycap_dqbuf() to trail frame_fill.*/ |
418 | int frame_lock; /* Flag set to 1 by DQBUF and cleared by QBUF */ | 417 | int frame_lock; /* Flag set to 1 by DQBUF and cleared by QBUF */ |
419 | /*---------------------------------------------------------------------------*/ | 418 | /*---------------------------------------------------------------------------*/ |
420 | /* | 419 | /* |
421 | * IMAGE PROPERTIES | 420 | * IMAGE PROPERTIES |
422 | */ | 421 | */ |
423 | /*---------------------------------------------------------------------------*/ | 422 | /*---------------------------------------------------------------------------*/ |
424 | __u32 pixelformat; | 423 | __u32 pixelformat; |
425 | int width; | 424 | int width; |
426 | int height; | 425 | int height; |
427 | int bytesperpixel; | 426 | int bytesperpixel; |
428 | bool byteswaporder; | 427 | bool byteswaporder; |
429 | bool decimatepixel; | 428 | bool decimatepixel; |
430 | bool offerfields; | 429 | bool offerfields; |
431 | int frame_buffer_used; | 430 | int frame_buffer_used; |
432 | int frame_buffer_many; | 431 | int frame_buffer_many; |
433 | int videofieldamount; | 432 | int videofieldamount; |
434 | 433 | ||
435 | int brightness; | 434 | int brightness; |
436 | int contrast; | 435 | int contrast; |
437 | int saturation; | 436 | int saturation; |
438 | int hue; | 437 | int hue; |
439 | 438 | ||
440 | int allocation_video_urb; | 439 | int allocation_video_urb; |
441 | int allocation_video_page; | 440 | int allocation_video_page; |
442 | int allocation_video_struct; | 441 | int allocation_video_struct; |
443 | int registered_video; | 442 | int registered_video; |
444 | /*---------------------------------------------------------------------------*/ | 443 | /*---------------------------------------------------------------------------*/ |
445 | /* | 444 | /* |
446 | * ALSA | 445 | * ALSA |
447 | */ | 446 | */ |
448 | /*---------------------------------------------------------------------------*/ | 447 | /*---------------------------------------------------------------------------*/ |
449 | #if defined(EASYCAP_NEEDS_ALSA) | 448 | #if defined(EASYCAP_NEEDS_ALSA) |
450 | struct snd_pcm_hardware alsa_hardware; | 449 | struct snd_pcm_hardware alsa_hardware; |
451 | struct snd_card *psnd_card; | 450 | struct snd_card *psnd_card; |
452 | struct snd_pcm *psnd_pcm; | 451 | struct snd_pcm *psnd_pcm; |
453 | struct snd_pcm_substream *psubstream; | 452 | struct snd_pcm_substream *psubstream; |
454 | int dma_fill; | 453 | int dma_fill; |
455 | int dma_next; | 454 | int dma_next; |
456 | int dma_read; | 455 | int dma_read; |
457 | #endif /*EASYCAP_NEEDS_ALSA*/ | 456 | #endif /*EASYCAP_NEEDS_ALSA*/ |
458 | /*---------------------------------------------------------------------------*/ | 457 | /*---------------------------------------------------------------------------*/ |
459 | /* | 458 | /* |
460 | * SOUND PROPERTIES | 459 | * SOUND PROPERTIES |
461 | */ | 460 | */ |
462 | /*---------------------------------------------------------------------------*/ | 461 | /*---------------------------------------------------------------------------*/ |
463 | int audio_interface; | 462 | int audio_interface; |
464 | int audio_altsetting_on; | 463 | int audio_altsetting_on; |
465 | int audio_altsetting_off; | 464 | int audio_altsetting_off; |
466 | int audio_endpointnumber; | 465 | int audio_endpointnumber; |
467 | int audio_isoc_maxframesize; | 466 | int audio_isoc_maxframesize; |
468 | int audio_isoc_buffer_size; | 467 | int audio_isoc_buffer_size; |
469 | int audio_isoc_framesperdesc; | 468 | int audio_isoc_framesperdesc; |
470 | 469 | ||
471 | int audio_isoc_streaming; | 470 | int audio_isoc_streaming; |
472 | int audio_idle; | 471 | int audio_idle; |
473 | int audio_eof; | 472 | int audio_eof; |
474 | int volume; | 473 | int volume; |
475 | int mute; | 474 | int mute; |
476 | s8 gain; | 475 | s8 gain; |
477 | 476 | ||
478 | struct data_buffer audio_isoc_buffer[AUDIO_ISOC_BUFFER_MANY]; | 477 | struct data_buffer audio_isoc_buffer[AUDIO_ISOC_BUFFER_MANY]; |
479 | 478 | ||
480 | struct list_head urb_audio_head; | 479 | struct list_head urb_audio_head; |
481 | struct list_head *purb_audio_head; | 480 | struct list_head *purb_audio_head; |
482 | /*---------------------------------------------------------------------------*/ | 481 | /*---------------------------------------------------------------------------*/ |
483 | /* | 482 | /* |
484 | * BUFFER INDICATORS | 483 | * BUFFER INDICATORS |
485 | */ | 484 | */ |
486 | /*---------------------------------------------------------------------------*/ | 485 | /*---------------------------------------------------------------------------*/ |
487 | int audio_fill; /* Audio buffer being filled by easycap_complete(). */ | 486 | int audio_fill; /* Audio buffer being filled by easycap_complete(). */ |
488 | /* Bumped only by easycap_complete(). */ | 487 | /* Bumped only by easycap_complete(). */ |
489 | int audio_read; /* Audio buffer page being read by easycap_read(). */ | 488 | int audio_read; /* Audio buffer page being read by easycap_read(). */ |
490 | /* Set by easycap_read() to trail audio_fill by */ | 489 | /* Set by easycap_read() to trail audio_fill by */ |
491 | /* one fragment. */ | 490 | /* one fragment. */ |
492 | /*---------------------------------------------------------------------------*/ | 491 | /*---------------------------------------------------------------------------*/ |
@@ -495,18 +494,18 @@ int audio_read; /* Audio buffer page being read by easycap_read(). */ | |||
495 | */ | 494 | */ |
496 | /*---------------------------------------------------------------------------*/ | 495 | /*---------------------------------------------------------------------------*/ |
497 | 496 | ||
498 | int audio_buffer_many; | 497 | int audio_buffer_many; |
499 | 498 | ||
500 | int allocation_audio_urb; | 499 | int allocation_audio_urb; |
501 | int allocation_audio_page; | 500 | int allocation_audio_page; |
502 | int allocation_audio_struct; | 501 | int allocation_audio_struct; |
503 | int registered_audio; | 502 | int registered_audio; |
504 | 503 | ||
505 | long long int audio_sample; | 504 | long long int audio_sample; |
506 | long long int audio_niveau; | 505 | long long int audio_niveau; |
507 | long long int audio_square; | 506 | long long int audio_square; |
508 | 507 | ||
509 | struct data_buffer audio_buffer[]; | 508 | struct data_buffer audio_buffer[]; |
510 | }; | 509 | }; |
511 | /*---------------------------------------------------------------------------*/ | 510 | /*---------------------------------------------------------------------------*/ |
512 | /* | 511 | /* |