Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 260029
b: refs/heads/master
c: 7301928
h: refs/heads/master
i:
  260027: f72e8c0
v: v3
  • Loading branch information
Tomas Winkler authored and Greg Kroah-Hartman committed Jul 8, 2011
1 parent 8519864 commit 8be62f4
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 1,101 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: 808a3b5f9b1deb7e449765192a0315e2da904553
refs/heads/master: 73019286cddc8bba1773944a7b6b603137fd66ff
32 changes: 2 additions & 30 deletions trunk/drivers/staging/easycap/Kconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
config EASYCAP
tristate "EasyCAP USB ID 05e1:0408 support"
depends on USB && VIDEO_DEV && (SND || SOUND_OSS_CORE)
depends on USB && VIDEO_DEV && SND
select SND_PCM

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

choice
prompt "Sound Interface"
depends on EASYCAP
default EASYCAP_SND
---help---

config EASYCAP_SND
bool "ALSA"
depends on SND
select SND_PCM

---help---
Say 'Y' if you want to use ALSA interface

This will disable Open Sound System (OSS) binding.

config EASYCAP_OSS
bool "OSS (DEPRECATED)"
depends on 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.
endchoice

config EASYCAP_DEBUG
bool "Enable EasyCAP driver debugging"
depends on EASYCAP
Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/staging/easycap/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ 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
obj-$(CONFIG_EASYCAP) += easycap.o

ccflags-y := -Wall

35 changes: 0 additions & 35 deletions trunk/drivers/staging/easycap/easycap.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
#include <linux/delay.h>
#include <linux/types.h>

#ifndef CONFIG_EASYCAP_OSS
#include <linux/vmalloc.h>
#include <linux/sound.h>
#include <sound/core.h>
Expand All @@ -78,7 +77,6 @@
#include <sound/info.h>
#include <sound/initval.h>
#include <sound/control.h>
#endif /* !CONFIG_EASYCAP_OSS */
#include <media/v4l2-dev.h>
#include <media/v4l2-device.h>
#include <linux/videodev2.h>
Expand Down Expand Up @@ -413,15 +411,13 @@ struct easycap {
* 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
Expand Down Expand Up @@ -503,12 +499,8 @@ int adjust_volume(struct easycap *, int);
* AUDIO FUNCTION PROTOTYPES
*/
/*---------------------------------------------------------------------------*/
#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 *);
Expand Down Expand Up @@ -596,30 +588,6 @@ extern int easycap_debug;
#define JOM(n, format, args...) do {} while (0)
#endif /* CONFIG_EASYCAP_DEBUG */

/*---------------------------------------------------------------------------*/
/*
* (unsigned char *)P pointer to next byte pair
* (long int *)X pointer to accumulating count
* (long int *)Y pointer to accumulating sum
* (long long int *)Z pointer to accumulating sum of squares
*/
/*---------------------------------------------------------------------------*/
#define SUMMER(P, X, Y, Z) do { \
unsigned char *p; \
unsigned int u0, u1, u2; \
long int s; \
p = (unsigned char *)(P); \
u0 = (unsigned int) (*p); \
u1 = (unsigned int) (*(p + 1)); \
u2 = (unsigned int) ((u1 << 8) | u0); \
if (0x8000 & u2) \
s = -(long int)(0x7FFF & (~u2)); \
else \
s = (long int)(0x7FFF & u2); \
*((X)) += (long int) 1; \
*((Y)) += (long int) s; \
*((Z)) += ((long long int)(s) * (long long int)(s)); \
} while (0)
/*---------------------------------------------------------------------------*/

