Commit 73019286 authored by Tomas Winkler's avatar Tomas Winkler Committed by Greg Kroah-Hartman

staging/easycap: remove oss support

remove support for OSS. OSS is being deprecated
and it is just plain headache to support both alsa and oss.

Last I broke the compilation when OSS is enabled with the patch
cdaa898b
staging/easycap: kill telltale logic

so this fixes also that issue.

Cc: Mike Thomas <rmthomas@sciolus.org>
Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 808a3b5f
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
......@@ -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
......
......@@ -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
......@@ -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>
......@@ -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>
......@@ -413,7 +411,6 @@ struct easycap {
* ALSA
*/
/*---------------------------------------------------------------------------*/
#ifndef CONFIG_EASYCAP_OSS
struct snd_pcm_hardware alsa_hardware;
struct snd_card *psnd_card;
struct snd_pcm *psnd_pcm;
......@@ -421,7 +418,6 @@ struct easycap {
int dma_fill;
int dma_next;
int dma_read;
#endif /* !CONFIG_EASYCAP_OSS */
/*---------------------------------------------------------------------------*/
/*
* SOUND PROPERTIES
......@@ -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 *);
......@@ -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)
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
......@@ -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__ */
......@@ -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;
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
......
......@@ -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;
......@@ -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,
......@@ -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",
......@@ -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;
......@@ -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);
......@@ -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);
......@@ -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)
......@@ -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);
......
......@@ -30,7 +30,6 @@
#include "easycap.h"
#ifndef CONFIG_EASYCAP_OSS
/*--------------------------------------------------------------------------*/
/*
* PARAMETERS USED WHEN REGISTERING THE AUDIO INTERFACE
......@@ -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 */
/*****************************************************************************/
/*****************************************************************************/
......@@ -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;
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment