aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/easycap
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2011-01-22 18:13:58 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2011-01-24 17:43:06 -0500
commit03389996e086fe61216692f0a2bb445051082902 (patch)
treeeabfbbdf8c31a1f9a2055f15ac5152dbb3f5125f /drivers/staging/easycap
parentd090bf57492bde9cb6281246c92963476c40b512 (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.h373
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/*---------------------------------------------------------------------------*/
220enum { 220enum {
221AT_720x576, 221 AT_720x576,
222AT_704x576, 222 AT_704x576,
223AT_640x480, 223 AT_640x480,
224AT_720x480, 224 AT_720x480,
225AT_360x288, 225 AT_360x288,
226AT_320x240, 226 AT_320x240,
227AT_360x240, 227 AT_360x240,
228RESOLUTION_MANY 228 RESOLUTION_MANY
229}; 229};
230enum { 230enum {
231FMT_UYVY, 231 FMT_UYVY,
232FMT_YUY2, 232 FMT_YUY2,
233FMT_RGB24, 233 FMT_RGB24,
234FMT_RGB32, 234 FMT_RGB32,
235FMT_BGR24, 235 FMT_BGR24,
236FMT_BGR32, 236 FMT_BGR32,
237PIXELFORMAT_MANY 237 PIXELFORMAT_MANY
238}; 238};
239enum { 239enum {
240FIELD_NONE, 240 FIELD_NONE,
241FIELD_INTERLACED, 241 FIELD_INTERLACED,
242INTERLACE_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/*---------------------------------------------------------------------------*/
254struct easycap_dongle { 254struct easycap_dongle {
255struct easycap *peasycap; 255 struct easycap *peasycap;
256struct mutex mutex_video; 256 struct mutex mutex_video;
257struct mutex mutex_audio; 257 struct mutex mutex_audio;
258}; 258};
259/*---------------------------------------------------------------------------*/ 259/*---------------------------------------------------------------------------*/
260struct data_buffer { 260struct data_buffer {
261struct list_head list_head; 261 struct list_head list_head;
262void *pgo; 262 void *pgo;
263void *pto; 263 void *pto;
264__u16 kount; 264 __u16 kount;
265__u16 input; 265 __u16 input;
266}; 266};
267/*---------------------------------------------------------------------------*/ 267/*---------------------------------------------------------------------------*/
268struct data_urb { 268struct data_urb {
269struct list_head list_head; 269 struct list_head list_head;
270struct urb *purb; 270 struct urb *purb;
271int isbuf; 271 int isbuf;
272int length; 272 int length;
273}; 273};
274/*---------------------------------------------------------------------------*/ 274/*---------------------------------------------------------------------------*/
275struct easycap_standard { 275struct easycap_standard {
276__u16 mask; 276 __u16 mask;
277struct v4l2_standard v4l2_standard; 277struct v4l2_standard v4l2_standard;
278}; 278};
279struct easycap_format { 279struct easycap_format {
280__u16 mask; 280 __u16 mask;
281char name[128]; 281 char name[128];
282struct v4l2_format v4l2_format; 282struct v4l2_format v4l2_format;
283}; 283};
284struct inputset { 284struct inputset {
285int input; 285 int input;
286int input_ok; 286 int input_ok;
287int standard_offset; 287 int standard_offset;
288int standard_offset_ok; 288 int standard_offset_ok;
289int format_offset; 289 int format_offset;
290int format_offset_ok; 290 int format_offset_ok;
291int brightness; 291 int brightness;
292int brightness_ok; 292 int brightness_ok;
293int contrast; 293 int contrast;
294int contrast_ok; 294 int contrast_ok;
295int saturation; 295 int saturation;
296int saturation_ok; 296 int saturation_ok;
297int hue; 297 int hue;
298int hue_ok; 298 int hue_ok;
299}; 299};
300/*---------------------------------------------------------------------------*/ 300/*---------------------------------------------------------------------------*/
301/* 301/*
@@ -306,187 +306,186 @@ int hue_ok;
306/*---------------------------------------------------------------------------*/ 306/*---------------------------------------------------------------------------*/
307struct easycap { 307struct easycap {
308#define TELLTALE "expectedstring" 308#define TELLTALE "expectedstring"
309char telltale[16]; 309 char telltale[16];
310int isdongle; 310 int isdongle;
311int minor; 311 int minor;
312 312
313/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/ 313/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
314#if defined(EASYCAP_IS_VIDEODEV_CLIENT) 314#if defined(EASYCAP_IS_VIDEODEV_CLIENT)
315struct 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)
317struct 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/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
321int status; 321 int status;
322unsigned int audio_pages_per_fragment; 322 unsigned int audio_pages_per_fragment;
323unsigned int audio_bytes_per_fragment; 323 unsigned int audio_bytes_per_fragment;
324unsigned 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
331int ilk; 331 int ilk;
332bool microphone; 332 bool microphone;
333 333
334struct usb_device *pusb_device; 334 struct usb_device *pusb_device;
335struct usb_interface *pusb_interface; 335 struct usb_interface *pusb_interface;
336 336
337struct kref kref; 337 struct kref kref;
338 338
339int queued[FRAME_BUFFER_MANY]; 339 int queued[FRAME_BUFFER_MANY];
340int done[FRAME_BUFFER_MANY]; 340 int done[FRAME_BUFFER_MANY];
341 341
342wait_queue_head_t wq_video; 342 wait_queue_head_t wq_video;
343wait_queue_head_t wq_audio; 343 wait_queue_head_t wq_audio;
344wait_queue_head_t wq_trigger; 344 wait_queue_head_t wq_trigger;
345 345
346int input; 346 int input;
347int polled; 347 int polled;
348int standard_offset; 348 int standard_offset;
349int format_offset; 349 int format_offset;
350struct inputset inputset[INPUT_MANY]; 350 struct inputset inputset[INPUT_MANY];
351 351
352bool ntsc; 352 bool ntsc;
353int fps; 353 int fps;
354int usec; 354 int usec;
355int tolerate; 355 int tolerate;
356int skip; 356 int skip;
357int skipped; 357 int skipped;
358int lost[INPUT_MANY]; 358 int lost[INPUT_MANY];
359int merit[180]; 359 int merit[180];
360 360
361struct timeval timeval0; 361 struct timeval timeval0;
362struct timeval timeval1; 362 struct timeval timeval1;
363struct timeval timeval2; 363 struct timeval timeval2;
364struct timeval timeval3; 364 struct timeval timeval3;
365struct timeval timeval6; 365 struct timeval timeval6;
366struct timeval timeval7; 366 struct timeval timeval7;
367struct timeval timeval8; 367 struct timeval timeval8;
368long long int dnbydt; 368 long long int dnbydt;
369 369
370int video_interface; 370 int video_interface;
371int video_altsetting_on; 371 int video_altsetting_on;
372int video_altsetting_off; 372 int video_altsetting_off;
373int video_endpointnumber; 373 int video_endpointnumber;
374int video_isoc_maxframesize; 374 int video_isoc_maxframesize;
375int video_isoc_buffer_size; 375 int video_isoc_buffer_size;
376int video_isoc_framesperdesc; 376 int video_isoc_framesperdesc;
377 377
378int video_isoc_streaming; 378 int video_isoc_streaming;
379int video_isoc_sequence; 379 int video_isoc_sequence;
380int video_idle; 380 int video_idle;
381int video_eof; 381 int video_eof;
382int video_junk; 382 int video_junk;
383 383
384struct data_buffer video_isoc_buffer[VIDEO_ISOC_BUFFER_MANY]; 384 struct data_buffer video_isoc_buffer[VIDEO_ISOC_BUFFER_MANY];
385struct 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)];
387struct 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
390struct list_head urb_video_head; 390 struct list_head urb_video_head;
391struct 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;
395int video_mt; 395 int video_mt;
396int audio_mt; 396 int audio_mt;
397long long audio_bytes; 397 long long audio_bytes;
398__u32 isequence; 398 __u32 isequence;
399 399
400int vma_many; 400 int vma_many;
401
402/*---------------------------------------------------------------------------*/ 401/*---------------------------------------------------------------------------*/
403/* 402/*
404 * BUFFER INDICATORS 403 * BUFFER INDICATORS
405 */ 404 */
406/*---------------------------------------------------------------------------*/ 405/*---------------------------------------------------------------------------*/
407int 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(). */
409int 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(). */
411int 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(). */
413int 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. */
416int 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.*/
418int 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;
425int width; 424 int width;
426int height; 425 int height;
427int bytesperpixel; 426 int bytesperpixel;
428bool byteswaporder; 427 bool byteswaporder;
429bool decimatepixel; 428 bool decimatepixel;
430bool offerfields; 429 bool offerfields;
431int frame_buffer_used; 430 int frame_buffer_used;
432int frame_buffer_many; 431 int frame_buffer_many;
433int videofieldamount; 432 int videofieldamount;
434 433
435int brightness; 434 int brightness;
436int contrast; 435 int contrast;
437int saturation; 436 int saturation;
438int hue; 437 int hue;
439 438
440int allocation_video_urb; 439 int allocation_video_urb;
441int allocation_video_page; 440 int allocation_video_page;
442int allocation_video_struct; 441 int allocation_video_struct;
443int 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)
450struct snd_pcm_hardware alsa_hardware; 449 struct snd_pcm_hardware alsa_hardware;
451struct snd_card *psnd_card; 450 struct snd_card *psnd_card;
452struct snd_pcm *psnd_pcm; 451 struct snd_pcm *psnd_pcm;
453struct snd_pcm_substream *psubstream; 452 struct snd_pcm_substream *psubstream;
454int dma_fill; 453 int dma_fill;
455int dma_next; 454 int dma_next;
456int 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/*---------------------------------------------------------------------------*/
463int audio_interface; 462 int audio_interface;
464int audio_altsetting_on; 463 int audio_altsetting_on;
465int audio_altsetting_off; 464 int audio_altsetting_off;
466int audio_endpointnumber; 465 int audio_endpointnumber;
467int audio_isoc_maxframesize; 466 int audio_isoc_maxframesize;
468int audio_isoc_buffer_size; 467 int audio_isoc_buffer_size;
469int audio_isoc_framesperdesc; 468 int audio_isoc_framesperdesc;
470 469
471int audio_isoc_streaming; 470 int audio_isoc_streaming;
472int audio_idle; 471 int audio_idle;
473int audio_eof; 472 int audio_eof;
474int volume; 473 int volume;
475int mute; 474 int mute;
476s8 gain; 475 s8 gain;
477 476
478struct data_buffer audio_isoc_buffer[AUDIO_ISOC_BUFFER_MANY]; 477 struct data_buffer audio_isoc_buffer[AUDIO_ISOC_BUFFER_MANY];
479 478
480struct list_head urb_audio_head; 479 struct list_head urb_audio_head;
481struct 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/*---------------------------------------------------------------------------*/
487int 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(). */
489int 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
498int audio_buffer_many; 497 int audio_buffer_many;
499 498
500int allocation_audio_urb; 499 int allocation_audio_urb;
501int allocation_audio_page; 500 int allocation_audio_page;
502int allocation_audio_struct; 501 int allocation_audio_struct;
503int registered_audio; 502 int registered_audio;
504 503
505long long int audio_sample; 504 long long int audio_sample;
506long long int audio_niveau; 505 long long int audio_niveau;
507long long int audio_square; 506 long long int audio_square;
508 507
509struct data_buffer audio_buffer[]; 508 struct data_buffer audio_buffer[];
510}; 509};
511/*---------------------------------------------------------------------------*/ 510/*---------------------------------------------------------------------------*/
512/* 511/*