Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 235667
b: refs/heads/master
c: a985591
h: refs/heads/master
i:
  235665: c47a971
  235663: 83a4f6e
v: v3
  • Loading branch information
Mike Thomas authored and Greg Kroah-Hartman committed Jan 21, 2011
1 parent b5621c3 commit ce70d67
Show file tree
Hide file tree
Showing 16 changed files with 1,622 additions and 500 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: b54a28a418b2730bf61554864fee3fb24f79e182
refs/heads/master: a9855917290fc40dbfd67d3ee06c190667d6c5b5
2 changes: 1 addition & 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
depends on USB && VIDEO_DEV && SND

---help---
This is an integrated audio/video driver for EasyCAP cards with
Expand Down
11 changes: 5 additions & 6 deletions trunk/drivers/staging/easycap/Makefile
Original file line number Diff line number Diff line change
@@ -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

84 changes: 67 additions & 17 deletions trunk/drivers/staging/easycap/easycap.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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>
Expand All @@ -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>
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -158,14 +170,16 @@
*/
/*---------------------------------------------------------------------------*/
#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)
/*---------------------------------------------------------------------------*/
/*
* AUDIO BUFFERS
*/
/*---------------------------------------------------------------------------*/
#define AUDIO_FRAGMENT_MANY 32
#define PAGES_PER_AUDIO_FRAGMENT 4
/*---------------------------------------------------------------------------*/
/*
* IT IS ESSENTIAL THAT EVEN-NUMBERED STANDARDS ARE 25 FRAMES PER SECOND,
Expand Down Expand Up @@ -296,6 +310,7 @@ struct easycap {
#define TELLTALE "expectedstring"
char telltale[16];
int isdongle;
int minor;

/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
#if defined(EASYCAP_IS_VIDEODEV_CLIENT)
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -428,6 +444,20 @@ int allocation_video_page;
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
*/
Expand Down Expand Up @@ -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. */
/*---------------------------------------------------------------------------*/
/*
Expand Down Expand Up @@ -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 *);
/*---------------------------------------------------------------------------*/
/*
Expand Down
Loading

0 comments on commit ce70d67

Please sign in to comment.