From: Antti Palosaari <crope@iki.fi>
To: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: Bert Massop <bert.massop@gmail.com>, linux-media@vger.kernel.org
Subject: Re: [PATCH 3/3] [media] tuner, xc2028: add support for get_afc()
Date: Mon, 06 Aug 2012 23:10:59 +0300 [thread overview]
Message-ID: <502024D3.8070301@iki.fi> (raw)
In-Reply-To: <4FF8139F.7010602@iki.fi>
Mauro, I am still waiting for your explanation for that.
On 07/07/2012 01:46 PM, Antti Palosaari wrote:
> On 07/05/2012 11:10 PM, Mauro Carvalho Chehab wrote:
>> Em 05-07-2012 14:37, Bert Massop escreveu:
>>> On Thu, Jul 5, 2012 at 5:05 PM, Antti Palosaari <crope@iki.fi> wrote:
>>>>
>>>> On 07/05/2012 05:16 PM, Mauro Carvalho Chehab wrote:
>>>>>
>>>>> Implement API support to return AFC frequency shift, as this device
>>>>> supports it. The only other driver that implements it is tda9887,
>>>>> and the frequency there is reported in Hz. So, use Hz also for this
>>>>> tuner.
>>>>
>>>>
>>>> What is AFC and why it is needed?
>>>>
>>>
>>> AFC is short for Automatic Frequency Control, by which a tuner
>>> automatically fine-tunes the frequency for the best reception,
>>> compensating for small offsets and oscillator frequency drift.
>>> This is however done automatically on the tuner, so its configuration
>>> is read-only. Aside from being a "nice to know" statistic, getting
>>> hold of the AFC frequency shift does as far as I know not have any
>>> practical uses related to properly operating the tuner.
>>
>> AFC might be useful on a few situations. For example, my CATV operator
>> still broadcasts some channels in both analog and digital. The analog
>> equipment there doesn't seem to be well-maintained, as some channels have
>> frequency shifts or have some other artifacts. Still, analog broadcast
>> is useful for me to test drivers ;)
>>
>> Anyway, adjusting the channel tables to consider that offset shift help
>> to tune them a little faster and/or get a better quality by letting the
>> PLL to work closer to the pilot carrier.
>
> We has already .get_frequency() which returns same information. It is
> not currently used though few drivers implements it (wrongly). So I
> don't see why this new callback should be added.
>
> u32 actual_freq;
> int afc;
>
> struct dtv_frontend_properties *c = &fe->dtv_property_cache;
> ret = .get_frequency(fe, &actual_freq);
> afc = c->frequency - actual_freq;
Let me revise what I think. We have now 3 methods for resolving actual
frequency after tuner is set:
1) .get_frequency()
** that is old APIv3 callback returning tuner frequency
2) fe->dtv_property_cache->frequency
** that is newer APIv5 method returning tuner frequency
3) .get_afc()
** new callback to return frequency shift from target frequency
For my eyes this kind of duplicate methods are bad, causing only
confusion, and should be avoided always when possible.
regards
Antti
--
http://palosaari.fi/
next prev parent reply other threads:[~2012-08-06 20:11 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-05 14:16 [PATCH 1/3] [media] tuner-core: call has_signal for both TV and radio Mauro Carvalho Chehab
2012-07-05 14:16 ` [PATCH 2/3] [media] tuner-xc2028: Fix signal strength report Mauro Carvalho Chehab
2012-07-05 14:25 ` Devin Heitmueller
2012-07-05 14:31 ` Devin Heitmueller
2012-07-05 15:40 ` Mauro Carvalho Chehab
2012-07-05 14:16 ` [PATCH 3/3] [media] tuner, xc2028: add support for get_afc() Mauro Carvalho Chehab
2012-07-05 15:05 ` Antti Palosaari
2012-07-05 17:37 ` Bert Massop
2012-07-05 20:10 ` Mauro Carvalho Chehab
2012-07-07 10:46 ` Antti Palosaari
2012-08-06 20:10 ` Antti Palosaari [this message]
2012-08-06 20:41 ` Mauro Carvalho Chehab
2012-08-06 20:37 ` Manu Abraham
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=502024D3.8070301@iki.fi \
--to=crope@iki.fi \
--cc=bert.massop@gmail.com \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@redhat.com \
/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;
as well as URLs for NNTP newsgroup(s).