提交 35c00c98 编写于 作者: A Antti Palosaari 提交者: Mauro Carvalho Chehab

[media] e4000: fix PLL calc bug on 32-bit arch

Fix long-lasting bug that causes tuning failure of some frequencies
on 32-bit arch.
Special thanks goes to Damien CABROL who finally find root of the bug.
Also big thanks to Jacek Konieczny for donating "non-working" device.

[crope@iki.fi: fix trivial merge conflict]
[m.chehab@samsung.com: add missing header file]
Reported-by: NJacek Konieczny <jajcus@jajcus.net>
Reported-by: NTorsten Seyffarth <t.seyffarth@gmx.de>
Reported-by: NJan Taegert <jantaegert@gmx.net>
Reported-by: NDamien CABROL <cabrol.damien@free.fr>
Tested-by: NDamien CABROL <cabrol.damien@free.fr>
Tested-by: NJan Taegert <jantaegert@gmx.net>
Signed-off-by: NAntti Palosaari <crope@iki.fi>
Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
上级 1558ec83
......@@ -19,6 +19,7 @@
*/
#include "e4000_priv.h"
#include <linux/math64.h>
/* write multiple registers */
static int e4000_wr_regs(struct e4000_priv *priv, u8 reg, u8 *val, int len)
......@@ -233,7 +234,7 @@ static int e4000_set_params(struct dvb_frontend *fe)
* or more.
*/
f_vco = c->frequency * e4000_pll_lut[i].mul;
sigma_delta = 0x10000UL * (f_vco % priv->cfg->clock) / priv->cfg->clock;
sigma_delta = div_u64(0x10000ULL * (f_vco % priv->cfg->clock), priv->cfg->clock);
buf[0] = f_vco / priv->cfg->clock;
buf[1] = (sigma_delta >> 0) & 0xff;
buf[2] = (sigma_delta >> 8) & 0xff;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册