Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 235709
b: refs/heads/master
c: 0edbc24
h: refs/heads/master
i:
  235707: 0e08cb7
v: v3
  • Loading branch information
Tomas Winkler authored and Greg Kroah-Hartman committed Jan 24, 2011
1 parent 45a02db commit 8dab757
Show file tree
Hide file tree
Showing 8 changed files with 790 additions and 743 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5c0c6c395ea8ad2f831c0717f67f957ba84550ad
refs/heads/master: 0edbc24c5dc7fba0dce193f7d4b7faf2ad211ba4
14 changes: 13 additions & 1 deletion trunk/drivers/staging/easycap/Kconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
config EASYCAP
tristate "EasyCAP USB ID 05e1:0408 support"
depends on USB && VIDEO_DEV && SND
depends on USB && VIDEO_DEV && SOUND

---help---
This is an integrated audio/video driver for EasyCAP cards with
Expand All @@ -15,6 +15,18 @@ config EASYCAP
To compile this driver as a module, choose M here: the
module will be called easycap

config EASYCAP_OSS
bool "OSS (DEPRECATED)"
depends on EASYCAP && SOUND_OSS_CORE

---help---
Say 'Y' if you prefer Open Sound System (OSS) interface

This will disable Advanced Linux Sound Architecture (ALSA) binding.

Once binding to ALSA interface will be stable this option will be
removed.

config EASYCAP_DEBUG
bool "Enable EasyCAP driver debugging"
depends on EASYCAP
Expand Down
10 changes: 7 additions & 3 deletions trunk/drivers/staging/easycap/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
easycap-objs := easycap_main.o easycap_low.o easycap_sound.o \
easycap_ioctl.o easycap_settings.o easycap_testcard.o
easycap-objs := easycap_main.o
easycap-objs += easycap_low.o
easycap-objs += easycap_ioctl.o
easycap-objs += easycap_settings.o
easycap-objs += easycap_testcard.o
easycap-objs += easycap_sound.o
easycap-$(CONFIG_EASYCAP_OSS) += easycap_sound_oss.o

obj-$(CONFIG_EASYCAP) += easycap.o

Expand All @@ -8,5 +13,4 @@ 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

25 changes: 13 additions & 12 deletions trunk/drivers/staging/easycap/easycap.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@
*/
/*---------------------------------------------------------------------------*/
#undef EASYCAP_TESTCARD
#if (!defined(EASYCAP_NEEDS_ALSA))
#ifdef CONFIG_EASYCAP_OSS
#undef EASYCAP_TESTTONE
#endif /*EASYCAP_NEEDS_ALSA*/
#endif /* CONFIG_EASYCAP_OSS */
/*---------------------------------------------------------------------------*/
#include <linux/kernel.h>
#include <linux/errno.h>
Expand All @@ -81,7 +81,7 @@
#include <linux/delay.h>
#include <linux/types.h>

#if defined(EASYCAP_NEEDS_ALSA)
#ifndef CONFIG_EASYCAP_OSS
#include <linux/vmalloc.h>
#include <linux/sound.h>
#include <sound/core.h>
Expand All @@ -90,7 +90,7 @@
#include <sound/info.h>
#include <sound/initval.h>
#include <sound/control.h>
#endif /*EASYCAP_NEEDS_ALSA*/
#endif /* !CONFIG_EASYCAP_OSS */
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
#if defined(EASYCAP_IS_VIDEODEV_CLIENT)
#include <media/v4l2-dev.h>
Expand Down Expand Up @@ -445,15 +445,15 @@ __s16 oldaudio;
* ALSA
*/
/*---------------------------------------------------------------------------*/
#if defined(EASYCAP_NEEDS_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 /*EASYCAP_NEEDS_ALSA*/
#endif /* !CONFIG_EASYCAP_OSS */
/*---------------------------------------------------------------------------*/
/*
* SOUND PROPERTIES
Expand Down Expand Up @@ -537,7 +537,7 @@ int adjust_volume(struct easycap *, int);
* AUDIO FUNCTION PROTOTYPES
*/
/*---------------------------------------------------------------------------*/
#if defined(EASYCAP_NEEDS_ALSA)
#ifndef CONFIG_EASYCAP_OSS
int easycap_alsa_probe(struct easycap *);

