Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 205878
b: refs/heads/master
c: 7ebc876
h: refs/heads/master
v: v3
  • Loading branch information
Mike Thomas authored and Greg Kroah-Hartman committed Jul 22, 2010
1 parent 8f6cf06 commit 586d5a4
Show file tree
Hide file tree
Showing 6 changed files with 148 additions and 50 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: 3d423e91b498b71bfdf4bcfac52c3c27e0f2f39f
refs/heads/master: 7ebc8760b38bb00c35fcf43dad438c2adcd7c328
2 changes: 1 addition & 1 deletion trunk/drivers/staging/easycap/easycap.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
#define USB_EASYCAP_VENDOR_ID 0x05e1
#define USB_EASYCAP_PRODUCT_ID 0x0408

#define EASYCAP_DRIVER_VERSION "0.8.2"
#define EASYCAP_DRIVER_VERSION "0.8.21"
#define EASYCAP_DRIVER_DESCRIPTION "easycapdc60"

#define USB_SKEL_MINOR_BASE 192
Expand Down
35 changes: 35 additions & 0 deletions trunk/drivers/staging/easycap/easycap_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1985,10 +1985,17 @@ case SNDCTL_DSP_GETCAPS: {
int caps;
JOT(8, "SNDCTL_DSP_GETCAPS\n");

#if defined(UPSAMPLE)
if (true == peasycap->microphone)
caps = 0x04400000;
else
caps = 0x04400000;
#else
if (true == peasycap->microphone)
caps = 0x02400000;
else
caps = 0x04400000;
#endif /*UPSAMPLE*/

if (0 != copy_to_user((void __user *)arg, &caps, sizeof(int)))
return -EFAULT;
Expand All @@ -1998,10 +2005,17 @@ case SNDCTL_DSP_GETFMTS: {
int incoming;
JOT(8, "SNDCTL_DSP_GETFMTS\n");

#if defined(UPSAMPLE)
if (true == peasycap->microphone)
incoming = AFMT_S16_LE;
else
incoming = AFMT_S16_LE;
#else
if (true == peasycap->microphone)
incoming = AFMT_S16_LE;
else
incoming = AFMT_S16_LE;
#endif /*UPSAMPLE*/

if (0 != copy_to_user((void __user *)arg, &incoming, sizeof(int)))
return -EFAULT;
Expand All @@ -2014,10 +2028,17 @@ case SNDCTL_DSP_SETFMT: {
return -EFAULT;
JOT(8, "........... %i=incoming\n", incoming);

#if defined(UPSAMPLE)
if (true == peasycap->microphone)
outgoing = AFMT_S16_LE;
else
outgoing = AFMT_S16_LE;
#else
if (true == peasycap->microphone)
outgoing = AFMT_S16_LE;
else
outgoing = AFMT_S16_LE;
#endif /*UPSAMPLE*/

if (incoming != outgoing) {
JOT(8, "........... %i=outgoing\n", outgoing);
Expand All @@ -2037,10 +2058,17 @@ case SNDCTL_DSP_STEREO: {
return -EFAULT;
JOT(8, "........... %i=incoming\n", incoming);

#if defined(UPSAMPLE)
if (true == peasycap->microphone)
incoming = 1;
else
incoming = 1;
#else
if (true == peasycap->microphone)
incoming = 0;
else
incoming = 1;
#endif /*UPSAMPLE*/

if (0 != copy_to_user((void __user *)arg, &incoming, sizeof(int)))
return -EFAULT;
Expand All @@ -2053,10 +2081,17 @@ case SNDCTL_DSP_SPEED: {
return -EFAULT;
JOT(8, "........... %i=incoming\n", incoming);

#if defined(UPSAMPLE)
if (true == peasycap->microphone)
incoming = 32000;
else
incoming = 48000;
#else
if (true == peasycap->microphone)
incoming = 8000;
else
incoming = 48000;
#endif /*UPSAMPLE*/

if (0 != copy_to_user((void __user *)arg, &incoming, sizeof(int)))
return -EFAULT;
Expand Down
66 changes: 25 additions & 41 deletions trunk/drivers/staging/easycap/easycap_low.c
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ static __u16 index = 0x0301;

static unsigned char buffer[1];
static __u16 length = 1;
int rc;
int rc, id1, id2;

if (NULL == peasycap)
return -EFAULT;
Expand Down Expand Up @@ -883,46 +883,30 @@ SET(pusb_device, 0x0500, 0x008C);
SET(pusb_device, 0x0506, 0x0001);
SET(pusb_device, 0x0507, 0x0000);

if (false == peasycap->microphone) {
/*-------------------------------------------------------------------*/
/*
* SELECT AUDIO SOURCE "LINE IN" AND SET DEFAULT GAIN TO 0dB.
*/
/*-------------------------------------------------------------------*/
write_vt(pusb_device, 0x0002, 0x8000);
write_vt(pusb_device, 0x001C, 0x8000);

write_vt(pusb_device, 0x000E, 0x0000);
write_vt(pusb_device, 0x0010, 0x0000);
write_vt(pusb_device, 0x0012, 0x8000);
write_vt(pusb_device, 0x0016, 0x0000);

write_vt(pusb_device, 0x001A, 0x0404);
write_vt(pusb_device, 0x0002, 0x0000);
write_vt(pusb_device, 0x001C, 0x0000);
} else {
/*-------------------------------------------------------------------*/
/*
* SELECT AUDIO SOURCE "MIC" AND SET DEFAULT GAIN TO 0 dB.
*
* REGISTER 0x000E CAN BE SET TO PROVIDE UP TO 34.5 dB ATTENTUATION,
* BUT THIS HAS NOT PROVED NECESSARY FOR THE FEW SIGNAL SOURCES
* TESTED HITHERTO.
*/
/*-------------------------------------------------------------------*/
write_vt(pusb_device, 0x0006, 0x8000);
write_vt(pusb_device, 0x001C, 0x8000);

write_vt(pusb_device, 0x000E, 0x0008);

write_vt(pusb_device, 0x0010, 0x0000);
write_vt(pusb_device, 0x0012, 0x8000);
write_vt(pusb_device, 0x0016, 0x0000);

write_vt(pusb_device, 0x001A, 0x0000);
write_vt(pusb_device, 0x0006, 0x0000);
write_vt(pusb_device, 0x001C, 0x0000);
}
id1 = read_vt(pusb_device, 0x007C);
id2 = read_vt(pusb_device, 0x007E);
SAY("0x%04X:0x%04X is audio vendor id\n", id1, id2);

/*---------------------------------------------------------------------------*/
/*
* SELECT AUDIO SOURCE "LINE IN" AND SET DEFAULT GAIN TO 0 dB.
*
* THESE COMMANDS SEEM TO BE ACCEPTED (THOUGH POSSIBLY IGNORED) EVEN WHEN
* THERE IS NO SEPARATE AUDIO CHIP PRESENT.
*/
/*---------------------------------------------------------------------------*/

write_vt(pusb_device, 0x0002, 0x8000);
write_vt(pusb_device, 0x001C, 0x8000);

write_vt(pusb_device, 0x000E, 0x0000);
write_vt(pusb_device, 0x0010, 0x0000);
write_vt(pusb_device, 0x0012, 0x8000);
write_vt(pusb_device, 0x0016, 0x0000);

write_vt(pusb_device, 0x001A, 0x0404);
write_vt(pusb_device, 0x0002, 0x0000);
write_vt(pusb_device, 0x001C, 0x0000);

check_vt(pusb_device);

Expand Down
15 changes: 14 additions & 1 deletion trunk/drivers/staging/easycap/easycap_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2490,6 +2490,10 @@ if (peasycap->video_idle) {
SAY("EMSGSIZE\n");
break;
}
case -ENOSPC: {
SAY("ENOSPC\n");
break;
}
default: {
SAY("0x%08X\n", rc);
break;
Expand Down Expand Up @@ -2571,6 +2575,9 @@ if (purb->status) {
case -ECONNRESET: {
SAY("-ECONNRESET\n"); break;
}
case -ENOSPC: {
SAY("ENOSPC\n"); break;
}
default: {
SAY("unknown error code 0x%08X\n", purb->status); break;
}
Expand Down Expand Up @@ -2630,6 +2637,9 @@ if (purb->status) {
case -ECONNRESET: {
strcpy(&errbuf[0], "-ECONNRESET"); break;
}
case -ENOSPC: {
SAY("ENOSPC\n"); break;
}
case -ESHUTDOWN: {
strcpy(&errbuf[0], "-ESHUTDOWN"); break;
}
Expand Down Expand Up @@ -2949,6 +2959,9 @@ if (peasycap->video_isoc_streaming) {
case -EMSGSIZE: {
SAY("EMSGSIZE\n"); break;
}
case -ENOSPC: {
SAY("ENOSPC\n"); break;
}
default: {
SAY("0x%08X\n", rc); break;
}
Expand Down Expand Up @@ -3861,7 +3874,7 @@ case 2: {
peasycap->ilk |= 0x02;
SAY("hardware is FOUR-CVBS\n");
peasycap->microphone = true;
peasycap->audio_pages_per_fragment = 2;
peasycap->audio_pages_per_fragment = 4;
} else if (256 == peasycap->audio_isoc_maxframesize) {
peasycap->ilk &= ~0x02;
SAY("hardware is CVBS+S-VIDEO\n");
Expand Down
Loading

0 comments on commit 586d5a4

Please sign in to comment.