Skip to content

Commit

Permalink
[media] xc4000: fixed frequency error
Browse files Browse the repository at this point in the history
The xc_get_frequency_error() function reported the frequency error
incorrectly. The data read from the hardware is a signed integer, in
15625 Hz units. The attached patch fixes the bug.

Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Istvan Varga authored and Mauro Carvalho Chehab committed Jul 27, 2011
1 parent 5614942 commit 1368ceb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/media/common/tuners/xc4000.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,9 @@ static int xc_get_frequency_error(struct xc4000_priv *priv, u32 *freq_error_hz)
if (result != XC_RESULT_SUCCESS)
return result;

tmp = (u32)regData;
(*freq_error_hz) = (tmp * 15625) / 1000;
tmp = (u32)regData & 0xFFFFU;
tmp = (tmp < 0x8000U ? tmp : 0x10000U - tmp);
(*freq_error_hz) = tmp * 15625;
return result;
}

Expand Down

0 comments on commit 1368ceb

Please sign in to comment.