summaryrefslogtreecommitdiff
path: root/drivers/staging/easycap/easycap.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/easycap/easycap.h')
-rw-r--r--drivers/staging/easycap/easycap.h559
1 files changed, 265 insertions, 294 deletions
diff --git a/drivers/staging/easycap/easycap.h b/drivers/staging/easycap/easycap.h
index 8ebf96f8a242..1f94e2389efc 100644
--- a/drivers/staging/easycap/easycap.h
+++ b/drivers/staging/easycap/easycap.h
@@ -29,19 +29,14 @@
* THE FOLLOWING PARAMETERS ARE UNDEFINED:
*
* EASYCAP_DEBUG
- * EASYCAP_IS_VIDEODEV_CLIENT
- * EASYCAP_NEEDS_USBVIDEO_H
- * EASYCAP_NEEDS_V4L2_DEVICE_H
- * EASYCAP_NEEDS_V4L2_FOPS
- * EASYCAP_NEEDS_UNLOCKED_IOCTL
*
* IF REQUIRED THEY MUST BE EXTERNALLY DEFINED, FOR EXAMPLE AS COMPILER
* OPTIONS.
*/
/*---------------------------------------------------------------------------*/
-#if (!defined(EASYCAP_H))
-#define EASYCAP_H
+#ifndef __EASYCAP_H__
+#define __EASYCAP_H__
/*---------------------------------------------------------------------------*/
/*
@@ -49,7 +44,6 @@
*/
/*---------------------------------------------------------------------------*/
#define PATIENCE 500
-#undef PREFER_NTSC
#define PERSEVERE
/*---------------------------------------------------------------------------*/
/*
@@ -57,15 +51,11 @@
*/
/*---------------------------------------------------------------------------*/
#undef EASYCAP_TESTCARD
-#undef EASYCAP_TESTTONE
-#undef NOREADBACK
-#undef AUDIOTIME
/*---------------------------------------------------------------------------*/
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/slab.h>
-#include <linux/smp_lock.h>
#include <linux/module.h>
#include <linux/kref.h>
#include <linux/usb.h>
@@ -80,26 +70,25 @@
#include <linux/delay.h>
#include <linux/types.h>
-/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
-#if defined(EASYCAP_IS_VIDEODEV_CLIENT)
+#ifndef CONFIG_EASYCAP_OSS
+#include <linux/vmalloc.h>
+#include <linux/sound.h>
+#include <sound/core.h>
+#include <sound/pcm.h>
+#include <sound/pcm_params.h>
+#include <sound/info.h>
+#include <sound/initval.h>
+#include <sound/control.h>
+#endif /* !CONFIG_EASYCAP_OSS */
#include <media/v4l2-dev.h>
-#if defined(EASYCAP_NEEDS_V4L2_DEVICE_H)
#include <media/v4l2-device.h>
-#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
-#endif /*EASYCAP_IS_VIDEODEV_CLIENT*/
-/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
#include <linux/videodev2.h>
#include <linux/soundcard.h>
-#if defined(EASYCAP_NEEDS_USBVIDEO_H)
-#include <config/video/usbvideo.h>
-#endif /*EASYCAP_NEEDS_USBVIDEO_H*/
-#if (!defined(PAGE_SIZE))
+#ifndef PAGE_SIZE
#error "PAGE_SIZE not defined"
-#endif
+#endif /* PAGE_SIZE */
-#define STRINGIZE_AGAIN(x) #x
-#define STRINGIZE(x) STRINGIZE_AGAIN(x)
/*---------------------------------------------------------------------------*/
/* VENDOR, PRODUCT: Syntek Semiconductor Co., Ltd
*
@@ -113,7 +102,7 @@
#define USB_EASYCAP_VENDOR_ID 0x05e1
#define USB_EASYCAP_PRODUCT_ID 0x0408
-#define EASYCAP_DRIVER_VERSION "0.8.41"
+#define EASYCAP_DRIVER_VERSION "0.9.01"
#define EASYCAP_DRIVER_DESCRIPTION "easycapdc60"
#define USB_SKEL_MINOR_BASE 192
@@ -159,7 +148,8 @@
*/
/*---------------------------------------------------------------------------*/
#define AUDIO_ISOC_BUFFER_MANY 16
-#define AUDIO_ISOC_ORDER 3
+#define AUDIO_ISOC_ORDER 1
+#define AUDIO_ISOC_FRAMESPERDESC 32
#define AUDIO_ISOC_BUFFER_SIZE (PAGE_SIZE << AUDIO_ISOC_ORDER)
/*---------------------------------------------------------------------------*/
/*
@@ -167,6 +157,7 @@
*/
/*---------------------------------------------------------------------------*/
#define AUDIO_FRAGMENT_MANY 32
+#define PAGES_PER_AUDIO_FRAGMENT 4
/*---------------------------------------------------------------------------*/
/*
* IT IS ESSENTIAL THAT EVEN-NUMBERED STANDARDS ARE 25 FRAMES PER SECOND,
@@ -207,28 +198,28 @@
*/
/*---------------------------------------------------------------------------*/
enum {
-AT_720x576,
-AT_704x576,
-AT_640x480,
-AT_720x480,
-AT_360x288,
-AT_320x240,
-AT_360x240,
-RESOLUTION_MANY
+ AT_720x576,
+ AT_704x576,
+ AT_640x480,
+ AT_720x480,
+ AT_360x288,
+ AT_320x240,
+ AT_360x240,
+ RESOLUTION_MANY
};
enum {
-FMT_UYVY,
-FMT_YUY2,
-FMT_RGB24,
-FMT_RGB32,
-FMT_BGR24,
-FMT_BGR32,
-PIXELFORMAT_MANY
+ FMT_UYVY,
+ FMT_YUY2,
+ FMT_RGB24,
+ FMT_RGB32,
+ FMT_BGR24,
+ FMT_BGR32,
+ PIXELFORMAT_MANY
};
enum {
-FIELD_NONE,
-FIELD_INTERLACED,
-INTERLACE_MANY
+ FIELD_NONE,
+ FIELD_INTERLACED,
+ INTERLACE_MANY
};
#define SETTINGS_MANY (STANDARD_MANY * \
RESOLUTION_MANY * \
@@ -241,50 +232,50 @@ INTERLACE_MANY
*/
/*---------------------------------------------------------------------------*/
struct easycap_dongle {
-struct easycap *peasycap;
-struct mutex mutex_video;
-struct mutex mutex_audio;
+ struct easycap *peasycap;
+ struct mutex mutex_video;
+ struct mutex mutex_audio;
};
/*---------------------------------------------------------------------------*/
struct data_buffer {
-struct list_head list_head;
-void *pgo;
-void *pto;
-__u16 kount;
-__u16 input;
+ struct list_head list_head;
+ void *pgo;
+ void *pto;
+ u16 kount;
+ u16 input;
};
/*---------------------------------------------------------------------------*/
struct data_urb {
-struct list_head list_head;
-struct urb *purb;
-int isbuf;
-int length;
+ struct list_head list_head;
+ struct urb *purb;
+ int isbuf;
+ int length;
};
/*---------------------------------------------------------------------------*/
struct easycap_standard {
-__u16 mask;
+ u16 mask;
struct v4l2_standard v4l2_standard;
};
struct easycap_format {
-__u16 mask;
-char name[128];
+ u16 mask;
+ char name[128];
struct v4l2_format v4l2_format;
};
struct inputset {
-int input;
-int input_ok;
-int standard_offset;
-int standard_offset_ok;
-int format_offset;
-int format_offset_ok;
-int brightness;
-int brightness_ok;
-int contrast;
-int contrast_ok;
-int saturation;
-int saturation_ok;
-int hue;
-int hue_ok;
+ int input;
+ int input_ok;
+ int standard_offset;
+ int standard_offset_ok;
+ int format_offset;
+ int format_offset_ok;
+ int brightness;
+ int brightness_ok;
+ int contrast;
+ int contrast_ok;
+ int saturation;
+ int saturation_ok;
+ int hue;
+ int hue_ok;
};
/*---------------------------------------------------------------------------*/
/*
@@ -295,171 +286,182 @@ int hue_ok;
/*---------------------------------------------------------------------------*/
struct easycap {
#define TELLTALE "expectedstring"
-char telltale[16];
-int isdongle;
-
-/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
-#if defined(EASYCAP_IS_VIDEODEV_CLIENT)
-struct video_device video_device;
-#if defined(EASYCAP_NEEDS_V4L2_DEVICE_H)
-struct v4l2_device v4l2_device;
-#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
-#endif /*EASYCAP_IS_VIDEODEV_CLIENT*/
-/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
-int status;
-unsigned int audio_pages_per_fragment;
-unsigned int audio_bytes_per_fragment;
-unsigned int audio_buffer_page_many;
+ char telltale[16];
+ int isdongle;
+ int minor;
+
+ struct video_device video_device;
+ struct v4l2_device v4l2_device;
+
+ int status;
+ unsigned int audio_pages_per_fragment;
+ unsigned int audio_bytes_per_fragment;
+ unsigned int audio_buffer_page_many;
#define UPSAMPLE
-#if defined(UPSAMPLE)
-__s16 oldaudio;
+#ifdef UPSAMPLE
+ s16 oldaudio;
#endif /*UPSAMPLE*/
-int ilk;
-bool microphone;
-
-struct usb_device *pusb_device;
-struct usb_interface *pusb_interface;
-
-struct kref kref;
-
-int queued[FRAME_BUFFER_MANY];
-int done[FRAME_BUFFER_MANY];
-
-wait_queue_head_t wq_video;
-wait_queue_head_t wq_audio;
-
-int input;
-int polled;
-int standard_offset;
-int format_offset;
-struct inputset inputset[INPUT_MANY];
-
-bool ntsc;
-int fps;
-int usec;
-int tolerate;
-int skip;
-int skipped;
-int lost[INPUT_MANY];
-int merit[180];
-
-struct timeval timeval0;
-struct timeval timeval1;
-struct timeval timeval2;
-struct timeval timeval3;
-struct timeval timeval6;
-struct timeval timeval7;
-struct timeval timeval8;
-long long int dnbydt;
-
-int video_interface;
-int video_altsetting_on;
-int video_altsetting_off;
-int video_endpointnumber;
-int video_isoc_maxframesize;
-int video_isoc_buffer_size;
-int video_isoc_framesperdesc;
-
-int video_isoc_streaming;
-int video_isoc_sequence;
-int video_idle;
-int video_eof;
-int video_junk;
-
-struct data_buffer video_isoc_buffer[VIDEO_ISOC_BUFFER_MANY];
-struct data_buffer \
- field_buffer[FIELD_BUFFER_MANY][(FIELD_BUFFER_SIZE/PAGE_SIZE)];
-struct data_buffer \
- frame_buffer[FRAME_BUFFER_MANY][(FRAME_BUFFER_SIZE/PAGE_SIZE)];
-
-struct list_head urb_video_head;
-struct list_head *purb_video_head;
-
-__u8 cache[8];
-__u8 *pcache;
-int video_mt;
-int audio_mt;
-long long audio_bytes;
-__u32 isequence;
-
-int vma_many;
-
+ int ilk;
+ bool microphone;
+
+ struct usb_device *pusb_device;
+ struct usb_interface *pusb_interface;
+
+ struct kref kref;
+
+ int queued[FRAME_BUFFER_MANY];
+ int done[FRAME_BUFFER_MANY];
+
+ wait_queue_head_t wq_video;
+ wait_queue_head_t wq_audio;
+ wait_queue_head_t wq_trigger;
+
+ int input;
+ int polled;
+ int standard_offset;
+ int format_offset;
+ struct inputset inputset[INPUT_MANY];
+
+ bool ntsc;
+ int fps;
+ int usec;
+ int tolerate;
+ int skip;
+ int skipped;
+ int lost[INPUT_MANY];
+ int merit[180];
+
+ struct timeval timeval0;
+ struct timeval timeval1;
+ struct timeval timeval2;
+ struct timeval timeval3;
+ struct timeval timeval6;
+ struct timeval timeval7;
+ struct timeval timeval8;
+ long long int dnbydt;
+
+ int video_interface;
+ int video_altsetting_on;
+ int video_altsetting_off;
+ int video_endpointnumber;
+ int video_isoc_maxframesize;
+ int video_isoc_buffer_size;
+ int video_isoc_framesperdesc;
+
+ int video_isoc_streaming;
+ int video_isoc_sequence;
+ int video_idle;
+ int video_eof;
+ int video_junk;
+
+ struct data_buffer video_isoc_buffer[VIDEO_ISOC_BUFFER_MANY];
+ struct data_buffer field_buffer[FIELD_BUFFER_MANY]
+ [(FIELD_BUFFER_SIZE/PAGE_SIZE)];
+ struct data_buffer frame_buffer[FRAME_BUFFER_MANY]
+ [(FRAME_BUFFER_SIZE/PAGE_SIZE)];
+
+ struct list_head urb_video_head;
+ struct list_head *purb_video_head;
+
+ u8 cache[8];
+ u8 *pcache;
+ int video_mt;
+ int audio_mt;
+ long long audio_bytes;
+ u32 isequence;
+
+ int vma_many;
/*---------------------------------------------------------------------------*/
/*
* BUFFER INDICATORS
*/
/*---------------------------------------------------------------------------*/
-int field_fill; /* Field buffer being filled by easycap_complete(). */
+ int field_fill; /* Field buffer being filled by easycap_complete(). */
/* Bumped only by easycap_complete(). */
-int field_page; /* Page of field buffer page being filled by */
+ int field_page; /* Page of field buffer page being filled by */
/* easycap_complete(). */
-int field_read; /* Field buffer to be read by field2frame(). */
+ int field_read; /* Field buffer to be read by field2frame(). */
/* Bumped only by easycap_complete(). */
-int frame_fill; /* Frame buffer being filled by field2frame(). */
+ int frame_fill; /* Frame buffer being filled by field2frame(). */
/* Bumped only by easycap_dqbuf() when */
/* field2frame() has created a complete frame. */
-int frame_read; /* Frame buffer offered to user by DQBUF. */
+ int frame_read; /* Frame buffer offered to user by DQBUF. */
/* Set only by easycap_dqbuf() to trail frame_fill.*/
-int frame_lock; /* Flag set to 1 by DQBUF and cleared by QBUF */
+ int frame_lock; /* Flag set to 1 by DQBUF and cleared by QBUF */
/*---------------------------------------------------------------------------*/
/*
* IMAGE PROPERTIES
*/
/*---------------------------------------------------------------------------*/
-__u32 pixelformat;
-int width;
-int height;
-int bytesperpixel;
-bool byteswaporder;
-bool decimatepixel;
-bool offerfields;
-int frame_buffer_used;
-int frame_buffer_many;
-int videofieldamount;
-
-int brightness;
-int contrast;
-int saturation;
-int hue;
-
-int allocation_video_urb;
-int allocation_video_page;
-int allocation_video_struct;
-int registered_video;
+ u32 pixelformat;
+ int width;
+ int height;
+ int bytesperpixel;
+ bool byteswaporder;
+ bool decimatepixel;
+ bool offerfields;
+ int frame_buffer_used;
+ int frame_buffer_many;
+ int videofieldamount;
+
+ int brightness;
+ int contrast;
+ int saturation;
+ int hue;
+
+ int allocation_video_urb;
+ int allocation_video_page;
+ int allocation_video_struct;
+ int registered_video;
+/*---------------------------------------------------------------------------*/
+/*
+ * ALSA
+ */
+/*---------------------------------------------------------------------------*/
+#ifndef CONFIG_EASYCAP_OSS
+ struct snd_pcm_hardware alsa_hardware;
+ struct snd_card *psnd_card;
+ struct snd_pcm *psnd_pcm;
+ struct snd_pcm_substream *psubstream;
+ int dma_fill;
+ int dma_next;
+ int dma_read;
+#endif /* !CONFIG_EASYCAP_OSS */
/*---------------------------------------------------------------------------*/
/*
* SOUND PROPERTIES
*/
/*---------------------------------------------------------------------------*/
-int audio_interface;
-int audio_altsetting_on;
-int audio_altsetting_off;
-int audio_endpointnumber;
-int audio_isoc_maxframesize;
-int audio_isoc_buffer_size;
-int audio_isoc_framesperdesc;
+ int audio_interface;
+ int audio_altsetting_on;
+ int audio_altsetting_off;
+ int audio_endpointnumber;
+ int audio_isoc_maxframesize;
+ int audio_isoc_buffer_size;
+ int audio_isoc_framesperdesc;
-int audio_isoc_streaming;
-int audio_idle;
-int audio_eof;
-int volume;
-int mute;
+ int audio_isoc_streaming;
+ int audio_idle;
+ int audio_eof;
+ int volume;
+ int mute;
+ s8 gain;
-struct data_buffer audio_isoc_buffer[AUDIO_ISOC_BUFFER_MANY];
+ struct data_buffer audio_isoc_buffer[AUDIO_ISOC_BUFFER_MANY];
-struct list_head urb_audio_head;
-struct list_head *purb_audio_head;
+ struct list_head urb_audio_head;
+ struct list_head *purb_audio_head;
/*---------------------------------------------------------------------------*/
/*
* BUFFER INDICATORS
*/
/*---------------------------------------------------------------------------*/
-int audio_fill; /* Audio buffer being filled by easysnd_complete(). */
- /* Bumped only by easysnd_complete(). */
-int audio_read; /* Audio buffer page being read by easysnd_read(). */
- /* Set by easysnd_read() to trail audio_fill by */
+ int audio_fill; /* Audio buffer being filled by easycap_complete(). */
+ /* Bumped only by easycap_complete(). */
+ int audio_read; /* Audio buffer page being read by easycap_read(). */
+ /* Set by easycap_read() to trail audio_fill by */
/* one fragment. */
/*---------------------------------------------------------------------------*/
/*
@@ -467,61 +469,36 @@ int audio_read; /* Audio buffer page being read by easysnd_read(). */
*/
/*---------------------------------------------------------------------------*/
-int audio_buffer_many;
+ int audio_buffer_many;
-int allocation_audio_urb;
-int allocation_audio_page;
-int allocation_audio_struct;
-int registered_audio;
+ int allocation_audio_urb;
+ int allocation_audio_page;
+ int allocation_audio_struct;
+ int registered_audio;
-long long int audio_sample;
-long long int audio_niveau;
-long long int audio_square;
+ long long int audio_sample;
+ long long int audio_niveau;
+ long long int audio_square;
-struct data_buffer audio_buffer[];
+ struct data_buffer audio_buffer[];
};
/*---------------------------------------------------------------------------*/
/*
* VIDEO FUNCTION PROTOTYPES
*/
-/*---------------------------------------------------------------------------*/
-void easycap_complete(struct urb *);
-int easycap_open(struct inode *, struct file *);
-int easycap_release(struct inode *, struct file *);
-long easycap_ioctl_noinode(struct file *, unsigned int, \
- unsigned long);
-int easycap_ioctl(struct inode *, struct file *, unsigned int, \
- unsigned long);
-/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
-#if defined(EASYCAP_IS_VIDEODEV_CLIENT)
-int easycap_open_noinode(struct file *);
-int easycap_release_noinode(struct file *);
-int videodev_release(struct video_device *);
-#endif /*EASYCAP_IS_VIDEODEV_CLIENT*/
/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
-
-unsigned int easycap_poll(struct file *, poll_table *);
-int easycap_mmap(struct file *, struct vm_area_struct *);
-int easycap_usb_probe(struct usb_interface *, \
- const struct usb_device_id *);
-void easycap_usb_disconnect(struct usb_interface *);
-void easycap_delete(struct kref *);
-
-void easycap_vma_open(struct vm_area_struct *);
-void easycap_vma_close(struct vm_area_struct *);
-int easycap_vma_fault(struct vm_area_struct *, struct vm_fault *);
+long easycap_unlocked_ioctl(struct file *, unsigned int, unsigned long);
int easycap_dqbuf(struct easycap *, int);
int submit_video_urbs(struct easycap *);
int kill_video_urbs(struct easycap *);
int field2frame(struct easycap *);
-int redaub(struct easycap *, void *, void *, \
- int, int, __u8, __u8, bool);
+int redaub(struct easycap *, void *, void *,
+ int, int, u8, u8, bool);
void easycap_testcard(struct easycap *, int);
int fillin_formats(void);
-int reset(struct easycap *);
int newinput(struct easycap *, int);
int adjust_standard(struct easycap *, v4l2_std_id);
-int adjust_format(struct easycap *, __u32, __u32, __u32, \
+int adjust_format(struct easycap *, u32, u32, u32,
int, bool);
int adjust_brightness(struct easycap *, int);
int adjust_contrast(struct easycap *, int);
@@ -533,19 +510,17 @@ int adjust_volume(struct easycap *, int);
* AUDIO FUNCTION PROTOTYPES
*/
/*---------------------------------------------------------------------------*/
-void easysnd_complete(struct urb *);
-ssize_t easysnd_read(struct file *, char __user *, size_t, loff_t *);
-int easysnd_open(struct inode *, struct file *);
-int easysnd_release(struct inode *, struct file *);
-long easysnd_ioctl_noinode(struct file *, unsigned int, \
- unsigned long);
-int easysnd_ioctl(struct inode *, struct file *, unsigned int, \
- unsigned long);
-unsigned int easysnd_poll(struct file *, poll_table *);
-void easysnd_delete(struct kref *);
+#ifndef CONFIG_EASYCAP_OSS
+int easycap_alsa_probe(struct easycap *);
+void easycap_alsa_complete(struct urb *);
+#else /* CONFIG_EASYCAP_OSS */
+void easyoss_complete(struct urb *);
+#endif /* !CONFIG_EASYCAP_OSS */
+
+int easycap_sound_setup(struct easycap *);
int submit_audio_urbs(struct easycap *);
int kill_audio_urbs(struct easycap *);
-void easysnd_testtone(struct easycap *, int);
+void easyoss_testtone(struct easycap *, int);
int audio_setup(struct easycap *);
/*---------------------------------------------------------------------------*/
/*
@@ -553,9 +528,9 @@ int audio_setup(struct easycap *);
*/
/*---------------------------------------------------------------------------*/
int audio_gainget(struct usb_device *);
-int audio_gainset(struct usb_device *, __s8);
+int audio_gainset(struct usb_device *, s8);
-int set_interface(struct usb_device *, __u16);
+int set_interface(struct usb_device *, u16);
int wakeup_device(struct usb_device *);
int confirm_resolution(struct usb_device *);
int confirm_stream(struct usb_device *);
@@ -569,48 +544,26 @@ int ready_saa(struct usb_device *);
int merit_saa(struct usb_device *);
int check_vt(struct usb_device *);
int select_input(struct usb_device *, int, int);
-int set_resolution(struct usb_device *, \
- __u16, __u16, __u16, __u16);
-
-int read_saa(struct usb_device *, __u16);
-int read_stk(struct usb_device *, __u32);
-int write_saa(struct usb_device *, __u16, __u16);
-int wait_i2c(struct usb_device *);
-int write_000(struct usb_device *, __u16, __u16);
+int set_resolution(struct usb_device *,
+ u16, u16, u16, u16);
+
+int read_saa(struct usb_device *, u16);
+int read_stk(struct usb_device *, u32);
+int write_saa(struct usb_device *, u16, u16);
+int write_000(struct usb_device *, u16, u16);
int start_100(struct usb_device *);
int stop_100(struct usb_device *);
int write_300(struct usb_device *);
-int read_vt(struct usb_device *, __u16);
-int write_vt(struct usb_device *, __u16, __u16);
-int regset(struct usb_device *, __u16, __u16);
-int regget(struct usb_device *, __u16, void *);
+int read_vt(struct usb_device *, u16);
+int write_vt(struct usb_device *, u16, u16);
int isdongle(struct easycap *);
/*---------------------------------------------------------------------------*/
struct signed_div_result {
-long long int quotient;
-unsigned long long int remainder;
+ long long int quotient;
+ unsigned long long int remainder;
} signed_div(long long int, long long int);
-/*---------------------------------------------------------------------------*/
-/*
- * MACROS
- */
-/*---------------------------------------------------------------------------*/
-#define GET(X, Y, Z) do { \
- int rc; \
- *(Z) = (__u16)0; \
- rc = regget(X, Y, Z); \
- if (0 > rc) { \
- JOT(8, ":-(%i\n", __LINE__); return(rc); \
- } \
-} while (0)
-#define SET(X, Y, Z) do { \
- int rc; \
- rc = regset(X, Y, Z); \
- if (0 > rc) { \
- JOT(8, ":-(%i\n", __LINE__); return(rc); \
- } \
-} while (0)
+
/*---------------------------------------------------------------------------*/
/*
* MACROS SAM(...) AND JOM(...) ALLOW DIAGNOSTIC OUTPUT TO BE TAGGED WITH
@@ -619,6 +572,8 @@ unsigned long long int remainder;
* IMMEDIATELY OBVIOUS FROM A CASUAL READING OF THE SOURCE CODE. BEWARE.
*/
/*---------------------------------------------------------------------------*/
+const char *strerror(int err);
+
#define SAY(format, args...) do { \
printk(KERN_DEBUG "easycap:: %s: " \
format, __func__, ##args); \
@@ -628,7 +583,8 @@ unsigned long long int remainder;
format, peasycap->isdongle, __func__, ##args);\
} while (0)
-#if defined(EASYCAP_DEBUG)
+#ifdef CONFIG_EASYCAP_DEBUG
+extern int easycap_debug;
#define JOT(n, format, args...) do { \
if (n <= easycap_debug) { \
printk(KERN_DEBUG "easycap:: %s: " \
@@ -645,7 +601,7 @@ unsigned long long int remainder;
#else
#define JOT(n, format, args...) do {} while (0)
#define JOM(n, format, args...) do {} while (0)
-#endif /*EASYCAP_DEBUG*/
+#endif /* CONFIG_EASYCAP_DEBUG */
#define MICROSECONDS(X, Y) \
((1000000*((long long int)(X.tv_sec - Y.tv_sec))) + \
@@ -677,4 +633,19 @@ unsigned long long int remainder;
} while (0)
/*---------------------------------------------------------------------------*/
-#endif /*EASYCAP_H*/
+/*---------------------------------------------------------------------------*/
+/* globals
+ */
+/*---------------------------------------------------------------------------*/
+
+extern bool easycap_readback;
+extern const struct easycap_standard easycap_standard[];
+extern struct easycap_format easycap_format[];
+extern struct v4l2_queryctrl easycap_control[];
+extern struct usb_driver easycap_usb_driver;
+extern struct easycap_dongle easycapdc60_dongle[];
+#ifdef CONFIG_EASYCAP_OSS
+extern struct usb_class_driver easyoss_class;
+#endif /* !CONFIG_EASYCAP_OSS */
+
+#endif /* !__EASYCAP_H__ */