Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 285297
b: refs/heads/master
c: 96bec7d
h: refs/heads/master
i:
  285295: c331f8d
v: v3
  • Loading branch information
Tomas Winkler authored and Mauro Carvalho Chehab committed Nov 24, 2011
1 parent 50071a7 commit 18382af
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 48 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: a5b6ee06b21eaee64f100be8591fd51917bdbe36
refs/heads/master: 96bec7dd72511e3c16588d9af52da2cc937f7ea1
20 changes: 11 additions & 9 deletions trunk/drivers/staging/media/easycap/easycap.h
Original file line number Diff line number Diff line change
Expand Up @@ -463,13 +463,16 @@ struct easycap {
* VIDEO FUNCTION PROTOTYPES
*/
/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
int easycap_newinput(struct easycap *, int);
void easycap_testcard(struct easycap *, int);
int easycap_isdongle(struct easycap *);

long easycap_unlocked_ioctl(struct file *, unsigned int, unsigned long);
int easycap_dqbuf(struct easycap *, int);
int submit_video_urbs(struct easycap *);

int easycap_video_dqbuf(struct easycap *, int);
int easycap_video_submit_urbs(struct easycap *);
int easycap_video_kill_urbs(struct easycap *);
void easycap_testcard(struct easycap *, int);
int fillin_formats(void);
int newinput(struct easycap *, int);
int easycap_video_fillin_formats(void);

int adjust_standard(struct easycap *, v4l2_std_id);
int adjust_format(struct easycap *, u32, u32, u32, int, bool);
Expand All @@ -485,15 +488,15 @@ int adjust_hue(struct easycap *, int);
int easycap_alsa_probe(struct easycap *);
int easycap_audio_kill_urbs(struct easycap *);
void easycap_alsa_complete(struct urb *);
int audio_setup(struct easycap *);
/*---------------------------------------------------------------------------*/
/*
* LOW-LEVEL FUNCTION PROTOTYPES
*/
/*---------------------------------------------------------------------------*/
int audio_gainset(struct usb_device *, s8);
int easycap_audio_gainset(struct usb_device *, s8);
int easycap_audio_setup(struct easycap *);

int wakeup_device(struct usb_device *);
int easycap_wakeup_device(struct usb_device *);

int setup_stk(struct usb_device *, bool);
int setup_saa(struct usb_device *, bool);
Expand All @@ -507,7 +510,6 @@ int read_saa(struct usb_device *, u16);
int write_saa(struct usb_device *, u16, u16);
int start_100(struct usb_device *);
int stop_100(struct usb_device *);
int isdongle(struct easycap *);
/*---------------------------------------------------------------------------*/


Expand Down
16 changes: 8 additions & 8 deletions trunk/drivers/staging/media/easycap/easycap_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ int adjust_standard(struct easycap *peasycap, v4l2_std_id std_id)
"from 0x%02X to 0x%02X\n", reg, itwas, isnow);
}
if (resubmit)
submit_video_urbs(peasycap);
easycap_video_submit_urbs(peasycap);
return 0;
}
/*****************************************************************************/
Expand Down Expand Up @@ -621,7 +621,7 @@ int adjust_format(struct easycap *peasycap,
}
/*---------------------------------------------------------------------------*/
if (resubmit)
submit_video_urbs(peasycap);
easycap_video_submit_urbs(peasycap);

