aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca/gspca.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2011-12-30 16:26:53 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-01-06 06:05:01 -0500
commit2d39059a656c0d0f61cfee8225f3d222dac7f3ac (patch)
tree6e8a5009a07d3ac04531b888894cbca0283e5e1f /drivers/media/video/gspca/gspca.c
parent5dae603d84ff5b6b24186b521f4353b3860b11e2 (diff)
[media] gspca - main: Avoid clobbering all bandwidth when mic in webcam
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jean-François Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/gspca/gspca.c')
-rw-r--r--drivers/media/video/gspca/gspca.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c
index 338dae448787..4a3bbffafcd4 100644
--- a/drivers/media/video/gspca/gspca.c
+++ b/drivers/media/video/gspca/gspca.c
@@ -726,6 +726,23 @@ static int build_isoc_ep_tb(struct gspca_dev *gspca_dev,
726 ep_tb++; 726 ep_tb++;
727 } 727 }
728 728
729 /*
730 * If the camera:
731 * has a usb audio class interface (a built in usb mic); and
732 * is a usb 1 full speed device; and
733 * uses the max full speed iso bandwidth; and
734 * and has more than 1 alt setting
735 * then skip the highest alt setting to spare bandwidth for the mic
736 */
737 if (gspca_dev->audio &&
738 gspca_dev->dev->speed == USB_SPEED_FULL &&
739 last_bw >= 1000000 &&
740 i > 1) {
741 PDEBUG(D_STREAM, "dev has usb audio, skipping highest alt");
742 i--;
743 ep_tb--;
744 }
745
729 /* get the requested bandwidth and start at the highest atlsetting */ 746 /* get the requested bandwidth and start at the highest atlsetting */
730 bandwidth = which_bandwidth(gspca_dev); 747 bandwidth = which_bandwidth(gspca_dev);
731 ep_tb--; 748 ep_tb--;