Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Michael Krufky and committed by
Mauro Carvalho Chehab
23a88108 6f4a5729

+37 -1
+18
drivers/media/video/tuner-simple.c
··· 714 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 733 static int simple_dvb_configure(struct dvb_frontend *fe, u8 *buf, 718 734 const struct dvb_frontend_parameters *params) 719 735 { ··· 752 736 buf[1] = div & 0xff; 753 737 buf[2] = config; 754 738 buf[3] = cb; 739 + 740 + simple_set_dvb(fe, buf, params); 755 741 756 742 tuner_dbg("%s: div=%d | buf=0x%02x,0x%02x,0x%02x,0x%02x\n", 757 743 tun->name, div, buf[0], buf[1], buf[2], buf[3]);
+18
drivers/media/video/tuner-types.c
··· 923 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 936 static struct tuner_params tuner_philips_fmd1216me_mk3_params[] = { 928 937 { ··· 944 935 .port2_fm_high_sensitivity = 1, 945 936 .port2_invert_for_secam_lc = 1, 946 937 .port1_set_for_fm_mono = 1, 938 + }, 939 + { 940 + .type = TUNER_PARAM_TYPE_DIGITAL, 941 + .ranges = tuner_philips_fmd1216me_mk3_dvb_ranges, 942 + .count = ARRAY_SIZE(tuner_philips_fmd1216me_mk3_dvb_ranges), 943 + .iffreq = 16 * 36.125, /*MHz*/ 947 944 }, 948 945 }; 949 946 ··· 1476 1461 .name = "Philips FMD1216ME MK3 Hybrid Tuner", 1477 1462 .params = tuner_philips_fmd1216me_mk3_params, 1478 1463 .count = ARRAY_SIZE(tuner_philips_fmd1216me_mk3_params), 1464 + .min = 16 * 50.87, 1465 + .max = 16 * 858.00, 1466 + .stepsize = 166667, 1479 1467 .initdata = tua603x_agc112, 1480 1468 .sleepdata = (u8[]){ 4, 0x9c, 0x60, 0x85, 0x54 }, 1481 1469 },
+1 -1
include/media/tuner-types.h
··· 119 119 120 120 u16 min; 121 121 u16 max; 122 - u16 stepsize; 122 + u32 stepsize; 123 123 124 124 u8 *initdata; 125 125 u8 *sleepdata;