summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2008-02-03 14:08:13 -0500
committerMichael Krufky <mkrufky@linuxtv.org>2008-02-03 14:08:13 -0500
commit2657086110540fc8cdf1b8a697efffa612bb1558 (patch)
treee0ae8735fc6d8f3cb8bfd733b3fa22c6e044811c /linux
parent920c05269077f000f4ce7a1dc3e11b57ab5000e8 (diff)
downloadmediapointer-dvb-s2-2657086110540fc8cdf1b8a697efffa612bb1558.tar.gz
mediapointer-dvb-s2-2657086110540fc8cdf1b8a697efffa612bb1558.tar.bz2
tuner-simple: enable digital tuning support for Philips FMD1216ME
From: Michael Krufky <mkrufky@linuxtv.org> Enable digital tuning support within tuner-simple. This will allow for a single tuner module to manage the hardware, without having dvb-pll loaded. Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Diffstat (limited to 'linux')
-rw-r--r--linux/drivers/media/video/tuner-simple.c18
-rw-r--r--linux/drivers/media/video/tuner-types.c19
-rw-r--r--linux/include/media/tuner-types.h2
3 files changed, 32 insertions, 7 deletions
diff --git a/linux/drivers/media/video/tuner-simple.c b/linux/drivers/media/video/tuner-simple.c
index 54177c67e..4d4d9984a 100644
--- a/linux/drivers/media/video/tuner-simple.c
+++ b/linux/drivers/media/video/tuner-simple.c
@@ -741,6 +741,22 @@ static int simple_set_params(struct dvb_frontend *fe,
return ret;
}
+static void simple_set_dvb(struct dvb_frontend *fe, u8 *buf,
+ const struct dvb_frontend_parameters *params)
+{
+ struct tuner_simple_priv *priv = fe->tuner_priv;
+
+ switch (priv->type) {
+ case TUNER_PHILIPS_FMD1216ME_MK3:
+ if (params->u.ofdm.bandwidth == BANDWIDTH_8_MHZ &&
+ params->frequency >= 158870000)
+ buf[3] |= 0x08;
+ break;
+ default:
+ break;
+ }
+}
+
static int simple_dvb_configure(struct dvb_frontend *fe, u8 *buf,
const struct dvb_frontend_parameters *params)
{
@@ -764,6 +780,8 @@ static int simple_dvb_configure(struct dvb_frontend *fe, u8 *buf,
buf[2] = config;
buf[3] = cb;
+ simple_set_dvb(fe, buf, params);
+
tuner_dbg("%s: div=%d | buf=0x%02x,0x%02x,0x%02x,0x%02x\n",
tun->name, div, buf[0], buf[1], buf[2], buf[3]);
diff --git a/linux/drivers/media/video/tuner-types.c b/linux/drivers/media/video/tuner-types.c
index efecec98b..0ea7b791c 100644
--- a/linux/drivers/media/video/tuner-types.c
+++ b/linux/drivers/media/video/tuner-types.c
@@ -924,10 +924,15 @@ static struct tuner_range tuner_philips_fmd1216me_mk3_pal_ranges[] = {
{ 16 * 999.99 , 0x86, 0x54, },
};
-#if 0
static struct tuner_range tuner_philips_fmd1216me_mk3_dvb_ranges[] = {
+ { 16 * 143.87 /*MHz*/, 0xbc, 0x41 },
+ { 16 * 158.87 /*MHz*/, 0xf4, 0x41 },
+ { 16 * 329.87 /*MHz*/, 0xbc, 0x42 },
+ { 16 * 441.87 /*MHz*/, 0xf4, 0x42 },
+ { 16 * 625.87 /*MHz*/, 0xbc, 0x44 },
+ { 16 * 803.87 /*MHz*/, 0xf4, 0x44 },
+ { 16 * 999.99 , 0xfc, 0x44 },
};
-#endif
static struct tuner_params tuner_philips_fmd1216me_mk3_params[] = {
{
@@ -941,13 +946,12 @@ static struct tuner_params tuner_philips_fmd1216me_mk3_params[] = {
.port2_invert_for_secam_lc = 1,
.port1_set_for_fm_mono = 1,
},
-#if 0
{
- .type = TUNER_PARAM_TYPE_DVB,
+ .type = TUNER_PARAM_TYPE_DIGITAL,
.ranges = tuner_philips_fmd1216me_mk3_dvb_ranges,
- .count = ARRAY_SIZE(tuner_philips_fmd1216me_mk3_pal_ranges),
+ .count = ARRAY_SIZE(tuner_philips_fmd1216me_mk3_dvb_ranges),
+ .iffreq = 16 * 36.125, /*MHz*/
},
-#endif
};
@@ -1484,6 +1488,9 @@ struct tunertype tuners[] = {
.name = "Philips FMD1216ME MK3 Hybrid Tuner",
.params = tuner_philips_fmd1216me_mk3_params,
.count = ARRAY_SIZE(tuner_philips_fmd1216me_mk3_params),
+ .min = 16 * 50.87,
+ .max = 16 * 858.00,
+ .stepsize = 166667,
.initdata = tua603x_agc112,
.sleepdata = (u8[]){ 4, 0x9c, 0x60, 0x85, 0x54 },
},
diff --git a/linux/include/media/tuner-types.h b/linux/include/media/tuner-types.h
index 374678b31..0e43f74d8 100644
--- a/linux/include/media/tuner-types.h
+++ b/linux/include/media/tuner-types.h
@@ -122,7 +122,7 @@ struct tunertype {
u16 min;
u16 max;
- u16 stepsize;
+ u32 stepsize;
u8 *initdata;
u8 *sleepdata;