aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r--drivers/media/dvb/frontends/dvb-pll.c148
1 files changed, 75 insertions, 73 deletions
diff --git a/drivers/media/dvb/frontends/dvb-pll.c b/drivers/media/dvb/frontends/dvb-pll.c
index abc08f0ae197..35973e7faac3 100644
--- a/drivers/media/dvb/frontends/dvb-pll.c
+++ b/drivers/media/dvb/frontends/dvb-pll.c
@@ -44,11 +44,11 @@ struct dvb_pll_desc dvb_pll_thomson_dtt7579 = {
.max = 858000000,
.count = 5,
.entries = {
- { 0, 36166667, 166666, 0xb4, 0x03 }, /* go sleep */
- { 443250000, 36166667, 166666, 0xb4, 0x02 },
- { 542000000, 36166667, 166666, 0xb4, 0x08 },
- { 771000000, 36166667, 166666, 0xbc, 0x08 },
- { 999999999, 36166667, 166666, 0xf4, 0x08 },
+ { 0, 36166667, 166667, 0xb4, 0x03 }, /* go sleep */
+ { 443250000, 36166667, 166667, 0xb4, 0x02 },
+ { 542000000, 36166667, 166667, 0xb4, 0x08 },
+ { 771000000, 36166667, 166667, 0xbc, 0x08 },
+ { 999999999, 36166667, 166667, 0xf4, 0x08 },
},
};
EXPORT_SYMBOL(dvb_pll_thomson_dtt7579);
@@ -79,12 +79,12 @@ struct dvb_pll_desc dvb_pll_thomson_dtt759x = {
.setbw = thomson_dtt759x_bw,
.count = 6,
.entries = {
- { 0, 36166667, 166666, 0x84, 0x03 },
- { 264000000, 36166667, 166666, 0xb4, 0x02 },
- { 470000000, 36166667, 166666, 0xbc, 0x02 },
- { 735000000, 36166667, 166666, 0xbc, 0x08 },
- { 835000000, 36166667, 166666, 0xf4, 0x08 },
- { 999999999, 36166667, 166666, 0xfc, 0x08 },
+ { 0, 36166667, 166667, 0x84, 0x03 },
+ { 264000000, 36166667, 166667, 0xb4, 0x02 },
+ { 470000000, 36166667, 166667, 0xbc, 0x02 },
+ { 735000000, 36166667, 166667, 0xbc, 0x08 },
+ { 835000000, 36166667, 166667, 0xf4, 0x08 },
+ { 999999999, 36166667, 166667, 0xfc, 0x08 },
},
};
EXPORT_SYMBOL(dvb_pll_thomson_dtt759x);
@@ -95,12 +95,12 @@ struct dvb_pll_desc dvb_pll_lg_z201 = {
.max = 862000000,
.count = 6,
.entries = {
- { 0, 36166667, 166666, 0xbc, 0x03 },
- { 157500000, 36166667, 166666, 0xbc, 0x01 },
- { 443250000, 36166667, 166666, 0xbc, 0x02 },
- { 542000000, 36166667, 166666, 0xbc, 0x04 },
- { 830000000, 36166667, 166666, 0xf4, 0x04 },
- { 999999999, 36166667, 166666, 0xfc, 0x04 },
+ { 0, 36166667, 166667, 0xbc, 0x03 },
+ { 157500000, 36166667, 166667, 0xbc, 0x01 },
+ { 443250000, 36166667, 166667, 0xbc, 0x02 },
+ { 542000000, 36166667, 166667, 0xbc, 0x04 },
+ { 830000000, 36166667, 166667, 0xf4, 0x04 },
+ { 999999999, 36166667, 166667, 0xfc, 0x04 },
},
};
EXPORT_SYMBOL(dvb_pll_lg_z201);
@@ -139,15 +139,15 @@ struct dvb_pll_desc dvb_pll_unknown_1 = {
.max = 862000000,
.count = 9,
.entries = {
- { 150000000, 36166667, 166666, 0xb4, 0x01 },
- { 173000000, 36166667, 166666, 0xbc, 0x01 },
- { 250000000, 36166667, 166666, 0xb4, 0x02 },
- { 400000000, 36166667, 166666, 0xbc, 0x02 },
- { 420000000, 36166667, 166666, 0xf4, 0x02 },
- { 470000000, 36166667, 166666, 0xfc, 0x02 },
- { 600000000, 36166667, 166666, 0xbc, 0x08 },
- { 730000000, 36166667, 166666, 0xf4, 0x08 },
- { 999999999, 36166667, 166666, 0xfc, 0x08 },
+ { 150000000, 36166667, 166667, 0xb4, 0x01 },
+ { 173000000, 36166667, 166667, 0xbc, 0x01 },
+ { 250000000, 36166667, 166667, 0xb4, 0x02 },
+ { 400000000, 36166667, 166667, 0xbc, 0x02 },
+ { 420000000, 36166667, 166667, 0xf4, 0x02 },
+ { 470000000, 36166667, 166667, 0xfc, 0x02 },
+ { 600000000, 36166667, 166667, 0xbc, 0x08 },
+ { 730000000, 36166667, 166667, 0xf4, 0x08 },
+ { 999999999, 36166667, 166667, 0xfc, 0x08 },
},
};
EXPORT_SYMBOL(dvb_pll_unknown_1);
@@ -175,10 +175,10 @@ struct dvb_pll_desc dvb_pll_env57h1xd5 = {
.max = 858000000,
.count = 4,
.entries = {
- { 153000000, 36291666, 166666, 0xc2, 0x41 },
- { 470000000, 36291666, 166666, 0xc2, 0x42 },
- { 526000000, 36291666, 166666, 0xc2, 0x84 },
- { 999999999, 36291666, 166666, 0xc2, 0xa4 },
+ { 153000000, 36125000, 166667, 0xc2, 0x41 },
+ { 470000000, 36125000, 166667, 0xc2, 0x42 },
+ { 526000000, 36125000, 166667, 0xc2, 0x84 },
+ { 999999999, 36125000, 166667, 0xc2, 0xa4 },
},
};
EXPORT_SYMBOL(dvb_pll_env57h1xd5);
@@ -199,18 +199,18 @@ struct dvb_pll_desc dvb_pll_tda665x = {
.setbw = tda665x_bw,
.count = 12,
.entries = {
- { 93834000, 36249333, 166667, 0xca, 0x61 /* 011 0 0 0 01 */ },
- { 123834000, 36249333, 166667, 0xca, 0xa1 /* 101 0 0 0 01 */ },
- { 161000000, 36249333, 166667, 0xca, 0xa1 /* 101 0 0 0 01 */ },
- { 163834000, 36249333, 166667, 0xca, 0xc2 /* 110 0 0 0 10 */ },
- { 253834000, 36249333, 166667, 0xca, 0x62 /* 011 0 0 0 10 */ },
- { 383834000, 36249333, 166667, 0xca, 0xa2 /* 101 0 0 0 10 */ },
- { 443834000, 36249333, 166667, 0xca, 0xc2 /* 110 0 0 0 10 */ },
- { 444000000, 36249333, 166667, 0xca, 0xc4 /* 110 0 0 1 00 */ },
- { 583834000, 36249333, 166667, 0xca, 0x64 /* 011 0 0 1 00 */ },
- { 793834000, 36249333, 166667, 0xca, 0xa4 /* 101 0 0 1 00 */ },
- { 444834000, 36249333, 166667, 0xca, 0xc4 /* 110 0 0 1 00 */ },
- { 861000000, 36249333, 166667, 0xca, 0xe4 /* 111 0 0 1 00 */ },
+ { 93834000, 36166667, 166667, 0xca, 0x61 /* 011 0 0 0 01 */ },
+ { 123834000, 36166667, 166667, 0xca, 0xa1 /* 101 0 0 0 01 */ },
+ { 161000000, 36166667, 166667, 0xca, 0xa1 /* 101 0 0 0 01 */ },
+ { 163834000, 36166667, 166667, 0xca, 0xc2 /* 110 0 0 0 10 */ },
+ { 253834000, 36166667, 166667, 0xca, 0x62 /* 011 0 0 0 10 */ },
+ { 383834000, 36166667, 166667, 0xca, 0xa2 /* 101 0 0 0 10 */ },
+ { 443834000, 36166667, 166667, 0xca, 0xc2 /* 110 0 0 0 10 */ },
+ { 444000000, 36166667, 166667, 0xca, 0xc4 /* 110 0 0 1 00 */ },
+ { 583834000, 36166667, 166667, 0xca, 0x64 /* 011 0 0 1 00 */ },
+ { 793834000, 36166667, 166667, 0xca, 0xa4 /* 101 0 0 1 00 */ },
+ { 444834000, 36166667, 166667, 0xca, 0xc4 /* 110 0 0 1 00 */ },
+ { 861000000, 36166667, 166667, 0xca, 0xe4 /* 111 0 0 1 00 */ },
}
};
EXPORT_SYMBOL(dvb_pll_tda665x);
@@ -271,13 +271,13 @@ struct dvb_pll_desc dvb_pll_fmd1216me = {
.setbw = fmd1216me_bw,
.count = 7,
.entries = {
- { 143870000, 36213333, 166667, 0xbc, 0x41 },
- { 158870000, 36213333, 166667, 0xf4, 0x41 },
- { 329870000, 36213333, 166667, 0xbc, 0x42 },
- { 441870000, 36213333, 166667, 0xf4, 0x42 },
- { 625870000, 36213333, 166667, 0xbc, 0x44 },
- { 803870000, 36213333, 166667, 0xf4, 0x44 },
- { 999999999, 36213333, 166667, 0xfc, 0x44 },
+ { 143870000, 36125000, 166667, 0xbc, 0x41 },
+ { 158870000, 36125000, 166667, 0xf4, 0x41 },
+ { 329870000, 36125000, 166667, 0xbc, 0x42 },
+ { 441870000, 36125000, 166667, 0xf4, 0x42 },
+ { 625870000, 36125000, 166667, 0xbc, 0x44 },
+ { 803870000, 36125000, 166667, 0xf4, 0x44 },
+ { 999999999, 36125000, 166667, 0xfc, 0x44 },
}
};
EXPORT_SYMBOL(dvb_pll_fmd1216me);
@@ -348,12 +348,12 @@ struct dvb_pll_desc dvb_pll_samsung_tbmv = {
.max = 860000000,
.count = 6,
.entries = {
- { 172000000, 44000000, 166666, 0xb4, 0x01 },
- { 214000000, 44000000, 166666, 0xb4, 0x02 },
- { 467000000, 44000000, 166666, 0xbc, 0x02 },
- { 721000000, 44000000, 166666, 0xbc, 0x08 },
- { 841000000, 44000000, 166666, 0xf4, 0x08 },
- { 999999999, 44000000, 166666, 0xfc, 0x02 },
+ { 172000000, 44000000, 166667, 0xb4, 0x01 },
+ { 214000000, 44000000, 166667, 0xb4, 0x02 },
+ { 467000000, 44000000, 166667, 0xbc, 0x02 },
+ { 721000000, 44000000, 166667, 0xbc, 0x08 },
+ { 841000000, 44000000, 166667, 0xf4, 0x08 },
+ { 999999999, 44000000, 166667, 0xfc, 0x02 },
}
};
EXPORT_SYMBOL(dvb_pll_samsung_tbmv);
@@ -367,10 +367,11 @@ struct dvb_pll_desc dvb_pll_philips_sd1878_tda8261 = {
.max = 2150000,
.count = 4,
.entries = {
- { 1250000, 499, 500, 0xc4, 0x00},
- { 1550000, 499, 500, 0xc4, 0x40},
- { 2050000, 499, 500, 0xc4, 0x80},
- { 2150000, 499, 500, 0xc4, 0xc0},
+ /* zero-IF, offset 249 is to round up */
+ { 1250000, 249, 500, 0xc4, 0x00},
+ { 1550000, 249, 500, 0xc4, 0x40},
+ { 2050000, 249, 500, 0xc4, 0x80},
+ { 2150000, 249, 500, 0xc4, 0xc0},
},
};
EXPORT_SYMBOL(dvb_pll_philips_sd1878_tda8261);
@@ -404,15 +405,15 @@ struct dvb_pll_desc dvb_pll_philips_td1316 = {
.setbw = td1316_bw,
.count = 9,
.entries = {
- { 93834000, 36166000, 166666, 0xca, 0x60},
- { 123834000, 36166000, 166666, 0xca, 0xa0},
- { 163834000, 36166000, 166666, 0xca, 0xc0},
- { 253834000, 36166000, 166666, 0xca, 0x60},
- { 383834000, 36166000, 166666, 0xca, 0xa0},
- { 443834000, 36166000, 166666, 0xca, 0xc0},
- { 583834000, 36166000, 166666, 0xca, 0x60},
- { 793834000, 36166000, 166666, 0xca, 0xa0},
- { 858834000, 36166000, 166666, 0xca, 0xe0},
+ { 93834000, 36166667, 166667, 0xca, 0x60},
+ { 123834000, 36166667, 166667, 0xca, 0xa0},
+ { 163834000, 36166667, 166667, 0xca, 0xc0},
+ { 253834000, 36166667, 166667, 0xca, 0x60},
+ { 383834000, 36166667, 166667, 0xca, 0xa0},
+ { 443834000, 36166667, 166667, 0xca, 0xc0},
+ { 583834000, 36166667, 166667, 0xca, 0x60},
+ { 793834000, 36166667, 166667, 0xca, 0xa0},
+ { 858834000, 36166667, 166667, 0xca, 0xe0},
},
};
EXPORT_SYMBOL(dvb_pll_philips_td1316);
@@ -424,10 +425,10 @@ struct dvb_pll_desc dvb_pll_thomson_fe6600 = {
.max = 858000000,
.count = 4,
.entries = {
- { 250000000, 36213333, 166667, 0xb4, 0x12 },
- { 455000000, 36213333, 166667, 0xfe, 0x11 },
- { 775500000, 36213333, 166667, 0xbc, 0x18 },
- { 999999999, 36213333, 166667, 0xf4, 0x18 },
+ { 250000000, 36125000, 166667, 0xb4, 0x12 },
+ { 455000000, 36125000, 166667, 0xfe, 0x11 },
+ { 775500000, 36125000, 166667, 0xbc, 0x18 },
+ { 999999999, 36125000, 166667, 0xf4, 0x18 },
}
};
EXPORT_SYMBOL(dvb_pll_thomson_fe6600);
@@ -472,7 +473,8 @@ int dvb_pll_configure(struct dvb_pll_desc *desc, u8 *buf,
if (i == desc->count)
return -EINVAL;
- div = (freq + desc->entries[i].offset) / desc->entries[i].stepsize;
+ div = (freq + desc->entries[i].offset + desc->entries[i].stepsize/2) /
+ desc->entries[i].stepsize;
buf[0] = div >> 8;
buf[1] = div & 0xff;
buf[2] = desc->entries[i].config;