upstream: [media] r820t: fix imr calibration
authorGianluca Gennari <gennarone@gmail.com>
Mon, 17 Jun 2013 23:32:45 +0000 (20:32 -0300)
committerChanho Park <chanho61.park@samsung.com>
Tue, 18 Nov 2014 02:48:31 +0000 (11:48 +0900)
commit6ed46e3677d4abe38233f29ff77099c64f589be2
treef621ade0310ec363e3cca5923786272b4a83eca8
parent96f81fa8ab442cf5c240c5cc88a35afb0f9d6e97
upstream: [media] r820t: fix imr calibration

The r820t_imr() calibration function of the Rafael Micro R820T tuner
generates this error at every tune attempt:
r820t 0-001a: No valid PLL values for 2252021 kHz!
The function was inspired by the original Realtek driver for rtl2832 devices
with the r820t tuner; anyway, in the original code the XTAL frequency of
the tuner was expressed in KHz, while in the kernel driver it is expressed
in Hz; so the calibration failed because of an out-of-range initial value.
The final result of the computation is then passed to the r820t_set_mux()
and r820t_set_pll() functions, but the conversion from KHz to Hz is already
correctly implemented.

Signed-off-by: Gianluca Gennari <gennarone@gmail.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/tuners/r820t.c