Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 306429
b: refs/heads/master
c: f9482d0
h: refs/heads/master
i:
  306427: 2ea6bd1
v: v3
  • Loading branch information
Ezequiel García authored and Mauro Carvalho Chehab committed May 15, 2012
1 parent ee6f2e8 commit f99839a
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 32 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: 20c50af28aa9301b1f5bf0ba571068f663f7b0ac
refs/heads/master: f9482d01985b03633e39e1c772bd7d365ab82dc6
72 changes: 41 additions & 31 deletions trunk/drivers/staging/media/easycap/easycap_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3242,6 +3242,44 @@ static int create_video_urbs(struct easycap *peasycap)
return 0;
}

static void config_easycap(struct easycap *peasycap,
u8 bInterfaceNumber,
u8 bInterfaceClass,
u8 bInterfaceSubClass)
{
if ((USB_CLASS_VIDEO == bInterfaceClass) ||
(USB_CLASS_VENDOR_SPEC == bInterfaceClass)) {
if (-1 == peasycap->video_interface) {
peasycap->video_interface = bInterfaceNumber;
JOM(4, "setting peasycap->video_interface=%i\n",
peasycap->video_interface);
} else {
if (peasycap->video_interface != bInterfaceNumber) {
SAM("ERROR: attempting to reset "
"peasycap->video_interface\n");
SAM("...... continuing with "
"%i=peasycap->video_interface\n",
peasycap->video_interface);
}
}
} else if ((USB_CLASS_AUDIO == bInterfaceClass) &&
(USB_SUBCLASS_AUDIOSTREAMING == bInterfaceSubClass)) {
if (-1 == peasycap->audio_interface) {
peasycap->audio_interface = bInterfaceNumber;
JOM(4, "setting peasycap->audio_interface=%i\n",
peasycap->audio_interface);
} else {
if (peasycap->audio_interface != bInterfaceNumber) {
SAM("ERROR: attempting to reset "
"peasycap->audio_interface\n");
SAM("...... continuing with "
"%i=peasycap->audio_interface\n",
peasycap->audio_interface);
}
}
}
}

static const struct v4l2_file_operations v4l2_fops = {
.owner = THIS_MODULE,
.open = easycap_open_noinode,
Expand Down Expand Up @@ -3340,37 +3378,9 @@ static int easycap_usb_probe(struct usb_interface *intf,
return -ENODEV;
}

if ((USB_CLASS_VIDEO == bInterfaceClass) ||
(USB_CLASS_VENDOR_SPEC == bInterfaceClass)) {
if (-1 == peasycap->video_interface) {
peasycap->video_interface = bInterfaceNumber;
JOM(4, "setting peasycap->video_interface=%i\n",
peasycap->video_interface);
} else {
if (peasycap->video_interface != bInterfaceNumber) {
SAM("ERROR: attempting to reset "
"peasycap->video_interface\n");
SAM("...... continuing with "
"%i=peasycap->video_interface\n",
peasycap->video_interface);
}
}
} else if ((USB_CLASS_AUDIO == bInterfaceClass) &&
(USB_SUBCLASS_AUDIOSTREAMING == bInterfaceSubClass)) {
if (-1 == peasycap->audio_interface) {
peasycap->audio_interface = bInterfaceNumber;
JOM(4, "setting peasycap->audio_interface=%i\n",
peasycap->audio_interface);
} else {
if (peasycap->audio_interface != bInterfaceNumber) {
SAM("ERROR: attempting to reset "
"peasycap->audio_interface\n");
SAM("...... continuing with "
"%i=peasycap->audio_interface\n",
peasycap->audio_interface);
}
}
}
config_easycap(peasycap, bInterfaceNumber,
bInterfaceClass,
bInterfaceSubClass);

/*
* Investigate all altsettings. This is done in detail
Expand Down

0 comments on commit f99839a

Please sign in to comment.