void easycap_alsa_complete(struct urb *);
Expand All @@ -553,7 +553,7 @@ 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
#else /* CONFIG_EASYCAP_OSS */
void easyoss_complete(struct urb *);
ssize_t easyoss_read(struct file *, char __user *, size_t, loff_t *);
int easyoss_open(struct inode *, struct file *);
Expand All @@ -564,7 +564,8 @@ int easyoss_ioctl(struct inode *, struct file *, unsigned int,
unsigned long);
unsigned int easyoss_poll(struct file *, poll_table *);
void easyoss_delete(struct kref *);
#endif /*EASYCAP_NEEDS_ALSA*/
#endif /* !CONFIG_EASYCAP_OSS */

int easycap_sound_setup(struct easycap *);
int submit_audio_urbs(struct easycap *);
int kill_audio_urbs(struct easycap *);
Expand Down Expand Up @@ -715,13 +716,13 @@ 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[];
#if defined(EASYCAP_NEEDS_ALSA)
#ifndef CONFIG_EASYCAP_OSS
extern struct snd_pcm_ops easycap_alsa_ops;
extern struct snd_pcm_hardware easycap_pcm_hardware;
extern struct snd_card *psnd_card;
#else
#else /* CONFIG_EASYCAP_OSS */
extern struct usb_class_driver easyoss_class;
extern const struct file_operations easyoss_fops;
#endif /*EASYCAP_NEEDS_ALSA*/
#endif /* !CONFIG_EASYCAP_OSS */

#endif /* !__EASYCAP_H__ */
4 changes: 2 additions & 2 deletions trunk/drivers/staging/easycap/easycap_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -2517,7 +2517,7 @@ JOM(4, "unlocked easycapdc60_dongle[%i].mutex_video\n", kd);
return 0;
}
/*****************************************************************************/
#if !defined(EASYCAP_NEEDS_ALSA)
#ifdef CONFIG_EASYCAP_OSS
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
#if ((defined(EASYCAP_IS_VIDEODEV_CLIENT)) || \
(defined(EASYCAP_NEEDS_UNLOCKED_IOCTL)))
Expand Down Expand Up @@ -2821,6 +2821,6 @@ default: {
mutex_unlock(&easycapdc60_dongle[kd].mutex_audio);
return 0;
}
#endif /*EASYCAP_NEEDS_ALSA*/
#endif /* CONFIG_EASYCAP_OSS */
/*****************************************************************************/