return peasycap_best_format - easycap_format;
}
Expand Down Expand Up @@ -879,7 +879,7 @@ static int adjust_volume(struct easycap *peasycap, int value)
mood = (16 > peasycap->volume) ? 16 :
((31 < peasycap->volume) ? 31 :
(s8) peasycap->volume);
if (!audio_gainset(peasycap->pusb_device, mood)) {
if (!easycap_audio_gainset(peasycap->pusb_device, mood)) {
SAM("WARNING: failed to adjust volume to "
"0x%2X\n", mood);
return -ENOENT;
Expand Down Expand Up @@ -963,7 +963,7 @@ long easycap_unlocked_ioctl(struct file *file,
SAM("ERROR: peasycap->pusb_device is NULL\n");
return -EFAULT;
}
kd = isdongle(peasycap);
kd = easycap_isdongle(peasycap);
if (0 <= kd && DONGLE_MANY > kd) {
if (mutex_lock_interruptible(&easycapdc60_dongle[kd].mutex_video)) {
SAY("ERROR: cannot lock "
Expand All @@ -978,7 +978,7 @@ long easycap_unlocked_ioctl(struct file *file,
* IF NECESSARY, BAIL OUT.
*/
/*---------------------------------------------------------------------------*/
if (kd != isdongle(peasycap))
if (kd != easycap_isdongle(peasycap))
return -ERESTARTSYS;
if (!file) {
SAY("ERROR: file is NULL\n");
Expand Down Expand Up @@ -1218,7 +1218,7 @@ long easycap_unlocked_ioctl(struct file *file,
return -EINVAL;
}

rc = newinput(peasycap, (int)index);
rc = easycap_newinput(peasycap, (int)index);
if (0 == rc) {
JOM(8, "newinput(.,%i) OK\n", (int)index);
} else {
Expand Down Expand Up @@ -2201,7 +2201,7 @@ long easycap_unlocked_ioctl(struct file *file,

if (!peasycap->polled) {
do {
rcdq = easycap_dqbuf(peasycap, 0);
rcdq = easycap_video_dqbuf(peasycap, 0);
if (-EIO == rcdq) {
JOM(8, "returning -EIO because "
"dqbuf() returned -EIO\n");
Expand Down Expand Up @@ -2305,7 +2305,7 @@ long easycap_unlocked_ioctl(struct file *file,
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT;
}
submit_video_urbs(peasycap);
easycap_video_submit_urbs(peasycap);
peasycap->video_idle = 0;
peasycap->audio_idle = 0;
peasycap->video_eof = 0;
Expand Down
10 changes: 5 additions & 5 deletions trunk/drivers/staging/media/easycap/easycap_low.c
Original file line number Diff line number Diff line change
Expand Up @@ -724,19 +724,19 @@ int stop_100(struct usb_device *p)
/****************************************************************************/
/****************************************************************************/
/*****************************************************************************/
int wakeup_device(struct usb_device *pusb_device)
int easycap_wakeup_device(struct usb_device *pusb_device)
{
if (!pusb_device)
return -ENODEV;

return usb_control_msg(pusb_device, usb_sndctrlpipe(pusb_device, 0),
USB_REQ_SET_FEATURE,
USB_DIR_OUT | USB_TYPE_STANDARD | USB_RECIP_DEVICE,
USB_DEVICE_REMOTE_WAKEUP,
0, NULL, 0, 50000);
}
/*****************************************************************************/
int
audio_setup(struct easycap *peasycap)
int easycap_audio_setup(struct easycap *peasycap)
{
struct usb_device *pusb_device;
u8 buffer[1];
Expand Down Expand Up @@ -817,7 +817,7 @@ audio_setup(struct easycap *peasycap)
* SELECT AUDIO SOURCE "LINE IN" AND SET THE AUDIO GAIN.
*/
/*---------------------------------------------------------------------------*/
if (0 != audio_gainset(pusb_device, peasycap->gain))
if (easycap_audio_gainset(pusb_device, peasycap->gain))
SAY("ERROR: audio_gainset() failed\n");
check_vt(pusb_device);
return 0;
Expand Down Expand Up @@ -894,7 +894,7 @@ int check_vt(struct usb_device *pusb_device)
* 31 12.0 22.5 34.5
*/
/*---------------------------------------------------------------------------*/
int audio_gainset(struct usb_device *pusb_device, s8 loud)
int easycap_audio_gainset(struct usb_device *pusb_device, s8 loud)
{
int igot;
u8 tmp;
Expand Down
27 changes: 13 additions & 14 deletions trunk/drivers/staging/media/easycap/easycap_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ const char *strerror(int err)
* THIS ROUTINE DOES NOT DETECT DUPLICATE OCCURRENCES OF POINTER peasycap
*/
/*---------------------------------------------------------------------------*/
int isdongle(struct easycap *peasycap)
int easycap_isdongle(struct easycap *peasycap)
{
int k;
if (!peasycap)
Expand Down Expand Up @@ -170,7 +170,7 @@ static int easycap_open(struct inode *inode, struct file *file)
JOM(16, "peasycap->pusb_device=%p\n", peasycap->pusb_device);

file->private_data = peasycap;
rc = wakeup_device(peasycap->pusb_device);
rc = easycap_wakeup_device(peasycap->pusb_device);
if (rc) {
SAM("ERROR: wakeup_device() rc = %i\n", rc);
if (-ENODEV == rc)
Expand Down Expand Up @@ -307,7 +307,7 @@ static int reset(struct easycap *peasycap)
peasycap->saturation = -8192;
peasycap->hue = -8192;

rc = newinput(peasycap, input);
rc = easycap_newinput(peasycap, input);

if (rc) {
SAM("ERROR: newinput(.,%i) rc = %i\n", rc, input);
Expand Down Expand Up @@ -368,8 +368,7 @@ static int reset(struct easycap *peasycap)
* SO IT SHOULD WRITE ONLY SPARINGLY TO THE LOGFILE.
*/
/*---------------------------------------------------------------------------*/
int
newinput(struct easycap *peasycap, int input)
int easycap_newinput(struct easycap *peasycap, int input)
{
int rc, k, m, mood, off;
int inputnow, video_idlenow, audio_idlenow;
Expand Down Expand Up @@ -536,7 +535,7 @@ newinput(struct easycap *peasycap, int input)
return -EFAULT;
}
if (resubmit)
submit_video_urbs(peasycap);
easycap_video_submit_urbs(peasycap);

peasycap->video_isoc_sequence = VIDEO_ISOC_BUFFER_MANY - 1;
peasycap->video_idle = video_idlenow;
Expand All @@ -546,7 +545,7 @@ newinput(struct easycap *peasycap, int input)
return 0;
}
/*****************************************************************************/
int submit_video_urbs(struct easycap *peasycap)
int easycap_video_submit_urbs(struct easycap *peasycap)
{
struct data_urb *pdata_urb;
struct urb *purb;
Expand Down Expand Up @@ -741,7 +740,7 @@ static void easycap_delete(struct kref *pkref)
SAM("ERROR: peasycap is NULL: cannot perform deletions\n");
return;
}
kd = isdongle(peasycap);
kd = easycap_isdongle(peasycap);
/*---------------------------------------------------------------------------*/
/*
* FREE VIDEO.
Expand Down Expand Up @@ -943,7 +942,7 @@ static unsigned int easycap_poll(struct file *file, poll_table *wait)
return -EFAULT;
}
/*---------------------------------------------------------------------------*/
kd = isdongle(peasycap);
kd = easycap_isdongle(peasycap);
if (0 <= kd && DONGLE_MANY > kd) {
if (mutex_lock_interruptible(&easycapdc60_dongle[kd].mutex_video)) {
SAY("ERROR: cannot down dongle[%i].mutex_video\n", kd);
Expand All @@ -955,7 +954,7 @@ static unsigned int easycap_poll(struct file *file, poll_table *wait)
* peasycap, IN WHICH CASE A REPEAT CALL TO isdongle() WILL FAIL.
* IF NECESSARY, BAIL OUT.
*/
if (kd != isdongle(peasycap)) {
if (kd != easycap_isdongle(peasycap)) {
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -ERESTARTSYS;
}
Expand Down Expand Up @@ -983,7 +982,7 @@ static unsigned int easycap_poll(struct file *file, poll_table *wait)
*/
return -ERESTARTSYS;
/*---------------------------------------------------------------------------*/
rc = easycap_dqbuf(peasycap, 0);
rc = easycap_video_dqbuf(peasycap, 0);
peasycap->polled = 1;
mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
if (rc)
Expand All @@ -997,7 +996,7 @@ static unsigned int easycap_poll(struct file *file, poll_table *wait)
* IF mode IS NONZERO THIS ROUTINE RETURNS -EAGAIN RATHER THAN BLOCKING.
*/
/*---------------------------------------------------------------------------*/
int easycap_dqbuf(struct easycap *peasycap, int mode)
int easycap_video_dqbuf(struct easycap *peasycap, int mode)
{
int input, ifield, miss, rc;

Expand Down Expand Up @@ -3036,7 +3035,7 @@ static int easycap_usb_probe(struct usb_interface *intf,
* DYNAMICALLY FILL IN THE AVAILABLE FORMATS ...
*/
/*---------------------------------------------------------------------------*/
rc = fillin_formats();
rc = easycap_video_fillin_formats();
if (0 > rc) {
SAM("ERROR: fillin_formats() rc = %i\n", rc);
return -EFAULT;
Expand Down Expand Up @@ -4025,7 +4024,7 @@ static void easycap_usb_disconnect(struct usb_interface *pusb_interface)
* AN EasyCAP IS UNPLUGGED WHILE THE URBS ARE RUNNING. BEWARE.
*/
/*--------------------------------------------------------------------------*/
kd = isdongle(peasycap);
kd = easycap_isdongle(peasycap);
switch (bInterfaceNumber) {
case 0: {
if (0 <= kd && DONGLE_MANY > kd) {
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/staging/media/easycap/easycap_settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ const struct easycap_standard easycap_standard[] = {

struct easycap_format easycap_format[1 + SETTINGS_MANY];

int fillin_formats(void)
int easycap_video_fillin_formats(void)
{
const char *name1, *name2, *name3, *name4;
struct v4l2_format *fmt;
Expand Down
15 changes: 5 additions & 10 deletions trunk/drivers/staging/media/easycap/easycap_sound.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,14 @@ static const struct snd_pcm_hardware alsa_hardware = {
* SUBMIT ALL AUDIO URBS.
*/
/*---------------------------------------------------------------------------*/
static int submit_audio_urbs(struct easycap *peasycap)
static int easycap_audio_submit_urbs(struct easycap *peasycap)
{
struct data_urb *pdata_urb;
struct urb *purb;
struct list_head *plist_head;
int j, isbad, nospc, m, rc;
int isbuf;

if (!peasycap) {
SAY("ERROR: peasycap is NULL\n");
return -EFAULT;
}
if (!peasycap->purb_audio_head) {
SAM("ERROR: peasycap->urb_audio_head uninitialized\n");
return -EFAULT;
Expand Down Expand Up @@ -167,7 +163,7 @@ static int easycap_sound_setup(struct easycap *peasycap)
}
JOM(16, "0x%08lX=peasycap->pusb_device\n", (long int)peasycap->pusb_device);

rc = audio_setup(peasycap);
rc = easycap_audio_setup(peasycap);
JOM(8, "audio_setup() returned %i\n", rc);

if (!peasycap->pusb_device) {
Expand All @@ -184,13 +180,13 @@ static int easycap_sound_setup(struct easycap *peasycap)
JOM(8, "usb_set_interface(.,%i,%i) returned %i\n", peasycap->audio_interface,
peasycap->audio_altsetting_on, rc);

rc = wakeup_device(peasycap->pusb_device);
rc = easycap_wakeup_device(peasycap->pusb_device);
JOM(8, "wakeup_device() returned %i\n", rc);

peasycap->audio_eof = 0;
peasycap->audio_idle = 0;

submit_audio_urbs(peasycap);
easycap_audio_submit_urbs(peasycap);

JOM(4, "finished initialization\n");
return 0;
Expand All @@ -203,8 +199,7 @@ static int easycap_sound_setup(struct easycap *peasycap)
* IT IS RESUBMITTED PROVIDED peasycap->audio_isoc_streaming IS NOT ZERO.
*/
/*---------------------------------------------------------------------------*/
void
easycap_alsa_complete(struct urb *purb)
void easycap_alsa_complete(struct urb *purb)
{
struct easycap *peasycap;
struct snd_pcm_substream *pss;
Expand Down

0 comments on commit 18382af

Please sign in to comment.