[PATCH 1/3] e4000: fix PLL calc bug on 32-bit arch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxx: fix trivial merge conflict]
Reported-by: Jacek Konieczny <jajcus@xxxxxxxxxx>
Reported-by: Torsten Seyffarth <t.seyffarth@xxxxxx>
Reported-by: Jan Taegert <jantaegert@xxxxxxx>
Reported-by: Damien CABROL <cabrol.damien@xxxxxxx>
Tested-by: Damien CABROL <cabrol.damien@xxxxxxx>
Tested-by: Jan Taegert <jantaegert@xxxxxxx>
Signed-off-by: Antti Palosaari <crope@xxxxxx>
---
 drivers/media/tuners/e4000.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/tuners/e4000.c b/drivers/media/tuners/e4000.c
index ad9309d..54e2d8a 100644
--- a/drivers/media/tuners/e4000.c
+++ b/drivers/media/tuners/e4000.c
@@ -233,7 +233,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;
-- 
1.7.11.7

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux