All of lore.kernel.org
 help / color / mirror / Atom feed
From: Antti Palosaari <crope@iki.fi>
To: linuxtv@stefanringel.de
Cc: linux-media@vger.kernel.org, mchehab@redhat.com
Subject: Re: [PATCH 1/3] mt2063: add get_if_frequency call
Date: Sat, 17 Dec 2011 23:54:22 +0200	[thread overview]
Message-ID: <4EED0F8E.2000005@iki.fi> (raw)
In-Reply-To: <1324155437-15834-1-git-send-email-linuxtv@stefanringel.de>

On 12/17/2011 10:57 PM, linuxtv@stefanringel.de wrote:
> From: Stefan Ringel<linuxtv@stefanringel.de>
>
> Signed-off-by: Stefan Ringel<linuxtv@stefanringel.de>
> ---
>   drivers/media/common/tuners/mt2063.c |   24 ++++++++++++++++++------
>   1 files changed, 18 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/media/common/tuners/mt2063.c b/drivers/media/common/tuners/mt2063.c
> index 6743ffe..5b4b1ec 100644
> --- a/drivers/media/common/tuners/mt2063.c
> +++ b/drivers/media/common/tuners/mt2063.c
> @@ -2211,18 +2211,29 @@ static int mt2063_get_frequency(struct dvb_frontend *fe, u32 *freq)
>   	if (!state->init)
>   		return -ENODEV;
>
> -	/*
> -	 * FIXME: This is an API abuse at DRX-K driver: in order to allow
> -	 * tda18271 to change the IF based on the standard, it uses this
> -	 * callback as "get_if_frequency".
> -	 */
> -	*freq = state->reference * 1000;
> +	*freq = state->frequency;
>
>   	dprintk(1, "frequency: %d\n", *freq);
>
>   	return 0;
>   }
>
> +static int mt2063_get_if_frequency(struct dvb_frontend *fe, u32 *freq)
> +{
> +	struct mt2063_state *state = fe->tuner_priv;
> +
> +	dprintk(2, "\n");
> +
> +	if (!state->init)
> +		return -ENODEV;
> +
> +	*freq = state->AS_Data.f_out;
> +
> +	dprintk(1, "if frequency: %d\n", *freq);
> +
> +	return 0;
> +}
> +
>   static int mt2063_get_bandwidth(struct dvb_frontend *fe, u32 *bw)
>   {
>   	struct mt2063_state *state = fe->tuner_priv;
> @@ -2253,6 +2264,7 @@ static struct dvb_tuner_ops mt2063_ops = {
>   	.set_analog_params = mt2063_set_analog_params,
>   	.set_params    = mt2063_set_params,
>   	.get_frequency = mt2063_get_frequency,
> +	.get_if_frequency = mt2063_get_if_frequency,
>   	.get_bandwidth = mt2063_get_bandwidth,
>   	.release = mt2063_release,
>   };

Without looking the code itself that seems like a little bit suspicious. 
As a understand .get_frequency was abused as .get_if_frequency and you 
changed it correctly now. Anyhow, earlier is was returning IF as 
(state->reference * 1000) and now it does (state->AS_Data.f_out). Is 
that correct? And if yes, why there is two variables in state having IF ?

regards
Antti
-- 
http://palosaari.fi/

  parent reply	other threads:[~2011-12-17 21:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-17 20:57 [PATCH 1/3] mt2063: add get_if_frequency call linuxtv
2011-12-17 20:57 ` [PATCH 2/3] drxk: correction frontend attatching linuxtv
2011-12-17 23:39   ` Oliver Endriss
2011-12-17 23:47     ` Oliver Endriss
     [not found]       ` <4EED829E.6020407@stefanringel.de>
2012-01-05 20:46         ` Mauro Carvalho Chehab
2011-12-18  6:03     ` Stefan Ringel
2011-12-17 20:57 ` [PATCH 3/3] cx23885: add Terratec Cinergy T pcie dual linuxtv
2011-12-17 21:54 ` Antti Palosaari [this message]
2011-12-17 21:59   ` [PATCH 1/3] mt2063: add get_if_frequency call 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=4EED0F8E.2000005@iki.fi \
    --to=crope@iki.fi \
    --cc=linux-media@vger.kernel.org \
    --cc=linuxtv@stefanringel.de \
    --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 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.