[media] em28xx: fix Terratec Grabby AC97 codec detection
authorMatthieu Rogez <matthieu.rogez@gmail.com>
Fri, 4 Mar 2016 21:33:08 +0000 (18:33 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Sat, 5 Mar 2016 12:04:10 +0000 (09:04 -0300)
commit0899f62ff93f73860a23a4d4ac6921e3786b41d1
tree4d8c9bde09ecf1b80b544fcafe1f16bf6d3144c1
parent66c1db1bc5e1a21a358d084835a3eff1cf7d5b78
[media] em28xx: fix Terratec Grabby AC97 codec detection

EMP202 chip inside Terratec Grabby (hw rev 2) seems to require some time
before accessing reliably its registers. Otherwise it returns some values
previously put on the I2C bus.

To account for that period, we delay card setup until we have a proof that
accessing AC97 registers is reliable. We get this proof by polling
AC97_RESET until the expected value is read. We also check that unrelated
registers don't return the same value. This second check handles the case
where the expected value is constantly returned no matter which register
is accessed.

Signed-off-by: Matthieu Rogez <matthieu.rogez@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/usb/em28xx/em28xx-cards.c
This page took 0.024977 seconds and 5 git commands to generate.