Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 320703
b: refs/heads/master
c: adfe156
h: refs/heads/master
i:
  320701: 0d76097
  320699: 3c1617a
  320695: 46daf01
  320687: 8f2d5e9
  320671: 8072694
  320639: 4eae4a9
v: v3
  • Loading branch information
Mauro Carvalho Chehab committed Jul 31, 2012
1 parent ca8d300 commit 394a752
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4d98015eef6fa97b0cbba7310041ab75b223524b
refs/heads/master: adfe1560de1c696324554fba70c92f2d7c947ff7
8 changes: 5 additions & 3 deletions trunk/drivers/media/radio/radio-tea5777.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <media/v4l2-fh.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-event.h>
#include <asm/div64.h>
#include "radio-tea5777.h"

MODULE_AUTHOR("Hans de Goede <perex@perex.cz>");
Expand Down Expand Up @@ -158,10 +159,11 @@ static int radio_tea5777_set_freq(struct radio_tea5777 *tea)
int res;

freq = clamp_t(u32, tea->freq,
TEA5777_FM_RANGELOW, TEA5777_FM_RANGEHIGH);
freq = (freq + 8) / 16; /* to kHz */
TEA5777_FM_RANGELOW, TEA5777_FM_RANGEHIGH) + 8;
do_div(freq, 16); /* to kHz */

freq = (freq - TEA5777_FM_IF) / TEA5777_FM_FREQ_STEP;
freq -= TEA5777_FM_IF;
do_div(freq, TEA5777_FM_FREQ_STEP);

tea->write_reg &= ~(TEA5777_W_FM_PLL_MASK | TEA5777_W_FM_FREF_MASK);
tea->write_reg |= freq << TEA5777_W_FM_PLL_SHIFT;
Expand Down

0 comments on commit 394a752

Please sign in to comment.