All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jiří Pinkava" <j-pi@seznam.cz>
To: Michael Krufky <mkrufky@linuxtv.org>
Cc: Gianluca Gennari <gennarone@gmail.com>,
	Mauro Carvalho Chehab <m.chehab@samsung.com>,
	linux-media <linux-media@vger.kernel.org>
Subject: Re: [PATCH 1/2] [media] r820t: fix nint range check
Date: Mon, 30 Sep 2013 18:42:20 +0200	[thread overview]
Message-ID: <5249A9EC.7020804@seznam.cz> (raw)
In-Reply-To: <CAOcJUbyVx=fqHwVeM9K3SKUTk3g7vNqsWf0xokX5nO_DdQenYA@mail.gmail.com>

Mike,

unfortunately no documentation can be referenced except preliminary
version of
datasheet (1).This change is based on lucky guess and supported by lot of
testing on real hardware.

This change add support for devices with Xtal frequency bellow 28.8MHz.

>From Nint  are computed values of Ni and Si. For 28.8MHz crystal can
reach up to 12 / 3 (Ni / Si). Tuner supports crystals with frequencies
(1) 12, 16, 20, 20.48, 24, 27, 28.8, 32 MHz, but this kind of device is
rare to found.
Allowing Ni to go up to 15 instead of only 12 should be safe and for 15
/ 3 (Ni / Si)
we can compute limit for Nint = max(Ni) * 4 + max(Si) + 13 = 76.

If This is sufficient and acceptable explanation I can add some sort of
documentation into patch and resend it (both patches, I can prove I'm
right :)

(1)
http://rtl-sdr.com/wp-content/uploads/2013/04/R820T_datasheet-Non_R-20111130_unlocked.pdf

> Jiří,
>
> Do you have any documentation that supports this value change?
> Changing this value affects the algorithm, and we'd be happier making
> this change if the patch included some better description and perhaps
> a reference explaining why the new value is correct.
>
> Regards,
>
> Mike Krufky
>
> On Sun, Sep 29, 2013 at 6:45 AM, Jiří Pinkava <j-pi@seznam.cz> wrote:
>>
>> Use full range of VCO parameters, fixes tunning for some frequencies.
>> ---
>>  drivers/media/tuners/r820t.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/media/tuners/r820t.c b/drivers/media/tuners/r820t.c
>> index 1c23666..e25c720 100644
>> --- a/drivers/media/tuners/r820t.c
>> +++ b/drivers/media/tuners/r820t.c
>> @@ -637,7 +637,7 @@ static int r820t_set_pll(struct r820t_priv *priv,
>> enum v4l2_tuner_type type,
>>                 vco_fra = pll_ref * 129 / 128;
>>         }
>>
>> -       if (nint > 63) {
>> +       if (nint > 76) {
>>                 tuner_info("No valid PLL values for %u kHz!\n", freq);
>>                 return -EINVAL;
>>         }
>> --
>> 1.8.3.2
>>
>>


  reply	other threads:[~2013-09-30 16:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-29 10:45 [PATCH 0/2] fix tunning for r820t tunner Jiří Pinkava
2013-09-29 10:45 ` [PATCH 1/2] [media] r820t: fix nint range check Jiří Pinkava
2013-09-29 10:46   ` Subject: [PATCH 2/2] [media] r820t: simplify divisor calculation Jiří Pinkava
2013-09-30 15:13     ` Michael Krufky
2013-09-30 15:07   ` [PATCH 1/2] [media] r820t: fix nint range check Michael Krufky
2013-09-30 16:42     ` Jiří Pinkava [this message]
2013-09-30 16:46       ` Michael Krufky
2013-09-30 17:34         ` Mauro Carvalho Chehab

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=5249A9EC.7020804@seznam.cz \
    --to=j-pi@seznam.cz \
    --cc=gennarone@gmail.com \
    --cc=linux-media@vger.kernel.org \
    --cc=m.chehab@samsung.com \
    --cc=mkrufky@linuxtv.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.