36 changes: 18 additions & 18 deletions trunk/drivers/staging/easycap/easycap_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -962,7 +962,7 @@ for (k = 0; k < AUDIO_ISOC_BUFFER_MANY; k++) {
JOM(4, "easyoss_delete(): isoc audio buffers freed: %i pages\n",
m * (0x01 << AUDIO_ISOC_ORDER));
/*---------------------------------------------------------------------------*/
#if !defined(EASYCAP_NEEDS_ALSA)
#ifdef CONFIG_EASYCAP_OSS
JOM(4, "freeing audio buffers.\n");
gone = 0;
for (k = 0; k < peasycap->audio_buffer_page_many; k++) {
Expand All @@ -974,7 +974,7 @@ for (k = 0; k < peasycap->audio_buffer_page_many; k++) {
}
}
JOM(4, "easyoss_delete(): audio buffers freed: %i pages\n", gone);
#endif /*!EASYCAP_NEEDS_ALSA*/
#endif /* CONFIG_EASYCAP_OSS */
/*---------------------------------------------------------------------------*/
JOM(4, "freeing easycap structure.\n");
allocation_video_urb = peasycap->allocation_video_urb;
Expand Down Expand Up @@ -4350,7 +4350,7 @@ case 2: {
INIT_LIST_HEAD(&(peasycap->urb_audio_head));
peasycap->purb_audio_head = &(peasycap->urb_audio_head);

#if !defined(EASYCAP_NEEDS_ALSA)
#ifdef CONFIG_EASYCAP_OSS
JOM(4, "allocating an audio buffer\n");
JOM(4, ".... scattered over %i pages\n",
peasycap->audio_buffer_page_many);
Expand All @@ -4375,7 +4375,7 @@ case 2: {
peasycap->audio_fill = 0;
peasycap->audio_read = 0;
JOM(4, "allocation of audio buffer done: %i pages\n", k);
#endif /*!EASYCAP_NEEDS_ALSA*/
#endif /* CONFIG_EASYCAP_OSS */
/*---------------------------------------------------------------------------*/
JOM(4, "allocating %i isoc audio buffers of size %i\n",
AUDIO_ISOC_BUFFER_MANY, peasycap->audio_isoc_buffer_size);
Expand Down Expand Up @@ -4450,11 +4450,11 @@ case 2: {
"peasycap->audio_isoc_buffer[.].pgo;\n");
JOM(4, " purb->transfer_buffer_length = %i;\n",
peasycap->audio_isoc_buffer_size);
#if defined(EASYCAP_NEEDS_ALSA)
JOM(4, " purb->complete = easycap_alsa_complete;\n");
#else
#ifdef CONFIG_EASYCAP_OSS
JOM(4, " purb->complete = easyoss_complete;\n");
#endif /*EASYCAP_NEEDS_ALSA*/
#else /* CONFIG_EASYCAP_OSS */
JOM(4, " purb->complete = easycap_alsa_complete;\n");
#endif /* CONFIG_EASYCAP_OSS */
JOM(4, " purb->context = peasycap;\n");
JOM(4, " purb->start_frame = 0;\n");
JOM(4, " purb->number_of_packets = %i;\n",
Expand All @@ -4477,11 +4477,11 @@ case 2: {
purb->transfer_buffer = peasycap->audio_isoc_buffer[k].pgo;
purb->transfer_buffer_length =
peasycap->audio_isoc_buffer_size;
#if defined(EASYCAP_NEEDS_ALSA)
purb->complete = easycap_alsa_complete;
#else
#ifdef CONFIG_EASYCAP_OSS
purb->complete = easyoss_complete;
#endif /*EASYCAP_NEEDS_ALSA*/
#else /* CONFIG_EASYCAP_OSS */
purb->complete = easycap_alsa_complete;
#endif /* CONFIG_EASYCAP_OSS */
purb->context = peasycap;
purb->start_frame = 0;
purb->number_of_packets = peasycap->audio_isoc_framesperdesc;
Expand All @@ -4504,7 +4504,7 @@ case 2: {
* THE AUDIO DEVICE CAN BE REGISTERED NOW, AS IT IS READY.
*/
/*---------------------------------------------------------------------------*/
#if defined(EASYCAP_NEEDS_ALSA)
#ifndef CONFIG_EASYCAP_OSS
JOM(4, "initializing ALSA card\n");

rc = easycap_alsa_probe(peasycap);
Expand All @@ -4518,7 +4518,7 @@ case 2: {
(peasycap->registered_audio)++;
}

#else /*EASYCAP_NEEDS_ALSA*/
#else /* CONFIG_EASYCAP_OSS */
rc = usb_register_dev(pusb_interface, &easyoss_class);
if (0 != rc) {
SAY("ERROR: usb_register_dev() failed\n");
Expand All @@ -4536,7 +4536,7 @@ case 2: {
*/
/*---------------------------------------------------------------------------*/
SAM("easyoss attached to minor #%d\n", pusb_interface->minor);
#endif /*EASYCAP_NEEDS_ALSA*/
#endif /* CONFIG_EASYCAP_OSS */

break;
}
Expand Down Expand Up @@ -4774,7 +4774,7 @@ case 2: {
JOM(4, "locked easycapdc60_dongle[%i].mutex_audio\n", kd);
} else
SAY("ERROR: %i=kd is bad: cannot lock dongle\n", kd);
#if defined(EASYCAP_NEEDS_ALSA)
#ifndef CONFIG_EASYCAP_OSS



Expand All @@ -4786,12 +4786,12 @@ case 2: {
}


#else /*EASYCAP_NEEDS_ALSA*/
#else /* CONFIG_EASYCAP_OSS */
usb_deregister_dev(pusb_interface, &easyoss_class);
(peasycap->registered_audio)--;
JOM(4, "intf[%i]: usb_deregister_dev()\n", bInterfaceNumber);
SAM("easyoss detached from minor #%d\n", minor);
#endif /*EASYCAP_NEEDS_ALSA*/
#endif /* CONFIG_EASYCAP_OSS */

if (0 <= kd && DONGLE_MANY > kd) {
mutex_unlock(&easycapdc60_dongle[kd].mutex_audio);
Expand Down
Loading

0 comments on commit 8dab757

Please sign in to comment.