diff options
author | Michael Krufky <mkrufky@linuxtv.org> | 2008-04-22 13:45:53 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-04-24 13:07:50 -0400 |
commit | 23a88108cf6d5fa8073a3b2af804fff7305e86e3 (patch) | |
tree | b7bf10eb06237c13d4ea69d8d46637b14e939d93 | |
parent | 6f4a57292f4f0a0fef5e4e39cb394fedcf2acf9f (diff) |
V4L/DVB (7352): tuner-simple: enable digital tuning support for Philips FMD1216ME
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>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r-- | drivers/media/video/tuner-simple.c | 18 | ||||
-rw-r--r-- | drivers/media/video/tuner-types.c | 18 | ||||
-rw-r--r-- | include/media/tuner-types.h | 2 |
3 files changed, 37 insertions, 1 deletions
diff --git a/drivers/media/video/tuner-simple.c b/drivers/media/video/tuner-simple.c index 3a27d4a8ce38..b6587300bb8f 100644 --- a/drivers/media/video/tuner-simple.c +++ b/drivers/media/video/tuner-simple.c | |||
@@ -714,6 +714,22 @@ static int simple_set_params(struct dvb_frontend *fe, | |||
714 | return ret; | 714 | return ret; |
715 | } | 715 | } |
716 | 716 | ||
717 | static void simple_set_dvb(struct dvb_frontend *fe, u8 *buf, | ||
718 | const struct dvb_frontend_parameters *params) | ||
719 | { | ||
720 | struct tuner_simple_priv *priv = fe->tuner_priv; | ||
721 | |||
722 | switch (priv->type) { | ||
723 | case TUNER_PHILIPS_FMD1216ME_MK3: | ||
724 | if (params->u.ofdm.bandwidth == BANDWIDTH_8_MHZ && | ||
725 | params->frequency >= 158870000) | ||
726 | buf[3] |= 0x08; | ||
727 | break; | ||
728 | default: | ||
729 | break; | ||
730 | } | ||
731 | } | ||
732 | |||
717 | static int simple_dvb_configure(struct dvb_frontend *fe, u8 *buf, | 733 | static int simple_dvb_configure(struct dvb_frontend *fe, u8 *buf, |
718 | const struct dvb_frontend_parameters *params) | 734 | const struct dvb_frontend_parameters *params) |
719 | { | 735 | { |
@@ -737,6 +753,8 @@ static int simple_dvb_configure(struct dvb_frontend *fe, u8 *buf, | |||
737 | buf[2] = config; | 753 | buf[2] = config; |
738 | buf[3] = cb; | 754 | buf[3] = cb; |
739 | 755 | ||
756 | simple_set_dvb(fe, buf, params); | ||
757 | |||
740 | tuner_dbg("%s: div=%d | buf=0x%02x,0x%02x,0x%02x,0x%02x\n", | 758 | tuner_dbg("%s: div=%d | buf=0x%02x,0x%02x,0x%02x,0x%02x\n", |
741 | tun->name, div, buf[0], buf[1], buf[2], buf[3]); | 759 | tun->name, div, buf[0], buf[1], buf[2], buf[3]); |
742 | 760 | ||
diff --git a/drivers/media/video/tuner-types.c b/drivers/media/video/tuner-types.c index 13c76a57d8e2..f2e6630731bf 100644 --- a/drivers/media/video/tuner-types.c +++ b/drivers/media/video/tuner-types.c | |||
@@ -923,6 +923,15 @@ static struct tuner_range tuner_philips_fmd1216me_mk3_pal_ranges[] = { | |||
923 | { 16 * 999.99 , 0x86, 0x54, }, | 923 | { 16 * 999.99 , 0x86, 0x54, }, |
924 | }; | 924 | }; |
925 | 925 | ||
926 | static struct tuner_range tuner_philips_fmd1216me_mk3_dvb_ranges[] = { | ||
927 | { 16 * 143.87 /*MHz*/, 0xbc, 0x41 }, | ||
928 | { 16 * 158.87 /*MHz*/, 0xf4, 0x41 }, | ||
929 | { 16 * 329.87 /*MHz*/, 0xbc, 0x42 }, | ||
930 | { 16 * 441.87 /*MHz*/, 0xf4, 0x42 }, | ||
931 | { 16 * 625.87 /*MHz*/, 0xbc, 0x44 }, | ||
932 | { 16 * 803.87 /*MHz*/, 0xf4, 0x44 }, | ||
933 | { 16 * 999.99 , 0xfc, 0x44 }, | ||
934 | }; | ||
926 | 935 | ||
927 | static struct tuner_params tuner_philips_fmd1216me_mk3_params[] = { | 936 | static struct tuner_params tuner_philips_fmd1216me_mk3_params[] = { |
928 | { | 937 | { |
@@ -936,6 +945,12 @@ static struct tuner_params tuner_philips_fmd1216me_mk3_params[] = { | |||
936 | .port2_invert_for_secam_lc = 1, | 945 | .port2_invert_for_secam_lc = 1, |
937 | .port1_set_for_fm_mono = 1, | 946 | .port1_set_for_fm_mono = 1, |
938 | }, | 947 | }, |
948 | { | ||
949 | .type = TUNER_PARAM_TYPE_DIGITAL, | ||
950 | .ranges = tuner_philips_fmd1216me_mk3_dvb_ranges, | ||
951 | .count = ARRAY_SIZE(tuner_philips_fmd1216me_mk3_dvb_ranges), | ||
952 | .iffreq = 16 * 36.125, /*MHz*/ | ||
953 | }, | ||
939 | }; | 954 | }; |
940 | 955 | ||
941 | 956 | ||
@@ -1461,6 +1476,9 @@ struct tunertype tuners[] = { | |||
1461 | .name = "Philips FMD1216ME MK3 Hybrid Tuner", | 1476 | .name = "Philips FMD1216ME MK3 Hybrid Tuner", |
1462 | .params = tuner_philips_fmd1216me_mk3_params, | 1477 | .params = tuner_philips_fmd1216me_mk3_params, |
1463 | .count = ARRAY_SIZE(tuner_philips_fmd1216me_mk3_params), | 1478 | .count = ARRAY_SIZE(tuner_philips_fmd1216me_mk3_params), |
1479 | .min = 16 * 50.87, | ||
1480 | .max = 16 * 858.00, | ||
1481 | .stepsize = 166667, | ||
1464 | .initdata = tua603x_agc112, | 1482 | .initdata = tua603x_agc112, |
1465 | .sleepdata = (u8[]){ 4, 0x9c, 0x60, 0x85, 0x54 }, | 1483 | .sleepdata = (u8[]){ 4, 0x9c, 0x60, 0x85, 0x54 }, |
1466 | }, | 1484 | }, |
diff --git a/include/media/tuner-types.h b/include/media/tuner-types.h index fda12093cab3..ab03c5344209 100644 --- a/include/media/tuner-types.h +++ b/include/media/tuner-types.h | |||
@@ -119,7 +119,7 @@ struct tunertype { | |||
119 | 119 | ||
120 | u16 min; | 120 | u16 min; |
121 | u16 max; | 121 | u16 max; |
122 | u16 stepsize; | 122 | u32 stepsize; |
123 | 123 | ||
124 | u8 *initdata; | 124 | u8 *initdata; |
125 | u8 *sleepdata; | 125 | u8 *sleepdata; |