From: Akihiro TSUKADA <tskd08@gmail.com>
To: Mauro Carvalho Chehab <m.chehab@samsung.com>
Cc: linux-media@vger.kernel.org, james.hogan@imgtec.com
Subject: Re: [PATCH 1/4] mxl301rf: add driver for MaxLinear MxL301RF OFDM tuner
Date: Mon, 18 Aug 2014 01:47:34 +0900 [thread overview]
Message-ID: <53F0DCA6.2090501@gmail.com> (raw)
In-Reply-To: <20140815125053.5cc901a6.m.chehab@samsung.com>
Hi Mauro,
thanks for the review.
I will update the patch and post it later.
Before doing so, I'd like to ask some questions.
>> +++ b/drivers/media/tuners/mxl301rf.c
>> +/* *strength : [1/1000 dBm] */
>> +static int mxl301rf_get_rf_strength(struct dvb_frontend *fe, u16 *strength)
>> +{
.......
> Please implement it using DVBv5 API, e. g. using dBm scale.
Do you mean that fe->tuner_ops.get_rf_strength() is deprecated
and should not be used?
And as you pointed me out in the review of tc90522,
> The better is likely to add a new ops to get rf strength in dBm as s64,
> just like the way we use it on DVBv5.
should I add a new tuner_ops to the DVB core like get_rf_strength_v5(fe,&s64)?
Or should mxl301rf provide raw u16 value and tc90522 convert it to s64
like in dvb-frontends/dib7000p.c?
>> +static int mxl301rf_set_params(struct dvb_frontend *fe)
>> +{
........
>> +
>> + /* spur shift function (for analog) */
>> + for (i = 0; i < ARRAY_SIZE(shf_tab); i++) {
>> + if (freq >= (shf_tab[i].freq - shf_tab[i].ofst_th) * 1000 &&
>> + freq <= (shf_tab[i].freq + shf_tab[i].ofst_th) * 1000) {
>> + tune0[2 * 5 + 1] = shf_tab[i].shf_val;
>> + tune0[2 * 6 + 1] = 0xa0 | shf_tab[i].shf_dir;
>> + break;
>> + }
>> + }
>
> Hmm... are you using a table to match the channels? If so, don't do that.
> Instead, just calculate the dividers based on the given frequency.
mxl301rf requires to set frequency instead of the dividers,
as in the following section.
>> + /* convert freq to 10.6 fixed point float [MHz] */
>> + f = freq / 1000000;
>> + tmp = freq % 1000000;
>> + div = 1000000;
>> + for (i = 0; i < 6; i++) {
>> + f <<= 1;
>> + div >>= 1;
>> + if (tmp > div) {
>> + tmp -= div;
>> + f |= 1;
>> + }
>> + }
>> + if (tmp > 7812)
>> + f++;
>> + tune1[2 * 0 + 1] = f & 0xff;
>> + tune1[2 * 1 + 1] = f >> 8;
>> + ret = data_write(state, tune1, sizeof(tune1));
>> + if (ret < 0)
>> + goto failed;
shf_tab[] holds another parameters for another purpose ("spur shift"?),
whose values depend on the range of the input frequency.
This table is ported from the reference "SDK" source of PT3,
and no further info is disclosed.
I made an experiment that removes the code to set those parameters and
it worked fine without problems in my environment, but I kept the code
since I don't know what those parameter exactly mean.
>> + },
>> +
>> + .release = mxl301rf_release,
>> + .init = mxl301rf_init,
>> + .sleep = mxl301rf_sleep,
>> +
>> + .set_params = mxl301rf_set_params,
>> + .get_status = mxl301rf_get_status,
>> + .get_rf_strength = mxl301rf_get_rf_strength,
>
> Isn't it capable of providing more stats?
>
I can add .get_frequency() or .get_bandwidth(),
but those are not used in DVB core and
frontends can get those info from its property cache.
Should those trivial funcs be implemented?
(As with .get_{if_freq,afc}(), necessary info is not disclosed.)
regards,
akihiro
prev parent reply other threads:[~2014-08-17 19:30 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-14 15:43 [PATCH 0/4] dvb: Add support for PT3 ISDB-S/T card tskd08
2014-07-14 15:43 ` [PATCH 1/4] mxl301rf: add driver for MaxLinear MxL301RF OFDM tuner tskd08
2014-07-14 15:43 ` [PATCH 2/4] qm1d1c0042: add driver for Sharp QM1D1C0042 8PSK tuner tskd08
2014-07-14 15:43 ` [PATCH 3/4] tc90522: add driver for Toshiba TC90522 quad demodulator tskd08
2014-07-14 15:43 ` [PATCH 4/4] pt3: add support for Earthsoft PT3 ISDB-S/T receiver card tskd08
2014-08-15 16:17 ` Mauro Carvalho Chehab
2014-08-17 19:29 ` Akihiro TSUKADA
2014-08-15 16:09 ` [PATCH 3/4] tc90522: add driver for Toshiba TC90522 quad demodulator Mauro Carvalho Chehab
2014-08-17 18:24 ` Akihiro TSUKADA
2014-08-15 15:55 ` [PATCH 2/4] qm1d1c0042: add driver for Sharp QM1D1C0042 8PSK tuner Mauro Carvalho Chehab
2014-08-15 15:50 ` [PATCH 1/4] mxl301rf: add driver for MaxLinear MxL301RF OFDM tuner Mauro Carvalho Chehab
2014-08-17 16:47 ` Akihiro TSUKADA [this message]
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=53F0DCA6.2090501@gmail.com \
--to=tskd08@gmail.com \
--cc=james.hogan@imgtec.com \
--cc=linux-media@vger.kernel.org \
--cc=m.chehab@samsung.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).