From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: Alina Friedrichsen <x-alina@gmx.net>
Cc: linux-media@vger.kernel.org, rglowery@exemail.com.au
Subject: Re: [PATCH v3] tuner_xc2028: Allow selection of the frequency adjustment code for XC3028
Date: Wed, 27 Jul 2011 11:34:47 -0300 [thread overview]
Message-ID: <4E302207.8050409@redhat.com> (raw)
In-Reply-To: <20110722183552.169950@gmx.net>
Hi Alina,
Em 22-07-2011 15:35, Alina Friedrichsen escreveu:
> Since many, many kernel releases my Hauppauge WinTV HVR-1400 doesn't work
> anymore, and nobody feels responsible to fix it.
No. The problem is that fixing it would require someone to travel around the
globe with several different boards, in order to see how the driver works on
each Country (or having a DTV generator capable of simulating the Country
differences on a reliable way). In particular, Australia requires a different
setting than Europe. The code tries to figure out that, but I'm starting to
suspect that with a few demods, such adjustments are different.
Btw, what's the video standard that you're using? DTV7? Does your device use
a xc3028 or xc3028xl? Whats's your demod and board?
> The code to get it work is still in there, it's only commented out.
> My patch to enable it was rejected, because somebody had fear that it could
> break other cards.
> So here is a new patch, that allows you to select the frequency adjustment
> code by a module parameter. Default is the old code, so it can't break
> anything.
>
> Signed-off-by: Alina Friedrichsen <x-alina@gmx.net>
> ---
> diff -urN linux-3.0.orig/drivers/media/common/tuners/tuner-xc2028.c linux-3.0/drivers/media/common/tuners/tuner-xc2028.c
> --- linux-3.0.orig/drivers/media/common/tuners/tuner-xc2028.c 2011-07-22 04:17:23.000000000 +0200
> +++ linux-3.0/drivers/media/common/tuners/tuner-xc2028.c 2011-07-22 20:15:08.212540252 +0200
> @@ -54,6 +54,11 @@
> MODULE_PARM_DESC(firmware_name, "Firmware file name. Allows overriding the "
> "default firmware name\n");
>
> +static int freq_magic;
> +module_param(freq_magic, int, 0644);
> +MODULE_PARM_DESC(freq_magic, "Selects the frequency adjustment code "
> + "for XC3028. Set it to 1 if tuning fails.");
While I really prefer to fix the code, I might accept a hack like that, if
better named, and properly described. It is more like an alternate way
to set the tuner, and for sure it won't solve all cases where the tuning
fails.
AFAIK, the driver only has problem with DTV7. So, the hack should not be applied
for other standards.
> +
> static LIST_HEAD(hybrid_tuner_instance_list);
> static DEFINE_MUTEX(xc2028_list_mutex);
>
> @@ -967,34 +972,36 @@
> * newer firmwares
> */
>
> -#if 1
> - /*
> - * The proper adjustment would be to do it at s-code table.
> - * However, this didn't work, as reported by
> - * Robert Lowery <rglowery@exemail.com.au>
> - */
> -
> - if (priv->cur_fw.type & DTV7)
> - offset += 500000;
> -
> -#else
> - /*
> - * Still need tests for XC3028L (firmware 3.2 or upper)
> - * So, for now, let's just comment the per-firmware
> - * version of this change. Reports with xc3028l working
> - * with and without the lines bellow are welcome
> - */
> + if (!freq_magic) {
> + /*
> + * The proper adjustment would be to do it at s-code
> + * table. However, this didn't work, as reported by
> + * Robert Lowery <rglowery@exemail.com.au>
> + */
>
> - if (priv->firm_version < 0x0302) {
> if (priv->cur_fw.type & DTV7)
> offset += 500000;
> +
> } else {
> - if (priv->cur_fw.type & DTV7)
> - offset -= 300000;
> - else if (type != ATSC) /* DVB @6MHz, DTV 8 and DTV 7/8 */
> - offset += 200000;
> + /*
> + * Still need tests for XC3028L (firmware 3.2 or upper)
> + * So, for now, let's just comment the per-firmware
> + * version of this change. Reports with xc3028l working
> + * with and without the lines bellow are welcome
> + */
> +
> + if (priv->firm_version < 0x0302) {
> + if (priv->cur_fw.type & DTV7)
> + offset += 500000;
> + } else {
> + if (priv->cur_fw.type & DTV7)
> + offset -= 300000;
> + else if (type != ATSC) {
> + /* DVB @6MHz, DTV 8 and DTV 7/8 */
> + offset += 200000;
> + }
> + }
> }
> -#endif
> }
>
> div = (freq - offset + DIV / 2) / DIV;
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2011-07-27 14:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-22 18:35 [PATCH v3] tuner_xc2028: Allow selection of the frequency adjustment code for XC3028 Alina Friedrichsen
2011-07-27 14:34 ` Mauro Carvalho Chehab [this message]
2011-07-27 14:58 ` Devin Heitmueller
2011-07-27 15:50 ` Mauro Carvalho Chehab
2011-07-27 16:06 ` Mauro Carvalho Chehab
2011-07-28 19:38 ` Mauro Carvalho Chehab
2011-07-29 6:49 ` Alina Friedrichsen
-- strict thread matches above, loose matches on Subject: below --
2011-08-01 14:55 jean.bruenn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E302207.8050409@redhat.com \
--to=mchehab@redhat.com \
--cc=linux-media@vger.kernel.org \
--cc=rglowery@exemail.com.au \
--cc=x-alina@gmx.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox