From 12f7442713d7eb82fecd42660ef8714f6e7d6e94 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 1 Jun 2009 11:46:08 -0300 Subject: Fix firmware load for DVB-T @ 6MHz From: Mauro Carvalho Chehab bandwidth for xc3028/xc3028L The only two countries that are known to use 6MHz bandwidth are Taiwan and Uruguay. Both use QAM subcarriers at OFTM. This patch fixes the firmware load for such countries, where the required firmware is the QAM one. This also confirms the previous tests where it was noticed that the 6MHz QAM firmware doesn't work for cable. So, this patch also removes support for DVB-C, instead of just printing a warning. Thanks to Terry Wu for pointing this issue and to Andy Walls for an initial patch for this fix. Priority: normal CC: Terry Wu CC: Andy Walls Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/common/tuners/tuner-xc2028.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'linux/drivers/media/common/tuners/tuner-xc2028.c') diff --git a/linux/drivers/media/common/tuners/tuner-xc2028.c b/linux/drivers/media/common/tuners/tuner-xc2028.c index cb5b577fa..10becc3c0 100644 --- a/linux/drivers/media/common/tuners/tuner-xc2028.c +++ b/linux/drivers/media/common/tuners/tuner-xc2028.c @@ -1026,21 +1026,20 @@ static int xc2028_set_params(struct dvb_frontend *fe, switch(fe->ops.info.type) { case FE_OFDM: bw = p->u.ofdm.bandwidth; - break; - case FE_QAM: - tuner_info("WARN: There are some reports that " - "QAM 6 MHz doesn't work.\n" - "If this works for you, please report by " - "e-mail to: v4l-dvb-maintainer@linuxtv.org\n"); - bw = BANDWIDTH_6_MHZ; - type |= QAM; + /* + * The only countries with 6MHz seem to be Taiwan/Uruguay. + * Both seem to require QAM firmware for OFDM decoding + * Tested in Taiwan by Terry Wu + */ + if (bw == BANDWIDTH_6_MHZ) + type |= QAM; break; case FE_ATSC: bw = BANDWIDTH_6_MHZ; /* The only ATSC firmware (at least on v2.7) is D2633 */ type |= ATSC | D2633; break; - /* DVB-S is not supported */ + /* DVB-S and pure QAM (FE_QAM) are not supported */ default: return -EINVAL; } -- cgit v1.2.3 From 3cfc0ea022a646fa73ba82352c3a95af859c20f6 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 1 Jun 2009 12:18:10 -0300 Subject: tuner-xc2028: Fix offset frequencies for DVB @ 6MHz From: Mauro Carvalho Chehab Both ATSC and DVB @ 6MHz bandwidth require the same offset. While we're fixing it, let's cleanup the bandwidth setup to better reflect the fact that it is a function of the bandwidth. Thanks to Terry Wu for pointing this issue and to Andy Walls for an initial patch for this fix. Priority: normal CC: Terry Wu CC: Andy Walls Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/common/tuners/tuner-xc2028.c | 32 ++++++++++++++---------- 1 file changed, 19 insertions(+), 13 deletions(-) (limited to 'linux/drivers/media/common/tuners/tuner-xc2028.c') diff --git a/linux/drivers/media/common/tuners/tuner-xc2028.c b/linux/drivers/media/common/tuners/tuner-xc2028.c index 10becc3c0..493e8d642 100644 --- a/linux/drivers/media/common/tuners/tuner-xc2028.c +++ b/linux/drivers/media/common/tuners/tuner-xc2028.c @@ -921,22 +921,28 @@ static int generic_set_freq(struct dvb_frontend *fe, u32 freq /* in HZ */, * that xc2028 will be in a safe state. * Maybe this might also be needed for DTV. */ - if (new_mode == T_ANALOG_TV) { + if (new_mode == T_ANALOG_TV) rc = send_seq(priv, {0x00, 0x00}); - } else if (priv->cur_fw.type & ATSC) { - offset = 1750000; - } else { - offset = 2750000; + + /* + * Digital modes require an offset to adjust to the + * proper frequency + */ + if (new_mode != T_ANALOG_TV) { + /* Sets the offset according with firmware */ + if (priv->cur_fw.type & DTV6) + offset = 1750000; + if (priv->cur_fw.type & DTV7) + offset = 2250000; + else /* DTV8 or DTV78 */ + offset = 2750000; + /* - * We must adjust the offset by 500kHz in two cases in order - * to correctly center the IF output: - * 1) When the ZARLINK456 or DIBCOM52 tables were explicitly - * selected and a 7MHz channel is tuned; - * 2) When tuning a VHF channel with DTV78 firmware. + * We must adjust the offset by 500kHz when + * tuning a 7MHz VHF channel with DTV78 firmware + * (used in Australia) */ - if (((priv->cur_fw.type & DTV7) && - (priv->cur_fw.scode_table & (ZARLINK456 | DIBCOM52))) || - ((priv->cur_fw.type & DTV78) && freq < 470000000)) + if ((priv->cur_fw.type & DTV78) && freq < 470000000) offset -= 500000; } -- cgit v1.2.3 From b49e742345a086611441cc31b1b0041f1fe7051d Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 1 Jun 2009 22:34:20 -0300 Subject: tuner-xc3028: fix frequency offset From: Mauro Carvalho Chehab The last changeset has an else missing, causing wrong frequencies for DTV6. Thanks to Terry Wu for pointing the issue. Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/common/tuners/tuner-xc2028.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linux/drivers/media/common/tuners/tuner-xc2028.c') diff --git a/linux/drivers/media/common/tuners/tuner-xc2028.c b/linux/drivers/media/common/tuners/tuner-xc2028.c index 493e8d642..c98a628e8 100644 --- a/linux/drivers/media/common/tuners/tuner-xc2028.c +++ b/linux/drivers/media/common/tuners/tuner-xc2028.c @@ -932,7 +932,7 @@ static int generic_set_freq(struct dvb_frontend *fe, u32 freq /* in HZ */, /* Sets the offset according with firmware */ if (priv->cur_fw.type & DTV6) offset = 1750000; - if (priv->cur_fw.type & DTV7) + else if (priv->cur_fw.type & DTV7) offset = 2250000; else /* DTV8 or DTV78 */ offset = 2750000; -- cgit v1.2.3 From 2e4dae3dad6d21fbd5ce4b97f4724ab1a830af8c Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Wed, 3 Jun 2009 02:27:34 -0300 Subject: tuner-xc2028: Improve comments, based on Andy Walls and Hermann Pitton From: Mauro Carvalho Chehab feedback CC: Andy Walls CC: Hermann Pitton Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/common/tuners/tuner-xc2028.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'linux/drivers/media/common/tuners/tuner-xc2028.c') diff --git a/linux/drivers/media/common/tuners/tuner-xc2028.c b/linux/drivers/media/common/tuners/tuner-xc2028.c index c98a628e8..083e62723 100644 --- a/linux/drivers/media/common/tuners/tuner-xc2028.c +++ b/linux/drivers/media/common/tuners/tuner-xc2028.c @@ -926,7 +926,8 @@ static int generic_set_freq(struct dvb_frontend *fe, u32 freq /* in HZ */, /* * Digital modes require an offset to adjust to the - * proper frequency + * proper frequency. + * Analog modes require offset = 0 */ if (new_mode != T_ANALOG_TV) { /* Sets the offset according with firmware */ @@ -940,7 +941,7 @@ static int generic_set_freq(struct dvb_frontend *fe, u32 freq /* in HZ */, /* * We must adjust the offset by 500kHz when * tuning a 7MHz VHF channel with DTV78 firmware - * (used in Australia) + * (used in Australia, Italy and Germany) */ if ((priv->cur_fw.type & DTV78) && freq < 470000000) offset -= 500000; -- cgit v1.2.3 From d336dddd42e43b5465cd58b5a4812011805905df Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sat, 6 Jun 2009 08:15:08 -0300 Subject: tuner-xc2028: cleanup: better use tuner typpe defines From: Mauro Carvalho Chehab Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/common/tuners/tuner-xc2028.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'linux/drivers/media/common/tuners/tuner-xc2028.c') diff --git a/linux/drivers/media/common/tuners/tuner-xc2028.c b/linux/drivers/media/common/tuners/tuner-xc2028.c index 083e62723..a7466867c 100644 --- a/linux/drivers/media/common/tuners/tuner-xc2028.c +++ b/linux/drivers/media/common/tuners/tuner-xc2028.c @@ -929,7 +929,7 @@ static int generic_set_freq(struct dvb_frontend *fe, u32 freq /* in HZ */, * proper frequency. * Analog modes require offset = 0 */ - if (new_mode != T_ANALOG_TV) { + if (new_mode == T_DIGITAL_TV) { /* Sets the offset according with firmware */ if (priv->cur_fw.type & DTV6) offset = 1750000; @@ -1002,7 +1002,7 @@ static int xc2028_set_analog_freq(struct dvb_frontend *fe, if (priv->ctrl.input1) type |= INPUT1; return generic_set_freq(fe, (625l * p->frequency) / 10, - T_ANALOG_TV, type, 0, 0); + T_RADIO, type, 0, 0); } /* if std is not defined, choose one */ -- cgit v1.2.3