[media] Fix DVB-T frequency offset calculation
authorAbylay Ospan <aospan@netup.ru>
Wed, 20 Apr 2016 17:02:58 +0000 (14:02 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Tue, 7 Jun 2016 15:12:46 +0000 (12:12 -0300)
Fix offset calculation inside cxd2841er_get_carrier_offset_t
Now DVB-T should be tuned correctly

Signed-off-by: Abylay Ospan <aospan@netup.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/dvb-frontends/cxd2841er.c

index 94613af..609187d 100644 (file)
@@ -1116,6 +1116,8 @@ static int cxd2841er_get_carrier_offset_t(struct cxd2841er_priv *priv,
        *offset = -1 * sign_extend32(
                ((u32)(data[0] & 0x1F) << 24) | ((u32)data[1] << 16) |
                ((u32)data[2] << 8) | (u32)data[3], 29);
+    *offset *= (bandwidth / 1000000);
+    *offset /= 235;
        return 0;
 }