[PATCH] Fix Terratec Grabby AC97 codec detection

From: Matthieu Rogez
Date: Fri Mar 04 2016 - 16:34:46 EST


Thanks Mauro for commenting on my work.
With respect to first version, I've:
* added a timeout mecanism as requested
* added an extra check to avoid cases when the same value is constantly
returned no matter which register is accessed.

---

To test this:
* modprobe em28xx-alsa
* connect Grabby
* mplayer tv:// -tv driver=v4l2:width=720:height=576:device=/dev/video1:input=0:fps=25:norm=SECAM-L:alsa:adevice=plughw.2:audiorate=48000:forceaudio:amode=1:immediatemode=0 -nocache -fps 60

NOTE: for some unknown reason, if em28xx-alsa is not loaded when Grabby is
connected, there will be no sound.
NOTE2: if Grabby is connected without loading em28xx-alsa first, just deconnect
the Grabby and reconnect it.