media: au0828: Only alt setting logic when needed
authorMauro Carvalho Chehab <m.chehab@samsung.com>
Sun, 8 Jun 2014 16:54:57 +0000 (13:54 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Sep 2014 16:19:05 +0000 (09:19 -0700)
commitdccf12f4879e9462ab1ba8bfc760d7355765504b
treed74e57dde302b931ea6b6ac86d0c18a858fc3c7f
parent42d452afa6b8d1b5661c51c68f645d0d1183b6d6
media: au0828: Only alt setting logic when needed

commit 64ea37bbd8a5815522706f0099ad3f11c7537e15 upstream.

It seems that there's a bug at au0828 hardware/firmware
related to alternate setting: when the device is already at
alt 5, a further call causes the URBs to receive -ESHUTDOWN.

I found two different encarnations of this issue:

1) at qv4l2, it fails the second time we try to open the
video screen;
2) at xawtv, when audio underrun occurs, with is very
frequent, at least on my test machine.

The fix is simple: just check if alt=5 before calling
set_usb_interface().

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/usb/au0828/au0828-video.c