From 379f25b504af0554e26318ba7af948d3e2a00b54 Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Fri, 13 Oct 2006 21:18:01 -0400 Subject: dvb-pll: add support for Philips fcv1236d From: Michael Krufky This patch adds support to the dvb-pll library for the Philips fcv1236d tuner, based on the FCV1236D datasheet. Signed-off-by: Michael Krufky --- linux/drivers/media/dvb/frontends/dvb-pll.c | 19 +++++++++++++++++++ linux/drivers/media/dvb/frontends/dvb-pll.h | 1 + 2 files changed, 20 insertions(+) (limited to 'linux') diff --git a/linux/drivers/media/dvb/frontends/dvb-pll.c b/linux/drivers/media/dvb/frontends/dvb-pll.c index 01a11262c..f3d500eb5 100644 --- a/linux/drivers/media/dvb/frontends/dvb-pll.c +++ b/linux/drivers/media/dvb/frontends/dvb-pll.c @@ -499,6 +499,24 @@ static struct dvb_pll_desc dvb_pll_opera1 = { } }; +/* Philips FCV1236D + */ +struct dvb_pll_desc dvb_pll_fcv1236d = { +/* Bit_0: RF Input select + * Bit_1: 0=digital, 1=analog + */ + .name = "Philips FCV1236D", + .min = 53000000, + .max = 803000000, + .iffreq= 44000000, + .count = 3, + .entries = { + { 159000000, 62500, 0x8e, 0xa0 }, + { 453000000, 62500, 0x8e, 0x90 }, + { 999999999, 62500, 0x8e, 0x30 }, + }, +}; + /* ----------------------------------------------------------- */ static struct dvb_pll_desc *pll_list[] = { @@ -524,6 +542,7 @@ static struct dvb_pll_desc *pll_list[] = { [DVB_PLL_PHILIPS_TD1316] = &dvb_pll_philips_td1316, [DVB_PLL_THOMSON_FE6600] = &dvb_pll_thomson_fe6600, [DVB_PLL_OPERA1] = &dvb_pll_opera1, + [DVB_PLL_FCV1236D] = &dvb_pll_fcv1236d, }; /* ----------------------------------------------------------- */ diff --git a/linux/drivers/media/dvb/frontends/dvb-pll.h b/linux/drivers/media/dvb/frontends/dvb-pll.h index 66464e1e1..e93a81040 100644 --- a/linux/drivers/media/dvb/frontends/dvb-pll.h +++ b/linux/drivers/media/dvb/frontends/dvb-pll.h @@ -30,6 +30,7 @@ #define DVB_PLL_PHILIPS_TD1316 19 #define DVB_PLL_THOMSON_FE6600 20 #define DVB_PLL_OPERA1 21 +#define DVB_PLL_FCV1236D 22 /** * Attach a dvb-pll to the supplied frontend structure. -- cgit v1.2.3 From 59c02b1364f4d73f41b9af2f29bf5a5d781b20cc Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Sun, 24 Jun 2007 17:14:52 -0400 Subject: or51211: remove hardcoded fcv1236d tuner programming From: Michael Krufky - Remove hardcoded fcv1236d tuner programmming from or51211.c - Alter dvb-bt8xx for the pcHDTV-2000 to use dvb-pll for fcv1236d support. Thanks to Jarom Hatch for testing this change. Signed-off-by: Michael Krufky Cc: Jarom Hatch --- linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c | 3 +++ linux/drivers/media/dvb/frontends/or51211.c | 31 +++-------------------------- 2 files changed, 6 insertions(+), 28 deletions(-) (limited to 'linux') diff --git a/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c index 585bf013d..c337c966a 100644 --- a/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c +++ b/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c @@ -693,6 +693,9 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type) case BTTV_BOARD_PC_HDTV: card->fe = dvb_attach(or51211_attach, &or51211_config, card->i2c_adapter); + if (card->fe != NULL) + dvb_attach(dvb_pll_attach, card->fe, 0x61, + card->i2c_adapter, DVB_PLL_FCV1236D); break; } diff --git a/linux/drivers/media/dvb/frontends/or51211.c b/linux/drivers/media/dvb/frontends/or51211.c index 048d7cfe1..f46d5a466 100644 --- a/linux/drivers/media/dvb/frontends/or51211.c +++ b/linux/drivers/media/dvb/frontends/or51211.c @@ -223,38 +223,13 @@ static int or51211_set_parameters(struct dvb_frontend* fe, struct dvb_frontend_parameters *param) { struct or51211_state* state = fe->demodulator_priv; - u32 freq = 0; - u16 tunerfreq = 0; - u8 buf[4]; /* Change only if we are actually changing the channel */ if (state->current_frequency != param->frequency) { - freq = 44000 + (param->frequency/1000); - tunerfreq = freq * 16/1000; - - dprintk("set_parameters frequency = %d (tunerfreq = %d)\n", - param->frequency,tunerfreq); - - buf[0] = (tunerfreq >> 8) & 0x7F; - buf[1] = (tunerfreq & 0xFF); - buf[2] = 0x8E; - - if (param->frequency < 157250000) { - buf[3] = 0xA0; - dprintk("set_parameters VHF low range\n"); - } else if (param->frequency < 454000000) { - buf[3] = 0x90; - dprintk("set_parameters VHF high range\n"); - } else { - buf[3] = 0x30; - dprintk("set_parameters UHF range\n"); + if (fe->ops.tuner_ops.set_params) { + fe->ops.tuner_ops.set_params(fe, param); + if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0); } - dprintk("set_parameters tuner bytes: 0x%02x 0x%02x " - "0x%02x 0x%02x\n",buf[0],buf[1],buf[2],buf[3]); - - if (i2c_writebytes(state,0xC2>>1,buf,4)) - printk(KERN_WARNING "or51211:set_parameters error " - "writing to tuner\n"); /* Set to ATSC mode */ or51211_setmode(fe,0); -- cgit v1.2.3 From 5681c905180f06bc65b2fdec95008d9283c72e1a Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Wed, 27 Jun 2007 13:38:45 -0400 Subject: tuner: correct description of Philips FCV1236D tuner From: Michael Krufky The old description was "Philips 1236D ATSC/NTSC dual in", which can be confused with other Philips tuner models. This patch corrects the name to "Philips FCV1236D ATSC/NTSC dual in", and updates the range and params array names to match the description. Signed-off-by: Michael Krufky --- linux/Documentation/video4linux/CARDLIST.tuner | 2 +- linux/drivers/media/video/tuner-types.c | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'linux') diff --git a/linux/Documentation/video4linux/CARDLIST.tuner b/linux/Documentation/video4linux/CARDLIST.tuner index 9b02dbb2a..a88c02d23 100644 --- a/linux/Documentation/video4linux/CARDLIST.tuner +++ b/linux/Documentation/video4linux/CARDLIST.tuner @@ -40,7 +40,7 @@ tuner=38 - Philips PAL/SECAM multi (FM1216ME MK3) tuner=39 - LG NTSC (newer TAPC series) tuner=40 - HITACHI V7-J180AT tuner=41 - Philips PAL_MK (FI1216 MK) -tuner=42 - Philips 1236D ATSC/NTSC dual in +tuner=42 - Philips FCV1236D ATSC/NTSC dual in tuner=43 - Philips NTSC MK3 (FM1236MK3 or FM1236/F) tuner=44 - Philips 4 in 1 (ATI TV Wonder Pro/Conexant) tuner=45 - Microtune 4049 FM5 diff --git a/linux/drivers/media/video/tuner-types.c b/linux/drivers/media/video/tuner-types.c index c644397b1..27e2909df 100644 --- a/linux/drivers/media/video/tuner-types.c +++ b/linux/drivers/media/video/tuner-types.c @@ -595,19 +595,19 @@ static struct tuner_params tuner_philips_pal_mk_params[] = { }, }; -/* ------------ TUNER_PHILIPS_ATSC - Philips ATSC ------------ */ +/* ---- TUNER_PHILIPS_ATSC - Philips FCV1236D (ATSC/NTSC) ---- */ -static struct tuner_range tuner_philips_atsc_ranges[] = { +static struct tuner_range tuner_philips_fcv1236d_ranges[] = { { 16 * 157.25 /*MHz*/, 0x8e, 0xa0, }, { 16 * 454.00 /*MHz*/, 0x8e, 0x90, }, { 16 * 999.99 , 0x8e, 0x30, }, }; -static struct tuner_params tuner_philips_atsc_params[] = { +static struct tuner_params tuner_philips_fcv1236d_params[] = { { .type = TUNER_PARAM_TYPE_NTSC, - .ranges = tuner_philips_atsc_ranges, - .count = ARRAY_SIZE(tuner_philips_atsc_ranges), + .ranges = tuner_philips_fcv1236d_ranges, + .count = ARRAY_SIZE(tuner_philips_fcv1236d_ranges), }, }; @@ -1344,9 +1344,9 @@ struct tunertype tuners[] = { .count = ARRAY_SIZE(tuner_philips_pal_mk_params), }, [TUNER_PHILIPS_ATSC] = { /* Philips ATSC */ - .name = "Philips 1236D ATSC/NTSC dual in", - .params = tuner_philips_atsc_params, - .count = ARRAY_SIZE(tuner_philips_atsc_params), + .name = "Philips FCV1236D ATSC/NTSC dual in", + .params = tuner_philips_fcv1236d_params, + .count = ARRAY_SIZE(tuner_philips_fcv1236d_params), }, [TUNER_PHILIPS_FM1236_MK3] = { /* Philips NTSC */ .name = "Philips NTSC MK3 (FM1236MK3 or FM1236/F)", -- cgit v1.2.3 From 185208d63cd4a30f46c3379e9de694ea93508306 Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Wed, 27 Jun 2007 15:26:32 -0400 Subject: tuner: update FCV1236D ranges to match the datasheet From: Michael Krufky Signed-off-by: Michael Krufky --- linux/drivers/media/video/tuner-types.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linux') diff --git a/linux/drivers/media/video/tuner-types.c b/linux/drivers/media/video/tuner-types.c index 27e2909df..ea9ae6e47 100644 --- a/linux/drivers/media/video/tuner-types.c +++ b/linux/drivers/media/video/tuner-types.c @@ -599,7 +599,7 @@ static struct tuner_params tuner_philips_pal_mk_params[] = { static struct tuner_range tuner_philips_fcv1236d_ranges[] = { { 16 * 157.25 /*MHz*/, 0x8e, 0xa0, }, - { 16 * 454.00 /*MHz*/, 0x8e, 0x90, }, + { 16 * 451.25 /*MHz*/, 0x8e, 0x90, }, { 16 * 999.99 , 0x8e, 0x30, }, }; -- cgit v1.2.3