summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Thomas <rmthomas@sciolus.org>2011-01-10 18:41:11 +0000
committerGreg Kroah-Hartman <gregkh@suse.de>2011-01-21 12:25:55 -0800
commita9855917290fc40dbfd67d3ee06c190667d6c5b5 (patch)
treeb24a96d42526d681d04c6e678fe0649f4a25ba45
parentb54a28a418b2730bf61554864fee3fb24f79e182 (diff)
staging: easycap: add ALSA support
This is necessary because some distributions are disabling OSS entirely. Signed-off-by: Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/staging/easycap/Kconfig2
-rw-r--r--drivers/staging/easycap/Makefile11
-rw-r--r--drivers/staging/easycap/easycap.h84
-rw-r--r--drivers/staging/easycap/easycap_ioctl.c272
-rw-r--r--drivers/staging/easycap/easycap_ioctl.h9
-rw-r--r--drivers/staging/easycap/easycap_low.c17
-rw-r--r--drivers/staging/easycap/easycap_low.h (renamed from drivers/staging/easycap/easycap_debug.h)9
-rw-r--r--drivers/staging/easycap/easycap_main.c394
-rw-r--r--drivers/staging/easycap/easycap_main.h43
-rw-r--r--drivers/staging/easycap/easycap_settings.c2
-rw-r--r--drivers/staging/easycap/easycap_settings.h (renamed from drivers/staging/easycap/easycap_standard.h)11
-rw-r--r--drivers/staging/easycap/easycap_sound.c1214
-rw-r--r--drivers/staging/easycap/easycap_sound.h14
-rw-r--r--drivers/staging/easycap/easycap_testcard.c4
-rw-r--r--drivers/staging/easycap/easycap_testcard.h34
15 files changed, 1621 insertions, 499 deletions
diff --git a/drivers/staging/easycap/Kconfig b/drivers/staging/easycap/Kconfig
index bd96f39f2735..eaa8a86e183b 100644
--- a/drivers/staging/easycap/Kconfig
+++ b/drivers/staging/easycap/Kconfig
@@ -1,6 +1,6 @@
config EASYCAP
tristate "EasyCAP USB ID 05e1:0408 support"
- depends on USB && VIDEO_DEV
+ depends on USB && VIDEO_DEV && SND
---help---
This is an integrated audio/video driver for EasyCAP cards with
diff --git a/drivers/staging/easycap/Makefile b/drivers/staging/easycap/Makefile
index f1f2fbebf8f6..977e1535667d 100644
--- a/drivers/staging/easycap/Makefile
+++ b/drivers/staging/easycap/Makefile
@@ -1,14 +1,13 @@
+easycap-objs := easycap_main.o easycap_low.o easycap_sound.o \
+ easycap_ioctl.o easycap_settings.o easycap_testcard.o
-obj-$(CONFIG_EASYCAP) += easycap.o
-
-easycap-y := easycap_main.o easycap_low.o easycap_sound.o
-easycap-y += easycap_ioctl.o easycap_settings.o
-easycap-y += easycap_testcard.o
+obj-$(CONFIG_EASYCAP) += easycap.o
ccflags-y := -Wall
-# Impose all or none of the following:
ccflags-y += -DEASYCAP_IS_VIDEODEV_CLIENT
ccflags-y += -DEASYCAP_NEEDS_V4L2_DEVICE_H
ccflags-y += -DEASYCAP_NEEDS_V4L2_FOPS
ccflags-y += -DEASYCAP_NEEDS_UNLOCKED_IOCTL
+ccflags-y += -DEASYCAP_NEEDS_ALSA
+ccflags-y += -DEASYCAP_NEEDS_CARD_CREATE
diff --git a/drivers/staging/easycap/easycap.h b/drivers/staging/easycap/easycap.h
index 063d44718d8d..111f53c33229 100644
--- a/drivers/staging/easycap/easycap.h
+++ b/drivers/staging/easycap/easycap.h
@@ -34,6 +34,8 @@
* EASYCAP_NEEDS_V4L2_DEVICE_H
* EASYCAP_NEEDS_V4L2_FOPS
* EASYCAP_NEEDS_UNLOCKED_IOCTL
+ * EASYCAP_NEEDS_ALSA
+ * EASYCAP_SILENT
*
* IF REQUIRED THEY MUST BE EXTERNALLY DEFINED, FOR EXAMPLE AS COMPILER
* OPTIONS.
@@ -57,9 +59,9 @@
*/
/*---------------------------------------------------------------------------*/
#undef EASYCAP_TESTCARD
+#if (!defined(EASYCAP_NEEDS_ALSA))
#undef EASYCAP_TESTTONE
-#undef NOREADBACK
-#undef AUDIOTIME
+#endif /*EASYCAP_NEEDS_ALSA*/
/*---------------------------------------------------------------------------*/
#include <linux/kernel.h>
#include <linux/errno.h>
@@ -79,6 +81,16 @@
#include <linux/delay.h>
#include <linux/types.h>
+#if defined(EASYCAP_NEEDS_ALSA)
+#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 /*EASYCAP_NEEDS_ALSA*/
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
#if defined(EASYCAP_IS_VIDEODEV_CLIENT)
#include <media/v4l2-dev.h>
@@ -112,7 +124,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
@@ -158,7 +170,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)
/*---------------------------------------------------------------------------*/
/*
@@ -166,6 +179,7 @@
*/
/*---------------------------------------------------------------------------*/
#define AUDIO_FRAGMENT_MANY 32
+#define PAGES_PER_AUDIO_FRAGMENT 4
/*---------------------------------------------------------------------------*/
/*
* IT IS ESSENTIAL THAT EVEN-NUMBERED STANDARDS ARE 25 FRAMES PER SECOND,
@@ -296,6 +310,7 @@ struct easycap {
#define TELLTALE "expectedstring"
char telltale[16];
int isdongle;
+int minor;
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
#if defined(EASYCAP_IS_VIDEODEV_CLIENT)
@@ -328,6 +343,7 @@ 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;
@@ -429,6 +445,20 @@ int allocation_video_struct;
int registered_video;
/*---------------------------------------------------------------------------*/
/*
+ * ALSA
+ */
+/*---------------------------------------------------------------------------*/
+#if defined(EASYCAP_NEEDS_ALSA)
+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 /*EASYCAP_NEEDS_ALSA*/
+/*---------------------------------------------------------------------------*/
+/*
* SOUND PROPERTIES
*/
/*---------------------------------------------------------------------------*/
@@ -455,10 +485,10 @@ 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. */
/*---------------------------------------------------------------------------*/
/*
@@ -532,19 +562,39 @@ 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, \
+#if defined(EASYCAP_NEEDS_ALSA)
+int easycap_alsa_probe(struct easycap *);
+
+void easycap_alsa_complete(struct urb *);
+int easycap_alsa_open(struct snd_pcm_substream *);
+int easycap_alsa_close(struct snd_pcm_substream *);
+int easycap_alsa_hw_params(struct snd_pcm_substream *, \
+ struct snd_pcm_hw_params *);
+int easycap_alsa_vmalloc(struct snd_pcm_substream *, size_t);
+int easycap_alsa_hw_free(struct snd_pcm_substream *);
+int easycap_alsa_prepare(struct snd_pcm_substream *);
+int easycap_alsa_ack(struct snd_pcm_substream *);
+int easycap_alsa_trigger(struct snd_pcm_substream *, int);
+snd_pcm_uframes_t \
+ easycap_alsa_pointer(struct snd_pcm_substream *);
+struct page *easycap_alsa_page(struct snd_pcm_substream *, unsigned long);
+
+#else
+void easyoss_complete(struct urb *);
+ssize_t easyoss_read(struct file *, char __user *, size_t, loff_t *);
+int easyoss_open(struct inode *, struct file *);
+int easyoss_release(struct inode *, struct file *);
+long easyoss_ioctl_noinode(struct file *, unsigned int, \
unsigned long);
-int easysnd_ioctl(struct inode *, struct file *, unsigned int, \
+int easyoss_ioctl(struct inode *, struct file *, unsigned int, \
unsigned long);
-unsigned int easysnd_poll(struct file *, poll_table *);
-void easysnd_delete(struct kref *);
+unsigned int easyoss_poll(struct file *, poll_table *);
+void easyoss_delete(struct kref *);
+#endif /*EASYCAP_NEEDS_ALSA*/
+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 *);
/*---------------------------------------------------------------------------*/
/*
diff --git a/drivers/staging/easycap/easycap_ioctl.c b/drivers/staging/easycap/easycap_ioctl.c
index 447953a4e80c..20d30334233e 100644
--- a/drivers/staging/easycap/easycap_ioctl.c
+++ b/drivers/staging/easycap/easycap_ioctl.c
@@ -27,8 +27,6 @@
#include <linux/smp_lock.h>
#include "easycap.h"
-#include "easycap_debug.h"
-#include "easycap_standard.h"
#include "easycap_ioctl.h"
/*--------------------------------------------------------------------------*/
@@ -910,7 +908,7 @@ return -ENOENT;
* peasycap->audio_interface, \
* peasycap->audio_altsetting_off);
* HOWEVER, AFTER THIS COMMAND IS ISSUED ALL SUBSEQUENT URBS RECEIVE STATUS
- * -ESHUTDOWN. THE HANDLER ROUTINE easysnd_complete() DECLINES TO RESUBMIT
+ * -ESHUTDOWN. THE HANDLER ROUTINE easyxxx_complete() DECLINES TO RESUBMIT
* THE URB AND THE PIPELINE COLLAPSES IRRETRIEVABLY. BEWARE.
*/
/*---------------------------------------------------------------------------*/
@@ -991,11 +989,12 @@ if (NULL == p) {
}
kd = isdongle(peasycap);
if (0 <= kd && DONGLE_MANY > kd) {
- if (mutex_lock_interruptible(&easycap_dongle[kd].mutex_video)) {
- SAY("ERROR: cannot lock easycap_dongle[%i].mutex_video\n", kd);
+ if (mutex_lock_interruptible(&easycapdc60_dongle[kd].mutex_video)) {
+ SAY("ERROR: cannot lock " \
+ "easycapdc60_dongle[%i].mutex_video\n", kd);
return -ERESTARTSYS;
}
- JOM(4, "locked easycap_dongle[%i].mutex_video\n", kd);
+ JOM(4, "locked easycapdc60_dongle[%i].mutex_video\n", kd);
/*---------------------------------------------------------------------------*/
/*
* MEANWHILE, easycap_usb_disconnect() MAY HAVE FREED POINTER peasycap,
@@ -1007,24 +1006,24 @@ if (0 <= kd && DONGLE_MANY > kd) {
return -ERESTARTSYS;
if (NULL == file) {
SAY("ERROR: file is NULL\n");
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -ERESTARTSYS;
}
peasycap = file->private_data;
if (NULL == peasycap) {
SAY("ERROR: peasycap is NULL\n");
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -ERESTARTSYS;
}
if (memcmp(&peasycap->telltale[0], TELLTALE, strlen(TELLTALE))) {
SAY("ERROR: bad peasycap\n");
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
}
p = peasycap->pusb_device;
if (NULL == peasycap->pusb_device) {
SAM("ERROR: peasycap->pusb_device is NULL\n");
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -ERESTARTSYS;
}
} else {
@@ -1048,7 +1047,7 @@ case VIDIOC_QUERYCAP: {
if (16 <= strlen(EASYCAP_DRIVER_VERSION)) {
SAM("ERROR: bad driver version string\n");
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EINVAL;
}
strcpy(&version[0], EASYCAP_DRIVER_VERSION);
@@ -1066,7 +1065,8 @@ case VIDIOC_QUERYCAP: {
if (0 != rc) {
SAM("ERROR: %i=strict_strtol(%s,.,,)\n", \
rc, p1);
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].\
+ mutex_video);
return -EINVAL;
}
k[i] = (int)lng;
@@ -1097,7 +1097,7 @@ case VIDIOC_QUERYCAP: {
}
if (0 != copy_to_user((void __user *)arg, &v4l2_capability, \
sizeof(struct v4l2_capability))) {
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
}
break;
@@ -1111,7 +1111,7 @@ case VIDIOC_ENUMINPUT: {
if (0 != copy_from_user(&v4l2_input, (void __user *)arg, \
sizeof(struct v4l2_input))) {
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
}
@@ -1193,14 +1193,14 @@ case VIDIOC_ENUMINPUT: {
}
default: {
JOM(8, "%i=index: exhausts inputs\n", index);
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EINVAL;
}
}
if (0 != copy_to_user((void __user *)arg, &v4l2_input, \
sizeof(struct v4l2_input))) {
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
}
break;
@@ -1213,7 +1213,7 @@ case VIDIOC_G_INPUT: {
index = (__u32)peasycap->input;
JOM(8, "user is told: %i\n", index);
if (0 != copy_to_user((void __user *)arg, &index, sizeof(__u32))) {
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
}
break;
@@ -1227,7 +1227,7 @@ case VIDIOC_S_INPUT:
JOM(8, "VIDIOC_S_INPUT\n");
if (0 != copy_from_user(&index, (void __user *)arg, sizeof(__u32))) {
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
}
@@ -1240,7 +1240,7 @@ case VIDIOC_S_INPUT:
if ((0 > index) || (INPUT_MANY <= index)) {
JOM(8, "ERROR: bad requested input: %i\n", index);
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EINVAL;
}
@@ -1249,7 +1249,7 @@ case VIDIOC_S_INPUT:
JOM(8, "newinput(.,%i) OK\n", (int)index);
} else {
SAM("ERROR: newinput(.,%i) returned %i\n", (int)index, rc);
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
}
break;
@@ -1257,7 +1257,7 @@ case VIDIOC_S_INPUT:
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
case VIDIOC_ENUMAUDIO: {
JOM(8, "VIDIOC_ENUMAUDIO\n");
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EINVAL;
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
@@ -1268,12 +1268,12 @@ case VIDIOC_ENUMAUDOUT: {
if (0 != copy_from_user(&v4l2_audioout, (void __user *)arg, \
sizeof(struct v4l2_audioout))) {
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
}
if (0 != v4l2_audioout.index) {
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EINVAL;
}
memset(&v4l2_audioout, 0, sizeof(struct v4l2_audioout));
@@ -1282,7 +1282,7 @@ case VIDIOC_ENUMAUDOUT: {
if (0 != copy_to_user((void __user *)arg, &v4l2_audioout, \
sizeof(struct v4l2_audioout))) {
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
}
break;
@@ -1296,7 +1296,7 @@ case VIDIOC_QUERYCTRL: {
if (0 != copy_from_user(&v4l2_queryctrl, (void __user *)arg, \
sizeof(struct v4l2_queryctrl))) {
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
}
@@ -1313,12 +1313,12 @@ case VIDIOC_QUERYCTRL: {
}
if (0xFFFFFFFF == easycap_control[i1].id) {
JOM(8, "%i=index: exhausts controls\n", i1);
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EINVAL;
}
if (0 != copy_to_user((void __user *)arg, &v4l2_queryctrl, \
sizeof(struct v4l2_queryctrl))) {
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
}
break;
@@ -1326,7 +1326,7 @@ case VIDIOC_QUERYCTRL: {
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
case VIDIOC_QUERYMENU: {
JOM(8, "VIDIOC_QUERYMENU unsupported\n");
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EINVAL;
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
@@ -1337,13 +1337,13 @@ case VIDIOC_G_CTRL: {
pv4l2_control = kzalloc(sizeof(struct v4l2_control), GFP_KERNEL);
if (!pv4l2_control) {
SAM("ERROR: out of memory\n");
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -ENOMEM;
}
if (0 != copy_from_user(pv4l2_control, (void __user *)arg, \
sizeof(struct v4l2_control))) {
kfree(pv4l2_control);
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
}
@@ -1385,14 +1385,14 @@ case VIDIOC_G_CTRL: {
SAM("ERROR: unknown V4L2 control: 0x%08X=id\n", \
pv4l2_control->id);
kfree(pv4l2_control);
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EINVAL;
}
}
if (0 != copy_to_user((void __user *)arg, pv4l2_control, \
sizeof(struct v4l2_control))) {
kfree(pv4l2_control);
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
}
kfree(pv4l2_control);
@@ -1412,7 +1412,7 @@ case VIDIOC_S_CTRL:
if (0 != copy_from_user(&v4l2_control, (void __user *)arg, \
sizeof(struct v4l2_control))) {
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
}
@@ -1463,7 +1463,7 @@ case VIDIOC_S_CTRL:
default: {
SAM("ERROR: unknown V4L2 control: 0x%08X=id\n", \
v4l2_control.id);
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EINVAL;
}
}
@@ -1472,7 +1472,7 @@ case VIDIOC_S_CTRL:
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
case VIDIOC_S_EXT_CTRLS: {
JOM(8, "VIDIOC_S_EXT_CTRLS unsupported\n");
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EINVAL;
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
@@ -1484,7 +1484,7 @@ case VIDIOC_ENUM_FMT: {
if (0 != copy_from_user(&v4l2_fmtdesc, (void __user *)arg, \
sizeof(struct v4l2_fmtdesc))) {
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
}
@@ -1539,13 +1539,13 @@ case VIDIOC_ENUM_FMT: {
}
default: {
JOM(8, "%i=index: exhausts formats\n", index);
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EINVAL;
}
}
if (0 != copy_to_user((void __user *)arg, &v4l2_fmtdesc, \
sizeof(struct v4l2_fmtdesc))) {
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
}
break;
@@ -1564,7 +1564,7 @@ case VIDIOC_ENUM_FRAMESIZES: {
if (0 != copy_from_user(&v4l2_frmsizeenum, (void __user *)arg, \
sizeof(struct v4l2_frmsizeenum))) {
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
}
@@ -1616,7 +1616,7 @@ case VIDIOC_ENUM_FRAMESIZES: {
}
default: {
JOM(8, "%i=index: exhausts framesizes\n", index);
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EINVAL;
}
}
@@ -1674,14 +1674,14 @@ case VIDIOC_ENUM_FRAMESIZES: {
}
default: {
JOM(8, "%i=index: exhausts framesizes\n", index);
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EINVAL;
}
}
}
if (0 != copy_to_user((void __user *)arg, &v4l2_frmsizeenum, \
sizeof(struct v4l2_frmsizeenum))) {
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
}
break;
@@ -1710,7 +1710,7 @@ case VIDIOC_ENUM_FRAMEINTERVALS: {
if (0 != copy_from_user(&v4l2_frmivalenum, (void __user *)arg, \
sizeof(struct v4l2_frmivalenum))) {
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
}
@@ -1737,13 +1737,13 @@ case VIDIOC_ENUM_FRAMEINTERVALS: {
}
default: {
JOM(8, "%i=index: exhausts frameintervals\n", index);
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EINVAL;
}
}
if (0 != copy_to_user((void __user *)arg, &v4l2_frmivalenum, \
sizeof(struct v4l2_frmivalenum))) {
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
}
break;
@@ -1757,28 +1757,28 @@ case VIDIOC_G_FMT: {
pv4l2_format = kzalloc(sizeof(struct v4l2_format), GFP_KERNEL);
if (!pv4l2_format) {
SAM("ERROR: out of memory\n");
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -ENOMEM;
}
pv4l2_pix_format = kzalloc(sizeof(struct v4l2_pix_format), GFP_KERNEL);
if (!pv4l2_pix_format) {
SAM("ERROR: out of memory\n");
kfree(pv4l2_format);
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -ENOMEM;
}
if (0 != copy_from_user(pv4l2_format, (void __user *)arg, \
sizeof(struct v4l2_format))) {
kfree(pv4l2_format);
kfree(pv4l2_pix_format);
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
}
if (pv4l2_format->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) {
kfree(pv4l2_format);
kfree(pv4l2_pix_format);
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EINVAL;
}
@@ -1794,7 +1794,7 @@ case VIDIOC_G_FMT: {
sizeof(struct v4l2_format))) {
kfree(pv4l2_format);
kfree(pv4l2_pix_format);
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
}
kfree(pv4l2_format);
@@ -1819,7 +1819,7 @@ case VIDIOC_S_FMT: {
if (0 != copy_from_user(&v4l2_format, (void __user *)arg, \
sizeof(struct v4l2_format))) {
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
}
@@ -1831,11 +1831,11 @@ case VIDIOC_S_FMT: {
try);
if (0 > best_format) {
if (-EBUSY == best_format) {
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EBUSY;
}
JOM(8, "WARNING: adjust_format() returned %i\n", best_format);
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -ENOENT;
}
/*...........................................................................*/
@@ -1848,7 +1848,7 @@ case VIDIOC_S_FMT: {
if (0 != copy_to_user((void __user *)arg, &v4l2_format, \
sizeof(struct v4l2_format))) {
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
}
break;
@@ -1861,7 +1861,7 @@ case VIDIOC_CROPCAP: {
if (0 != copy_from_user(&v4l2_cropcap, (void __user *)arg, \
sizeof(struct v4l2_cropcap))) {
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
}
@@ -1885,7 +1885,7 @@ case VIDIOC_CROPCAP: {
if (0 != copy_to_user((void __user *)arg, &v4l2_cropcap, \
sizeof(struct v4l2_cropcap))) {
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
}
break;
@@ -1894,14 +1894,14 @@ case VIDIOC_CROPCAP: {
case VIDIOC_G_CROP:
case VIDIOC_S_CROP: {
JOM(8, "VIDIOC_G_CROP|VIDIOC_S_CROP unsupported\n");
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EINVAL;
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
case VIDIOC_QUERYSTD: {
JOM(8, "VIDIOC_QUERYSTD: " \
"EasyCAP is incapable of detecting standard\n");
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EINVAL;
break;
}
@@ -1923,7 +1923,7 @@ case VIDIOC_ENUMSTD: {
if (0 != copy_from_user(&v4l2_standard, (void __user *)arg, \
sizeof(struct v4l2_standard))) {
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
}
index = v4l2_standard.index;
@@ -1945,7 +1945,7 @@ case VIDIOC_ENUMSTD: {
}
if (0xFFFF == peasycap_standard->mask) {
JOM(8, "%i=index: exhausts standards\n", index);
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EINVAL;
}
JOM(8, "%i=index: %s\n", index, \
@@ -1957,7 +1957,7 @@ case VIDIOC_ENUMSTD: {
if (0 != copy_to_user((void __user *)arg, &v4l2_standard, \
sizeof(struct v4l2_standard))) {
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
}
break;
@@ -1972,13 +1972,13 @@ case VIDIOC_G_STD: {
if (0 > peasycap->standard_offset) {
JOM(8, "%i=peasycap->standard_offset\n", \
peasycap->standard_offset);
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EBUSY;
}
if (0 != copy_from_user(&std_id, (void __user *)arg, \
sizeof(v4l2_std_id))) {
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
}
@@ -1990,7 +1990,7 @@ case VIDIOC_G_STD: {
if (0 != copy_to_user((void __user *)arg, &std_id, \
sizeof(v4l2_std_id))) {
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
}
break;
@@ -2004,7 +2004,7 @@ case VIDIOC_S_STD: {
if (0 != copy_from_user(&std_id, (void __user *)arg, \
sizeof(v4l2_std_id))) {
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
}
@@ -2015,7 +2015,7 @@ case VIDIOC_S_STD: {
rc = adjust_standard(peasycap, std_id);
if (0 > rc) {
JOM(8, "WARNING: adjust_standard() returned %i\n", rc);
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -ENOENT;
}
break;
@@ -2029,16 +2029,16 @@ case VIDIOC_REQBUFS: {
if (0 != copy_from_user(&v4l2_requestbuffers, (void __user *)arg, \
sizeof(struct v4l2_requestbuffers))) {
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
}
if (v4l2_requestbuffers.type != V4L2_BUF_TYPE_VIDEO_CAPTURE) {
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EINVAL;
}
if (v4l2_requestbuffers.memory != V4L2_MEMORY_MMAP) {
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EINVAL;
}
nbuffers = v4l2_requestbuffers.count;
@@ -2059,7 +2059,7 @@ case VIDIOC_REQBUFS: {
if (0 != copy_to_user((void __user *)arg, &v4l2_requestbuffers, \
sizeof(struct v4l2_requestbuffers))) {
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
}
break;
@@ -2074,18 +2074,18 @@ case VIDIOC_QUERYBUF: {
if (peasycap->video_eof) {
JOM(8, "returning -EIO because %i=video_eof\n", \
peasycap->video_eof);
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EIO;
}
if (0 != copy_from_user(&v4l2_buffer, (void __user *)arg, \
sizeof(struct v4l2_buffer))) {
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
}
if (v4l2_buffer.type != V4L2_BUF_TYPE_VIDEO_CAPTURE) {
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EINVAL;
}
index = v4l2_buffer.index;
@@ -2117,7 +2117,7 @@ case VIDIOC_QUERYBUF: {
if (0 != copy_to_user((void __user *)arg, &v4l2_buffer, \
sizeof(struct v4l2_buffer))) {
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
}
break;
@@ -2130,21 +2130,21 @@ case VIDIOC_QBUF: {
if (0 != copy_from_user(&v4l2_buffer, (void __user *)arg, \
sizeof(struct v4l2_buffer))) {
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
}
if (v4l2_buffer.type != V4L2_BUF_TYPE_VIDEO_CAPTURE) {
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EINVAL;
}
if (v4l2_buffer.memory != V4L2_MEMORY_MMAP) {
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EINVAL;
}
if (v4l2_buffer.index < 0 || \
(v4l2_buffer.index >= peasycap->frame_buffer_many)) {
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EINVAL;
}
v4l2_buffer.flags = V4L2_BUF_FLAG_MAPPED | V4L2_BUF_FLAG_QUEUED;
@@ -2154,7 +2154,7 @@ case VIDIOC_QBUF: {
if (0 != copy_to_user((void __user *)arg, &v4l2_buffer, \
sizeof(struct v4l2_buffer))) {
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
}
@@ -2187,18 +2187,18 @@ case VIDIOC_DQBUF:
JOM(8, "returning -EIO because " \
"%i=video_idle %i=video_eof\n", \
peasycap->video_idle, peasycap->video_eof);
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EIO;
}
if (0 != copy_from_user(&v4l2_buffer, (void __user *)arg, \
sizeof(struct v4l2_buffer))) {
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
}
if (v4l2_buffer.type != V4L2_BUF_TYPE_VIDEO_CAPTURE) {
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EINVAL;
}
@@ -2222,7 +2222,7 @@ case VIDIOC_DQBUF:
if (!peasycap->video_isoc_streaming) {
JOM(16, "returning -EIO because video urbs not streaming\n");
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EIO;
}
/*---------------------------------------------------------------------------*/
@@ -2239,18 +2239,19 @@ case VIDIOC_DQBUF:
if (-EIO == rcdq) {
JOM(8, "returning -EIO because " \
"dqbuf() returned -EIO\n");
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].\
+ mutex_video);
return -EIO;
}
} while (0 != rcdq);
} else {
if (peasycap->video_eof) {
- mutex_unlock(&easycap_dongle[kd].mutex_video);
+ mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EIO;
}
}
if (V4L2_BUF_FLAG_DONE != peasycap->done[peasycap->frame_read]) {
- SAM("ERROR: V4L2_BUF_FLAG_DONE != 0x%08X\n", \
+ JOM(8, "V4L2_BUF_FLAG_DONE != 0x%08X\n", \
peasycap->done[peasycap->frame_read]);
}
peasycap->polled = 0;
@@ -2337,7 +2338,7 @@ case VIDIOC_DQBUF:
if (0 != copy_to_user((void __user *)arg, &v4l2_buffer, \
sizeof(struct v4l2_buffer))) {