staging/easycap: kill telltale logic
[pandora-kernel.git] / drivers / staging / easycap / easycap.h
1 /*****************************************************************************
2 *                                                                            *
3 *  easycap.h                                                                 *
4 *                                                                            *
5 *****************************************************************************/
6 /*
7  *
8  *  Copyright (C) 2010 R.M. Thomas  <rmthomas@sciolus.org>
9  *
10  *
11  *  This is free software; you can redistribute it and/or modify
12  *  it under the terms of the GNU General Public License as published by
13  *  the Free Software Foundation; either version 2 of the License, or
14  *  (at your option) any later version.
15  *
16  *  The software is distributed in the hope that it will be useful,
17  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  *  GNU General Public License for more details.
20  *
21  *  You should have received a copy of the GNU General Public License
22  *  along with this software; if not, write to the Free Software
23  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
24  *
25 */
26 /*****************************************************************************/
27 /*---------------------------------------------------------------------------*/
28 /*
29  *  THE FOLLOWING PARAMETERS ARE UNDEFINED:
30  *
31  *                EASYCAP_DEBUG
32  *
33  *  IF REQUIRED THEY MUST BE EXTERNALLY DEFINED, FOR EXAMPLE AS COMPILER
34  *  OPTIONS.
35  */
36 /*---------------------------------------------------------------------------*/
37
38 #ifndef __EASYCAP_H__
39 #define __EASYCAP_H__
40
41 /*---------------------------------------------------------------------------*/
42 /*
43  *  THESE ARE NORMALLY DEFINED
44  */
45 /*---------------------------------------------------------------------------*/
46 #define  PATIENCE  500
47 #define  PERSEVERE
48 /*---------------------------------------------------------------------------*/
49 /*
50  *  THESE ARE FOR MAINTENANCE ONLY - NORMALLY UNDEFINED:
51  */
52 /*---------------------------------------------------------------------------*/
53 #undef  EASYCAP_TESTCARD
54 /*---------------------------------------------------------------------------*/
55 #include <linux/kernel.h>
56 #include <linux/errno.h>
57 #include <linux/init.h>
58 #include <linux/slab.h>
59 #include <linux/module.h>
60 #include <linux/kref.h>
61 #include <linux/usb.h>
62 #include <linux/uaccess.h>
63
64 #include <linux/i2c.h>
65 #include <linux/workqueue.h>
66 #include <linux/poll.h>
67 #include <linux/mm.h>
68 #include <linux/fs.h>
69 #include <linux/delay.h>
70 #include <linux/types.h>
71
72 #ifndef CONFIG_EASYCAP_OSS
73 #include <linux/vmalloc.h>
74 #include <linux/sound.h>
75 #include <sound/core.h>
76 #include <sound/pcm.h>
77 #include <sound/pcm_params.h>
78 #include <sound/info.h>
79 #include <sound/initval.h>
80 #include <sound/control.h>
81 #endif /* !CONFIG_EASYCAP_OSS */
82 #include <media/v4l2-dev.h>
83 #include <media/v4l2-device.h>
84 #include <linux/videodev2.h>
85 #include <linux/soundcard.h>
86
87 /*---------------------------------------------------------------------------*/
88 /*  VENDOR, PRODUCT:  Syntek Semiconductor Co., Ltd
89  *
90  *      EITHER        EasyCAP USB 2.0 Video Adapter with Audio, Model No. DC60
91  *               with input cabling:  AUDIO(L), AUDIO(R), CVBS, S-VIDEO.
92  *
93  *          OR        EasyCAP 4CHANNEL USB 2.0 DVR, Model No. EasyCAP002
94  *               with input cabling:  MICROPHONE, CVBS1, CVBS2, CVBS3, CVBS4.
95  */
96 /*---------------------------------------------------------------------------*/
97 #define USB_EASYCAP_VENDOR_ID   0x05e1
98 #define USB_EASYCAP_PRODUCT_ID  0x0408
99
100 #define EASYCAP_DRIVER_VERSION "0.9.01"
101 #define EASYCAP_DRIVER_DESCRIPTION "easycapdc60"
102
103 #define USB_SKEL_MINOR_BASE     192
104 #define DONGLE_MANY 8
105 #define INPUT_MANY 6
106 /*---------------------------------------------------------------------------*/
107 /*
108  *  DEFAULT LUMINANCE, CONTRAST, SATURATION AND HUE
109  */
110 /*---------------------------------------------------------------------------*/
111 #define SAA_0A_DEFAULT 0x7F
112 #define SAA_0B_DEFAULT 0x3F
113 #define SAA_0C_DEFAULT 0x2F
114 #define SAA_0D_DEFAULT 0x00
115 /*---------------------------------------------------------------------------*/
116 /*
117  *  VIDEO STREAMING PARAMETERS:
118  *  USB 2.0 PROVIDES FOR HIGH-BANDWIDTH ENDPOINTS WITH AN UPPER LIMIT
119  *  OF 3072 BYTES PER MICROFRAME for wMaxPacketSize.
120  */
121 /*---------------------------------------------------------------------------*/
122 #define VIDEO_ISOC_BUFFER_MANY 16
123 #define VIDEO_ISOC_ORDER 3
124 #define VIDEO_ISOC_FRAMESPERDESC ((unsigned int) 1 << VIDEO_ISOC_ORDER)
125 #define USB_2_0_MAXPACKETSIZE 3072
126 #if (USB_2_0_MAXPACKETSIZE > PAGE_SIZE)
127 #error video_isoc_buffer[.] will not be big enough
128 #endif
129 #define VIDEO_JUNK_TOLERATE VIDEO_ISOC_BUFFER_MANY
130 #define VIDEO_LOST_TOLERATE 50
131 /*---------------------------------------------------------------------------*/
132 /*
133  *  VIDEO BUFFERS
134  */
135 /*---------------------------------------------------------------------------*/
136 #define FIELD_BUFFER_SIZE (203 * PAGE_SIZE)
137 #define FRAME_BUFFER_SIZE (405 * PAGE_SIZE)
138 #define FIELD_BUFFER_MANY 4
139 #define FRAME_BUFFER_MANY 6
140 /*---------------------------------------------------------------------------*/
141 /*
142  *  AUDIO STREAMING PARAMETERS
143  */
144 /*---------------------------------------------------------------------------*/
145 #define AUDIO_ISOC_BUFFER_MANY 16
146 #define AUDIO_ISOC_ORDER 1
147 #define AUDIO_ISOC_FRAMESPERDESC 32
148 #define AUDIO_ISOC_BUFFER_SIZE (PAGE_SIZE << AUDIO_ISOC_ORDER)
149 /*---------------------------------------------------------------------------*/
150 /*
151  *  AUDIO BUFFERS
152  */
153 /*---------------------------------------------------------------------------*/
154 #define AUDIO_FRAGMENT_MANY 32
155 #define PAGES_PER_AUDIO_FRAGMENT 4
156 /*---------------------------------------------------------------------------*/
157 /*
158  *  IT IS ESSENTIAL THAT EVEN-NUMBERED STANDARDS ARE 25 FRAMES PER SECOND,
159  *                        ODD-NUMBERED STANDARDS ARE 30 FRAMES PER SECOND.
160  *  THE NUMBERING OF STANDARDS MUST NOT BE CHANGED WITHOUT DUE CARE.  NOT
161  *  ONLY MUST THE PARAMETER
162  *                             STANDARD_MANY
163  *  BE CHANGED TO CORRESPOND TO THE NEW NUMBER OF STANDARDS, BUT ALSO THE
164  *  NUMBERING MUST REMAIN AN UNBROKEN ASCENDING SEQUENCE:  DUMMY STANDARDS
165  *  MAY NEED TO BE ADDED.   APPROPRIATE CHANGES WILL ALWAYS BE REQUIRED IN
166  *  ROUTINE fillin_formats() AND POSSIBLY ELSEWHERE.  BEWARE.
167  */
168 /*---------------------------------------------------------------------------*/
169 #define  PAL_BGHIN      0
170 #define  PAL_Nc         2
171 #define  SECAM          4
172 #define  NTSC_N         6
173 #define  NTSC_N_443     8
174 #define  NTSC_M         1
175 #define  NTSC_443       3
176 #define  NTSC_M_JP      5
177 #define  PAL_60         7
178 #define  PAL_M          9
179 #define  PAL_BGHIN_SLOW    10
180 #define  PAL_Nc_SLOW       12
181 #define  SECAM_SLOW        14
182 #define  NTSC_N_SLOW       16
183 #define  NTSC_N_443_SLOW   18
184 #define  NTSC_M_SLOW       11
185 #define  NTSC_443_SLOW     13
186 #define  NTSC_M_JP_SLOW    15
187 #define  PAL_60_SLOW       17
188 #define  PAL_M_SLOW        19
189 #define  STANDARD_MANY 20
190 /*---------------------------------------------------------------------------*/
191 /*
192  *  ENUMS
193  */
194 /*---------------------------------------------------------------------------*/
195 enum {
196         AT_720x576,
197         AT_704x576,
198         AT_640x480,
199         AT_720x480,
200         AT_360x288,
201         AT_320x240,
202         AT_360x240,
203         RESOLUTION_MANY
204 };
205 enum {
206         FMT_UYVY,
207         FMT_YUY2,
208         FMT_RGB24,
209         FMT_RGB32,
210         FMT_BGR24,
211         FMT_BGR32,
212         PIXELFORMAT_MANY
213 };
214 enum {
215         FIELD_NONE,
216         FIELD_INTERLACED,
217         INTERLACE_MANY
218 };
219 #define SETTINGS_MANY   (STANDARD_MANY * \
220                         RESOLUTION_MANY * \
221                         2 * \
222                         PIXELFORMAT_MANY * \
223                         INTERLACE_MANY)
224 /*---------------------------------------------------------------------------*/
225 /*
226  *  STRUCTURE DEFINITIONS
227  */
228 /*---------------------------------------------------------------------------*/
229 struct easycap_dongle {
230         struct easycap *peasycap;
231         struct mutex mutex_video;
232         struct mutex mutex_audio;
233 };
234 /*---------------------------------------------------------------------------*/
235 struct data_buffer {
236         struct list_head list_head;
237         void *pgo;
238         void *pto;
239         u16 kount;
240         u16 input;
241 };
242 /*---------------------------------------------------------------------------*/
243 struct data_urb {
244         struct list_head list_head;
245         struct urb *purb;
246         int isbuf;
247         int length;
248 };
249 /*---------------------------------------------------------------------------*/
250 struct easycap_standard {
251         u16 mask;
252 struct v4l2_standard v4l2_standard;
253 };
254 struct easycap_format {
255         u16 mask;
256         char name[128];
257 struct v4l2_format v4l2_format;
258 };
259 struct inputset {
260         int input;
261         int input_ok;
262         int standard_offset;
263         int standard_offset_ok;
264         int format_offset;
265         int format_offset_ok;
266         int brightness;
267         int brightness_ok;
268         int contrast;
269         int contrast_ok;
270         int saturation;
271         int saturation_ok;
272         int hue;
273         int hue_ok;
274 };
275 /*---------------------------------------------------------------------------*/
276 /*
277  *   easycap.ilk == 0   =>  CVBS+S-VIDEO HARDWARE, AUDIO wMaxPacketSize=256
278  *   easycap.ilk == 2   =>  CVBS+S-VIDEO HARDWARE, AUDIO wMaxPacketSize=9
279  *   easycap.ilk == 3   =>     FOUR-CVBS HARDWARE, AUDIO wMaxPacketSize=9
280  */
281 /*---------------------------------------------------------------------------*/
282 struct easycap {
283         int isdongle;
284         int minor;
285
286         struct video_device video_device;
287         struct v4l2_device v4l2_device;
288
289         int status;
290         unsigned int audio_pages_per_fragment;
291         unsigned int audio_bytes_per_fragment;
292         unsigned int audio_buffer_page_many;
293
294 #define UPSAMPLE
295 #ifdef UPSAMPLE
296         s16 oldaudio;
297 #endif /*UPSAMPLE*/
298
299         int ilk;
300         bool microphone;
301
302         struct usb_device *pusb_device;
303         struct usb_interface *pusb_interface;
304
305         struct kref kref;
306
307         int queued[FRAME_BUFFER_MANY];
308         int done[FRAME_BUFFER_MANY];
309
310         wait_queue_head_t wq_video;
311         wait_queue_head_t wq_audio;
312         wait_queue_head_t wq_trigger;
313
314         int input;
315         int polled;
316         int standard_offset;
317         int format_offset;
318         struct inputset inputset[INPUT_MANY];
319
320         bool ntsc;
321         int fps;
322         int usec;
323         int tolerate;
324         int skip;
325         int skipped;
326         int lost[INPUT_MANY];
327         int merit[180];
328
329         struct timeval timeval0;
330         struct timeval timeval1;
331         struct timeval timeval2;
332         struct timeval timeval3;
333         struct timeval timeval6;
334         struct timeval timeval7;
335         struct timeval timeval8;
336         long long int dnbydt;
337
338         int    video_interface;
339         int    video_altsetting_on;
340         int    video_altsetting_off;
341         int    video_endpointnumber;
342         int    video_isoc_maxframesize;
343         int    video_isoc_buffer_size;
344         int    video_isoc_framesperdesc;
345
346         int    video_isoc_streaming;
347         int    video_isoc_sequence;
348         int    video_idle;
349         int    video_eof;
350         int    video_junk;
351
352         struct data_buffer video_isoc_buffer[VIDEO_ISOC_BUFFER_MANY];
353         struct data_buffer field_buffer[FIELD_BUFFER_MANY]
354                                         [(FIELD_BUFFER_SIZE/PAGE_SIZE)];
355         struct data_buffer frame_buffer[FRAME_BUFFER_MANY]
356                                         [(FRAME_BUFFER_SIZE/PAGE_SIZE)];
357
358         struct list_head urb_video_head;
359         struct list_head *purb_video_head;
360
361         u8 cache[8];
362         u8 *pcache;
363         int video_mt;
364         int audio_mt;
365         long long audio_bytes;
366         u32 isequence;
367
368         int vma_many;
369 /*---------------------------------------------------------------------------*/
370 /*
371  *  BUFFER INDICATORS
372  */
373 /*---------------------------------------------------------------------------*/
374         int field_fill; /* Field buffer being filled by easycap_complete().  */
375                         /*   Bumped only by easycap_complete().              */
376         int field_page; /* Page of field buffer page being filled by         */
377                         /*   easycap_complete().                             */
378         int field_read; /* Field buffer to be read by field2frame().         */
379                         /*   Bumped only by easycap_complete().              */
380         int frame_fill; /* Frame buffer being filled by field2frame().       */
381                         /*   Bumped only by easycap_dqbuf() when             */
382                         /*   field2frame() has created a complete frame.     */
383         int frame_read; /* Frame buffer offered to user by DQBUF.            */
384                         /*   Set only by easycap_dqbuf() to trail frame_fill.*/
385         int frame_lock; /* Flag set to 1 by DQBUF and cleared by QBUF        */
386 /*---------------------------------------------------------------------------*/
387 /*
388  *  IMAGE PROPERTIES
389  */
390 /*---------------------------------------------------------------------------*/
391         u32                   pixelformat;
392         int                     width;
393         int                     height;
394         int                     bytesperpixel;
395         bool                    byteswaporder;
396         bool                    decimatepixel;
397         bool                    offerfields;
398         int                     frame_buffer_used;
399         int                     frame_buffer_many;
400         int                     videofieldamount;
401
402         int                     brightness;
403         int                     contrast;
404         int                     saturation;
405         int                     hue;
406
407         int allocation_video_urb;
408         int allocation_video_page;
409         int allocation_video_struct;
410         int registered_video;
411 /*---------------------------------------------------------------------------*/
412 /*
413  *  ALSA
414  */
415 /*---------------------------------------------------------------------------*/
416 #ifndef CONFIG_EASYCAP_OSS
417         struct snd_pcm_hardware alsa_hardware;
418         struct snd_card *psnd_card;
419         struct snd_pcm *psnd_pcm;
420         struct snd_pcm_substream *psubstream;
421         int dma_fill;
422         int dma_next;
423         int dma_read;
424 #endif /* !CONFIG_EASYCAP_OSS */
425 /*---------------------------------------------------------------------------*/
426 /*
427  *  SOUND PROPERTIES
428  */
429 /*---------------------------------------------------------------------------*/
430         int audio_interface;
431         int audio_altsetting_on;
432         int audio_altsetting_off;
433         int audio_endpointnumber;
434         int audio_isoc_maxframesize;
435         int audio_isoc_buffer_size;
436         int audio_isoc_framesperdesc;
437
438         int audio_isoc_streaming;
439         int audio_idle;
440         int audio_eof;
441         int volume;
442         int mute;
443         s8 gain;
444
445         struct data_buffer audio_isoc_buffer[AUDIO_ISOC_BUFFER_MANY];
446
447         struct list_head urb_audio_head;
448         struct list_head *purb_audio_head;
449 /*---------------------------------------------------------------------------*/
450 /*
451  *  BUFFER INDICATORS
452  */
453 /*---------------------------------------------------------------------------*/
454         int audio_fill; /* Audio buffer being filled by easycap_complete().  */
455                         /*   Bumped only by easycap_complete().              */
456         int audio_read; /* Audio buffer page being read by easycap_read().   */
457                         /*   Set by easycap_read() to trail audio_fill by    */
458                         /*   one fragment.                                   */
459 /*---------------------------------------------------------------------------*/
460 /*
461  *  SOUND PROPERTIES
462  */
463 /*---------------------------------------------------------------------------*/
464
465         int audio_buffer_many;
466
467         int allocation_audio_urb;
468         int allocation_audio_page;
469         int allocation_audio_struct;
470         int registered_audio;
471
472         long long int audio_sample;
473         long long int audio_niveau;
474         long long int audio_square;
475
476         struct data_buffer audio_buffer[];
477 };
478 /*---------------------------------------------------------------------------*/
479 /*
480  *  VIDEO FUNCTION PROTOTYPES
481  */
482 /*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
483 long easycap_unlocked_ioctl(struct file *, unsigned int, unsigned long);
484 int              easycap_dqbuf(struct easycap *, int);
485 int              submit_video_urbs(struct easycap *);
486 int              kill_video_urbs(struct easycap *);
487 int              field2frame(struct easycap *);
488 int              redaub(struct easycap *, void *, void *,
489                                                 int, int, u8, u8, bool);
490 void             easycap_testcard(struct easycap *, int);
491 int              fillin_formats(void);
492 int              newinput(struct easycap *, int);
493 int              adjust_standard(struct easycap *, v4l2_std_id);
494 int              adjust_format(struct easycap *, u32, u32, u32,
495                                                                 int, bool);
496 int              adjust_brightness(struct easycap *, int);
497 int              adjust_contrast(struct easycap *, int);
498 int              adjust_saturation(struct easycap *, int);
499 int              adjust_hue(struct easycap *, int);
500 int              adjust_volume(struct easycap *, int);
501 /*---------------------------------------------------------------------------*/
502 /*
503  *  AUDIO FUNCTION PROTOTYPES
504  */
505 /*---------------------------------------------------------------------------*/
506 #ifndef CONFIG_EASYCAP_OSS
507 int             easycap_alsa_probe(struct easycap *);
508 void            easycap_alsa_complete(struct urb *);
509 #else /* CONFIG_EASYCAP_OSS */
510 void             easyoss_complete(struct urb *);
511 #endif /* !CONFIG_EASYCAP_OSS */
512
513 int              easycap_sound_setup(struct easycap *);
514 int              submit_audio_urbs(struct easycap *);
515 int              kill_audio_urbs(struct easycap *);
516 void             easyoss_testtone(struct easycap *, int);
517 int              audio_setup(struct easycap *);
518 /*---------------------------------------------------------------------------*/
519 /*
520  *  LOW-LEVEL FUNCTION PROTOTYPES
521  */
522 /*---------------------------------------------------------------------------*/
523 int              audio_gainget(struct usb_device *);
524 int              audio_gainset(struct usb_device *, s8);
525
526 int              set_interface(struct usb_device *, u16);
527 int              wakeup_device(struct usb_device *);
528 int              confirm_resolution(struct usb_device *);
529 int              confirm_stream(struct usb_device *);
530
531 int              setup_stk(struct usb_device *, bool);
532 int              setup_saa(struct usb_device *, bool);
533 int              setup_vt(struct usb_device *);
534 int              check_stk(struct usb_device *, bool);
535 int              check_saa(struct usb_device *, bool);
536 int              ready_saa(struct usb_device *);
537 int              merit_saa(struct usb_device *);
538 int              check_vt(struct usb_device *);
539 int              select_input(struct usb_device *, int, int);
540 int              set_resolution(struct usb_device *,
541                                                 u16, u16, u16, u16);
542
543 int              read_saa(struct usb_device *, u16);
544 int              read_stk(struct usb_device *, u32);
545 int              write_saa(struct usb_device *, u16, u16);
546 int              write_000(struct usb_device *, u16, u16);
547 int              start_100(struct usb_device *);
548 int              stop_100(struct usb_device *);
549 int              write_300(struct usb_device *);
550 int              read_vt(struct usb_device *, u16);
551 int              write_vt(struct usb_device *, u16, u16);
552 int             isdongle(struct easycap *);
553 /*---------------------------------------------------------------------------*/
554 struct signed_div_result {
555         long long int quotient;
556         unsigned long long int remainder;
557 } signed_div(long long int, long long int);
558
559
560 /*---------------------------------------------------------------------------*/
561 /*
562  *  MACROS SAM(...) AND JOM(...) ALLOW DIAGNOSTIC OUTPUT TO BE TAGGED WITH
563  *  THE IDENTITY OF THE DONGLE TO WHICH IT APPLIES, BUT IF INVOKED WHEN THE
564  *  POINTER peasycap IS INVALID AN Oops IS LIKELY, AND ITS CAUSE MAY NOT BE
565  *  IMMEDIATELY OBVIOUS FROM A CASUAL READING OF THE SOURCE CODE.  BEWARE.
566 */
567 /*---------------------------------------------------------------------------*/
568 const char *strerror(int err);
569
570 #define SAY(format, args...) do { \
571         printk(KERN_DEBUG "easycap:: %s: " \
572                         format, __func__, ##args); \
573 } while (0)
574 #define SAM(format, args...) do { \
575         printk(KERN_DEBUG "easycap::%i%s: " \
576                         format, peasycap->isdongle, __func__, ##args);\
577 } while (0)
578
579 #ifdef CONFIG_EASYCAP_DEBUG
580 extern int easycap_debug;
581 #define JOT(n, format, args...) do { \
582         if (n <= easycap_debug) { \
583                 printk(KERN_DEBUG "easycap:: %s: " \
584                         format, __func__, ##args);\
585         } \
586 } while (0)
587 #define JOM(n, format, args...) do { \
588         if (n <= easycap_debug) { \
589                 printk(KERN_DEBUG "easycap::%i%s: " \
590                         format, peasycap->isdongle, __func__, ##args);\
591         } \
592 } while (0)
593
594 #else
595 #define JOT(n, format, args...) do {} while (0)
596 #define JOM(n, format, args...) do {} while (0)
597 #endif /* CONFIG_EASYCAP_DEBUG */
598
599 #define MICROSECONDS(X, Y) \
600                         ((1000000*((long long int)(X.tv_sec - Y.tv_sec))) + \
601                                         (long long int)(X.tv_usec - Y.tv_usec))
602
603 /*---------------------------------------------------------------------------*/
604 /*
605  *  (unsigned char *)P           pointer to next byte pair
606  *       (long int *)X           pointer to accumulating count
607  *       (long int *)Y           pointer to accumulating sum
608  *  (long long int *)Z           pointer to accumulating sum of squares
609  */
610 /*---------------------------------------------------------------------------*/
611 #define SUMMER(P, X, Y, Z) do {                                 \
612         unsigned char *p;                                    \
613         unsigned int u0, u1, u2;                             \
614         long int s;                                          \
615         p = (unsigned char *)(P);                            \
616         u0 = (unsigned int) (*p);                            \
617         u1 = (unsigned int) (*(p + 1));                      \
618         u2 = (unsigned int) ((u1 << 8) | u0);                \
619         if (0x8000 & u2)                                     \
620                 s = -(long int)(0x7FFF & (~u2));             \
621         else                                                 \
622                 s =  (long int)(0x7FFF & u2);                \
623         *((X)) += (long int) 1;                              \
624         *((Y)) += (long int) s;                              \
625         *((Z)) += ((long long int)(s) * (long long int)(s)); \
626 } while (0)
627 /*---------------------------------------------------------------------------*/
628
629 /*---------------------------------------------------------------------------*/
630 /* globals
631  */
632 /*---------------------------------------------------------------------------*/
633
634 extern bool easycap_readback;
635 extern const struct easycap_standard easycap_standard[];
636 extern struct easycap_format easycap_format[];
637 extern struct v4l2_queryctrl easycap_control[];
638 extern struct usb_driver easycap_usb_driver;
639 extern struct easycap_dongle easycapdc60_dongle[];
640 #ifdef CONFIG_EASYCAP_OSS
641 extern struct usb_class_driver easyoss_class;
642 #endif /* !CONFIG_EASYCAP_OSS */
643
644 #endif /* !__EASYCAP_H__  */