/*---------------------------------------------------------------------------*/
Expand All @@ -633,8 +601,5 @@ 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__ */
6 changes: 0 additions & 6 deletions trunk/drivers/staging/easycap/easycap_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -2347,14 +2347,8 @@ long easycap_unlocked_ioctl(struct file *file,
/*---------------------------------------------------------------------------*/
JOM(8, "calling wake_up on wq_video and wq_audio\n");
wake_up_interruptible(&(peasycap->wq_video));
#ifdef CONFIG_EASYCAP_OSS
wake_up_interruptible(&(peasycap->wq_audio));

#else
if (peasycap->psubstream)
snd_pcm_period_elapsed(peasycap->psubstream);
#endif /* CONFIG_EASYCAP_OSS */
/*---------------------------------------------------------------------------*/
break;
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
Expand Down
67 changes: 1 addition & 66 deletions trunk/drivers/staging/easycap/easycap_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -876,20 +876,6 @@ static void easycap_delete(struct kref *pkref)
}
JOM(4, "easyoss_delete(): isoc audio buffers freed: %i pages\n",
m * (0x01 << AUDIO_ISOC_ORDER));
/*---------------------------------------------------------------------------*/
#ifdef CONFIG_EASYCAP_OSS
JOM(4, "freeing audio buffers.\n");
gone = 0;
for (k = 0; k < peasycap->audio_buffer_page_many; k++) {
if (peasycap->audio_buffer[k].pgo) {
free_page((unsigned long)peasycap->audio_buffer[k].pgo);
peasycap->audio_buffer[k].pgo = NULL;
peasycap->allocation_audio_page -= 1;
gone++;
}
}
JOM(4, "easyoss_delete(): audio buffers freed: %i pages\n", gone);
#endif /* CONFIG_EASYCAP_OSS */
/*---------------------------------------------------------------------------*/
JOM(4, "freeing easycap structure.\n");
allocation_video_urb = peasycap->allocation_video_urb;
Expand Down Expand Up @@ -3894,32 +3880,6 @@ static int easycap_usb_probe(struct usb_interface *intf,
INIT_LIST_HEAD(&(peasycap->urb_audio_head));
peasycap->purb_audio_head = &(peasycap->urb_audio_head);

#ifdef CONFIG_EASYCAP_OSS
JOM(4, "allocating an audio buffer\n");
JOM(4, ".... scattered over %i pages\n",
peasycap->audio_buffer_page_many);

for (k = 0; k < peasycap->audio_buffer_page_many; k++) {
if (peasycap->audio_buffer[k].pgo) {
SAM("ERROR: attempting to reallocate audio buffers\n");
} else {
pbuf = (void *) __get_free_page(GFP_KERNEL);
if (!pbuf) {
SAM("ERROR: Could not allocate audio "
"buffer page %i\n", k);
return -ENOMEM;
} else
peasycap->allocation_audio_page += 1;

peasycap->audio_buffer[k].pgo = pbuf;
}
peasycap->audio_buffer[k].pto = peasycap->audio_buffer[k].pgo;
}

peasycap->audio_fill = 0;
peasycap->audio_read = 0;
JOM(4, "allocation of audio buffer done: %i pages\n", k);
#endif /* CONFIG_EASYCAP_OSS */
/*---------------------------------------------------------------------------*/
JOM(4, "allocating %i isoc audio buffers of size %i\n",
AUDIO_ISOC_BUFFER_MANY,
Expand Down Expand Up @@ -3996,11 +3956,7 @@ static int easycap_usb_probe(struct usb_interface *intf,
"peasycap->audio_isoc_buffer[.].pgo;\n");
JOM(4, " purb->transfer_buffer_length = %i;\n",
peasycap->audio_isoc_buffer_size);
#ifdef CONFIG_EASYCAP_OSS
JOM(4, " purb->complete = easyoss_complete;\n");
#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 @@ -4023,11 +3979,7 @@ static int easycap_usb_probe(struct usb_interface *intf,
purb->transfer_buffer = peasycap->audio_isoc_buffer[k].pgo;
purb->transfer_buffer_length =
peasycap->audio_isoc_buffer_size;
#ifdef CONFIG_EASYCAP_OSS
purb->complete = easyoss_complete;
#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 @@ -4050,7 +4002,6 @@ static int easycap_usb_probe(struct usb_interface *intf,
* THE AUDIO DEVICE CAN BE REGISTERED NOW, AS IT IS READY.
*/
/*---------------------------------------------------------------------------*/
#ifndef CONFIG_EASYCAP_OSS
JOM(4, "initializing ALSA card\n");

rc = easycap_alsa_probe(peasycap);
Expand All @@ -4059,15 +4010,6 @@ static int easycap_usb_probe(struct usb_interface *intf,
return -ENODEV;
}

#else /* CONFIG_EASYCAP_OSS */
rc = usb_register_dev(intf, &easyoss_class);
if (rc) {
SAY("ERROR: usb_register_dev() failed\n");
usb_set_intfdata(intf, NULL);
return -ENODEV;
}
SAM("easyoss attached to minor #%d\n", intf->minor);
#endif /* CONFIG_EASYCAP_OSS */

JOM(8, "kref_get() with %i=kref.refcount.counter\n",
peasycap->kref.refcount.counter);
Expand All @@ -4093,7 +4035,7 @@ static int easycap_usb_probe(struct usb_interface *intf,
* WHEN THIS FUNCTION IS CALLED THE EasyCAP HAS ALREADY BEEN PHYSICALLY
* UNPLUGGED. HENCE peasycap->pusb_device IS NO LONGER VALID.
*
* THIS FUNCTION AFFECTS BOTH OSS AND ALSA. BEWARE.
* THIS FUNCTION AFFECTS ALSA. BEWARE.
*/
/*---------------------------------------------------------------------------*/
static void easycap_usb_disconnect(struct usb_interface *pusb_interface)
Expand Down Expand Up @@ -4244,19 +4186,12 @@ static void easycap_usb_disconnect(struct usb_interface *pusb_interface)
JOM(4, "locked dongle[%i].mutex_audio\n", kd);
} else
SAY("ERROR: %i=kd is bad: cannot lock dongle\n", kd);
#ifndef CONFIG_EASYCAP_OSS
if (0 != snd_card_free(peasycap->psnd_card)) {
SAY("ERROR: snd_card_free() failed\n");
} else {
peasycap->psnd_card = NULL;
(peasycap->registered_audio)--;
}
#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 /* CONFIG_EASYCAP_OSS */
if (0 <= kd && DONGLE_MANY > kd) {
mutex_unlock(&easycapdc60_dongle[kd].mutex_audio);
JOM(4, "unlocked dongle[%i].mutex_audio\n", kd);
Expand Down
6 changes: 0 additions & 6 deletions trunk/drivers/staging/easycap/easycap_sound.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

#include "easycap.h"

#ifndef CONFIG_EASYCAP_OSS
/*--------------------------------------------------------------------------*/
/*
* PARAMETERS USED WHEN REGISTERING THE AUDIO INTERFACE
Expand Down Expand Up @@ -615,7 +614,6 @@ int easycap_alsa_probe(struct easycap *peasycap)
SAM("registered %s\n", &psnd_card->id[0]);
return 0;
}
#endif /*! CONFIG_EASYCAP_OSS */

/*****************************************************************************/
/*****************************************************************************/
Expand Down Expand Up @@ -733,11 +731,7 @@ submit_audio_urbs(struct easycap *peasycap)
purb->transfer_flags = URB_ISO_ASAP;
purb->transfer_buffer = peasycap->audio_isoc_buffer[isbuf].pgo;
purb->transfer_buffer_length = peasycap->audio_isoc_buffer_size;
#ifdef CONFIG_EASYCAP_OSS
purb->complete = easyoss_complete;
#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 Down
Loading

0 comments on commit 8be62f4

Please sign in to comment.