]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
V4L/DVB (5374): Or51132: refactor i2c code, improve error resilience
authorTrent Piepho <xyzzy@speakeasy.org>
Fri, 2 Mar 2007 22:42:21 +0000 (19:42 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Fri, 27 Apr 2007 18:44:09 +0000 (15:44 -0300)
commitd9e54324d03add27990ac27fcb34a1ae7a0f97ef
treee13d27678b2c33464266f23fd1ae085eb9eb0afd
parent387e69adff3d441616b45002ff85c5b36001be9e
V4L/DVB (5374): Or51132: refactor i2c code, improve error resilience

The code the i2c transactions was leftover from the old V4L-based ATSC
driver.  It did too little with too much code.  It is re-written to
remove unnecessary parameters and be more efficient.  A demod register
can now be read with one function call, instead of repeating a dozen line
block of code each time.

There were msleep()'s, which appear to be unnecessary, spread around all
the I2C transactions.  These have been removed.  Reading SNR used to take
about 130 ms, now it's down to 1.8 ms.

Reads from the demodulator's registers do not return correct results
sometimes.  Adding or removing the delays in the I2C transactions did not
appear to effect the probability of failure.  If anything, the
transactions without delays were less likely to fail, but since far more
transactions could be made per second the number of failures per hour was
greater.

To increase reliability, the SNR and get_params functions will now retry
once if they get bad data back.  This appears to have reduced the
probability of failure to effectively zero.
Some error messages are cleaned up or given KERN_* levels when they were
missing.

or51132_setmode() wasn't returning correct error codes, which is fixed as
well.

CC: Rusty Scott <rustys@ieee.org>
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/dvb/frontends/or51132.c