From: Antti Palosaari <crope@iki.fi>
To: Benjamin Larsson <benjamin@southpole.se>, mchehab@osg.samsung.com
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: Re: [PATCH 10/10] mn88473: implement lock for all delivery systems
Date: Tue, 17 Mar 2015 00:44:34 +0200 [thread overview]
Message-ID: <55075CD2.6060908@iki.fi> (raw)
In-Reply-To: <55074F74.2080000@iki.fi>
On 03/16/2015 11:47 PM, Antti Palosaari wrote:
> On 03/16/2015 12:57 AM, Benjamin Larsson wrote:
>> Signed-off-by: Benjamin Larsson <benjamin@southpole.se>
>
> Applied.
I found this does not work at least for DVB-C. After playing with
modulator I find reg 0x85 on bank 1 is likely AGC. Its value is changed
according to RF level even modulation itself is turned off.
I will likely remove that patch... It is a bit hard to find out lock
bits and it comes even harder without a modulator. Using typical tricks
to plug and unplug antenna, while dumping register values out is error
prone as you could not adjust signal strength nor change modulation
parameters causing wrong decision easily.
regards
Antti
>
> Antti
>
>> ---
>> drivers/staging/media/mn88473/mn88473.c | 50
>> +++++++++++++++++++++++++++++++--
>> 1 file changed, 48 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/staging/media/mn88473/mn88473.c
>> b/drivers/staging/media/mn88473/mn88473.c
>> index a23e59e..ba39614 100644
>> --- a/drivers/staging/media/mn88473/mn88473.c
>> +++ b/drivers/staging/media/mn88473/mn88473.c
>> @@ -167,7 +167,10 @@ static int mn88473_read_status(struct
>> dvb_frontend *fe, fe_status_t *status)
>> {
>> struct i2c_client *client = fe->demodulator_priv;
>> struct mn88473_dev *dev = i2c_get_clientdata(client);
>> + struct dtv_frontend_properties *c = &fe->dtv_property_cache;
>> int ret;
>> + unsigned int utmp;
>> + int lock = 0;
>>
>> *status = 0;
>>
>> @@ -176,8 +179,51 @@ static int mn88473_read_status(struct
>> dvb_frontend *fe, fe_status_t *status)
>> goto err;
>> }
>>
>> - *status = FE_HAS_SIGNAL | FE_HAS_CARRIER | FE_HAS_VITERBI |
>> - FE_HAS_SYNC | FE_HAS_LOCK;
>> + switch (c->delivery_system) {
>> + case SYS_DVBT:
>> + ret = regmap_read(dev->regmap[0], 0x62, &utmp);
>> + if (ret)
>> + goto err;
>> + if (utmp & 0xA0) {
>> + if ((utmp & 0xF) >= 0x03)
>> + *status |= FE_HAS_SIGNAL;
>> + if ((utmp & 0xF) >= 0x09)
>> + lock = 1;
>> + }
>> + break;
>> + case SYS_DVBT2:
>> + ret = regmap_read(dev->regmap[2], 0x8B, &utmp);
>> + if (ret)
>> + goto err;
>> + if (utmp & 0x40) {
>> + if ((utmp & 0xF) >= 0x07)
>> + *status |= FE_HAS_SIGNAL;
>> + if ((utmp & 0xF) >= 0x0a)
>> + *status |= FE_HAS_CARRIER;
>> + if ((utmp & 0xF) >= 0x0d)
>> + *status |= FE_HAS_VITERBI | FE_HAS_SYNC | FE_HAS_LOCK;
>> + }
>> + break;
>> + case SYS_DVBC_ANNEX_A:
>> + ret = regmap_read(dev->regmap[1], 0x85, &utmp);
>> + if (ret)
>> + goto err;
>> + if (utmp & 0x40) {
>> + ret = regmap_read(dev->regmap[1], 0x89, &utmp);
>> + if (ret)
>> + goto err;
>> + if (utmp & 0x01)
>> + lock = 1;
>> + }
>> + break;
>> + default:
>> + ret = -EINVAL;
>> + goto err;
>> + }
>> +
>> + if (lock)
>> + *status = FE_HAS_SIGNAL | FE_HAS_CARRIER | FE_HAS_VITERBI |
>> + FE_HAS_SYNC | FE_HAS_LOCK;
>>
>> return 0;
>> err:
>>
>
--
http://palosaari.fi/
next prev parent reply other threads:[~2015-03-16 22:44 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-15 22:57 [PATCH 01/10] r820t: add DVBC profile in sysfreq_sel Benjamin Larsson
2015-03-15 22:57 ` [PATCH 02/10] r820t: change read_gain() code to match register layout Benjamin Larsson
2015-03-16 21:23 ` Antti Palosaari
2015-03-15 22:57 ` [PATCH 03/10] rtl28xxu: lower the rc poll time to mitigate i2c transfer errors Benjamin Larsson
2015-03-16 21:26 ` Antti Palosaari
2015-03-15 22:57 ` [PATCH 04/10] rtl28xxu: swap frontend order for slave demods Benjamin Larsson
2015-03-16 20:44 ` Benjamin Larsson
2015-03-16 21:04 ` Antti Palosaari
2015-03-16 21:22 ` Benjamin Larsson
2015-03-15 22:57 ` [PATCH 05/10] mn88472: implement lock for all delivery systems Benjamin Larsson
2015-03-16 21:30 ` Antti Palosaari
2015-03-15 22:57 ` [PATCH 06/10] mn88472: implement firmware parity check Benjamin Larsson
2015-03-16 21:37 ` Antti Palosaari
2015-03-15 22:57 ` [PATCH 07/10] mn88473: " Benjamin Larsson
2015-03-16 21:39 ` Antti Palosaari
2015-03-15 22:57 ` [PATCH 08/10] mn88473: check if firmware is already running before loading it Benjamin Larsson
2015-03-16 21:41 ` Antti Palosaari
2015-03-16 21:43 ` Antti Palosaari
2015-03-15 22:57 ` [PATCH 09/10] mn88472: " Benjamin Larsson
2015-03-16 21:45 ` Antti Palosaari
2015-03-15 22:57 ` [PATCH 10/10] mn88473: implement lock for all delivery systems Benjamin Larsson
2015-03-16 21:47 ` Antti Palosaari
2015-03-16 22:44 ` Antti Palosaari [this message]
2015-03-16 23:10 ` Benjamin Larsson
2015-03-18 21:13 ` Antti Palosaari
2015-03-18 21:40 ` Benjamin Larsson
2015-03-16 21:14 ` [PATCH 01/10] r820t: add DVBC profile in sysfreq_sel Antti Palosaari
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=55075CD2.6060908@iki.fi \
--to=crope@iki.fi \
--cc=benjamin@southpole.se \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@osg.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 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.