summaryrefslogtreecommitdiff
path: root/drivers/media/tuners/fc2580.c
diff options
context:
space:
mode:
authorAntti Palosaari <crope@iki.fi>2015-05-03 15:16:52 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-05-18 15:56:46 -0300
commit8b302d43e84dc863729010a1ea9a5a2bc83d25de (patch)
treeea01caef9d9006fdadc9d0fb9dfe5428c78c3f82 /drivers/media/tuners/fc2580.c
parent7e33f8a282d4c98710db7423d637b799b52eb477 (diff)
[media] fc2580: calculate filter control word dynamically
Calculate low-pass filter control word dynamically from given radio channel bandwidth. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/tuners/fc2580.c')
-rw-r--r--drivers/media/tuners/fc2580.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/media/tuners/fc2580.c b/drivers/media/tuners/fc2580.c
index 08838b4b4821..30cee76b5f37 100644
--- a/drivers/media/tuners/fc2580.c
+++ b/drivers/media/tuners/fc2580.c
@@ -46,7 +46,7 @@ static int fc2580_set_params(struct dvb_frontend *fe)
int ret, i;
unsigned int uitmp, div_ref, div_ref_val, div_n, k, k_cw, div_out;
u64 f_vco;
- u8 u8tmp, synth_config;
+ u8 synth_config;
unsigned long timeout;
dev_dbg(&client->dev,
@@ -249,9 +249,9 @@ static int fc2580_set_params(struct dvb_frontend *fe)
if (ret)
goto err;
- u8tmp = div_u64((u64) dev->clk * fc2580_if_filter_lut[i].mul,
- 1000000000);
- ret = regmap_write(dev->regmap, 0x37, u8tmp);
+ uitmp = (unsigned int) 8058000 - (c->bandwidth_hz * 122 / 100 / 2);
+ uitmp = div64_u64((u64) dev->clk * uitmp, 1000000000000ULL);
+ ret = regmap_write(dev->regmap, 0x37, uitmp);
if (ret)
goto err;