Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 330950
b: refs/heads/master
c: 4fad5c4
h: refs/heads/master
v: v3
  • Loading branch information
Hans de Goede authored and Mauro Carvalho Chehab committed Sep 13, 2012
1 parent d57aa86 commit c1e5911
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 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: fc488517cc0d50bcc9e4ffa90fee5755f9c914fc
refs/heads/master: 4fad5c474f9078dd133996cabaffdb5df8a1e28e
12 changes: 5 additions & 7 deletions trunk/drivers/media/radio/radio-tea5777.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#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 @@ -155,18 +154,17 @@ static u32 tea5777_freq_to_v4l2_freq(struct radio_tea5777 *tea, u32 freq)

static int radio_tea5777_set_freq(struct radio_tea5777 *tea)
{
u64 freq;
u32 freq;
int res;

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

freq -= TEA5777_FM_IF;
do_div(freq, TEA5777_FM_FREQ_STEP);
freq = (freq - TEA5777_FM_IF) / 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;
tea->write_reg |= (u64)freq << TEA5777_W_FM_PLL_SHIFT;
tea->write_reg |= TEA5777_W_FM_FREF_VALUE << TEA5777_W_FM_FREF_SHIFT;

res = tea->ops->write_reg(tea, tea->write_reg);
Expand Down

0 comments on commit c1e5911

Please sign in to comment.