linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Antti Palosaari <crope@iki.fi>
To: Nibble Max <nibble.max@gmail.com>
Cc: linux-media <linux-media@vger.kernel.org>,
	Olli Salonen <olli.salonen@iki.fi>
Subject: Re: [PATCH 3/3] DVBSky V3 PCIe card: add some changes to M88DS3103 for supporting the demod of M88RS6000
Date: Wed, 22 Oct 2014 00:23:57 +0300	[thread overview]
Message-ID: <5446CEED.30501@iki.fi> (raw)
In-Reply-To: <201410131444110937756@gmail.com>



On 10/13/2014 09:44 AM, Nibble Max wrote:
> M88RS6000 is the integrated chip, which includes tuner and demod.
> Its internal demod is similar with M88DS3103 except some registers definition.
> The main different part of this internal demod from others is its clock/pll generation IP block sitting inside the tuner die.
> So clock/pll functions should be configed through its tuner i2c bus, NOT its demod i2c bus.
> The demod of M88RS6000 need the firmware: dvb-demod-m88rs6000.fw
> firmware download link: http://www.dvbsky.net/download/linux/dvbsky-firmware.tar.gz

> @@ -250,6 +251,7 @@ static int m88ds3103_set_frontend(struct dvb_frontend *fe)
>   	u16 u16tmp, divide_ratio;
>   	u32 tuner_frequency, target_mclk;
>   	s32 s32tmp;
> +	struct m88rs6000_mclk_config mclk_cfg;
>
>   	dev_dbg(&priv->i2c->dev,
>   			"%s: delivery_system=%d modulation=%d frequency=%d symbol_rate=%d inversion=%d pilot=%d rolloff=%d\n",
> @@ -291,6 +293,26 @@ static int m88ds3103_set_frontend(struct dvb_frontend *fe)
>   	if (ret)
>   		goto err;
>
> +	if (priv->chip_id == M88RS6000_CHIP_ID) {
> +		ret = m88ds3103_wr_reg(priv, 0x06, 0xe0);
> +		if (ret)
> +			goto err;
> +		if (fe->ops.tuner_ops.set_config) {
> +			/* select main mclk */
> +			mclk_cfg.config_op = 0;
> +			mclk_cfg.TunerfreqMHz = c->frequency / 1000;
> +			mclk_cfg.SymRateKSs = c->symbol_rate / 1000;
> +			ret = fe->ops.tuner_ops.set_config(fe, &mclk_cfg);
> +			if (ret)
> +				goto err;
> +			priv->mclk_khz = mclk_cfg.MclkKHz;
> +		}
> +		ret = m88ds3103_wr_reg(priv, 0x06, 0x00);
> +		if (ret)
> +			goto err;
> +		usleep_range(10000, 20000);
> +	}

That looks odd and also ugly. You pass some values from demod to tuner 
using set_config callback. Tuner driver can get symbol_rate and 
frequency just similarly from property cache than demod. Why you do it 
like that?

Clock is provided by tuner as you mention. I see you use that to pass 
used clock frequency from tuner to demod. This does not look nice and I 
would like to see clock framework instead. Or calculate clock on both 
drivers. Does the demod clock even needs to be changed? I think it is 
only TS stream size which defines used clock frequency - smaller the TS 
bitstream, the smaller the clock frequency needed => optimizes power 
consumption a little. But TS clock is calculated on tuner driver in any 
case?

regards
Antti

-- 
http://palosaari.fi/

  reply	other threads:[~2014-10-21 21:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-13  6:44 [PATCH 3/3] DVBSky V3 PCIe card: add some changes to M88DS3103 for supporting the demod of M88RS6000 Nibble Max
2014-10-21 21:23 ` Antti Palosaari [this message]
2014-10-22  4:26 ` Re: [PATCH 3/3] DVBSky V3 PCIe card: add some changes to M88DS3103for " Nibble Max
2014-10-22 12:16 ` Nibble Max
2014-10-24 23:19   ` Antti Palosaari
2014-10-26 14:37   ` Re: [PATCH 3/3] DVBSky V3 PCIe card: add some changes to M88DS3103forsupporting " Nibble Max

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=5446CEED.30501@iki.fi \
    --to=crope@iki.fi \
    --cc=linux-media@vger.kernel.org \
    --cc=nibble.max@gmail.com \
    --cc=olli.salonen@iki.fi \
    /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).