From: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
To: tskd08@gmail.com
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH v4 3/4] tc90522: add driver for Toshiba TC90522 quad demodulator
Date: Tue, 23 Sep 2014 17:07:30 -0300 [thread overview]
Message-ID: <20140923170730.4d5d167e@recife.lan> (raw)
In-Reply-To: <1410196843-26168-4-git-send-email-tskd08@gmail.com>
Em Tue, 9 Sep 2014 02:20:42 +0900
tskd08@gmail.com escreveu:
> From: Akihiro Tsukada <tskd08@gmail.com>
>
> This patch adds driver for tc90522 demodulator chips.
> The chip contains 4 demod modules that run in parallel and are independently
> controllable via separate I2C addresses.
> Two of the modules are for ISDB-T and the rest for ISDB-S.
> It is used in earthsoft pt3 cards.
>
> Note that this driver does not init the chip,
> because the initilization sequence / register setting is not disclosed.
> Thus, the driver assumes that the chips are initilized externally
> by its parent board driver before fe->ops->init() are called.
> Earthsoft PT3 PCIe card, for example, contains the init sequence
> in its private memory and provides a command to trigger the sequence.
I applied this series, as we're discussing it already for a long time,
and it seems in a good shape...
Yet, I got some minor issues with FE status. See below.
PS.: could you also test (and send us patches as needed) for ISDB-S
support at libdvbv5 and dvbv5-utils[1]?
[1] http://linuxtv.org/wiki/index.php/DVBv5_Tools
Thanks!
Mauro
> +static int tc90522s_read_status(struct dvb_frontend *fe, fe_status_t *status)
> +{
> + struct tc90522_state *state;
> + int ret;
> + u8 reg;
> +
> + state = fe->demodulator_priv;
> + ret = reg_read(state, 0xc3, ®, 1);
> + if (ret < 0)
> + return ret;
> +
> + *status = 0;
> + if (reg & 0x80) /* input level under min ? */
> + return 0;
> + *status |= FE_HAS_SIGNAL;
> +
> + if (reg & 0x60) /* carrier? */
> + return 0;
Sure about that? Wouldn't it be, instead, reg & 0x60 == 0x60?
> + *status |= FE_HAS_CARRIER | FE_HAS_VITERBI | FE_HAS_SYNC;
> +
> + if (reg & 0x10)
> + return 0;
> + if (reg_read(state, 0xc5, ®, 1) < 0 || !(reg & 0x03))
> + return 0;
> + *status |= FE_HAS_LOCK;
> + return 0;
> +}
> +
> +static int tc90522t_read_status(struct dvb_frontend *fe, fe_status_t *status)
> +{
> + struct tc90522_state *state;
> + int ret;
> + u8 reg;
> +
> + state = fe->demodulator_priv;
> + ret = reg_read(state, 0x96, ®, 1);
> + if (ret < 0)
> + return ret;
> +
> + *status = 0;
> + if (reg & 0xe0) {
> + *status = FE_HAS_SIGNAL | FE_HAS_CARRIER | FE_HAS_VITERBI
> + | FE_HAS_SYNC | FE_HAS_LOCK;
> + return 0;
> + }
> +
> + ret = reg_read(state, 0x80, ®, 1);
> + if (ret < 0)
> + return ret;
> +
> + if (reg & 0xf0)
> + return 0;
> + *status |= FE_HAS_SIGNAL | FE_HAS_CARRIER;
> +
> + if (reg & 0x0c)
> + return 0;
> + *status |= FE_HAS_SYNC | FE_HAS_VITERBI;
The entire series of checks above seems wrong on my eyes too.
For example, if reg = 0x20 or 0x40 or 0x80 or ..., it will return
FE_HAS_LOCK.
Regards,
Mauro
next prev parent reply other threads:[~2014-09-23 20:07 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-08 17:20 [PATCH v4 0/4] dvb: Add support for PT3 ISDB-S/T card tskd08
2014-09-08 17:20 ` [PATCH v4 1/4] mxl301rf: add driver for MaxLinear MxL301RF OFDM tuner tskd08
2014-09-08 17:33 ` Antti Palosaari
2014-09-08 17:20 ` [PATCH v4 2/4] qm1d1c0042: add driver for Sharp QM1D1C0042 ISDB-S tuner tskd08
2014-09-08 17:20 ` [PATCH v4 3/4] tc90522: add driver for Toshiba TC90522 quad demodulator tskd08
2014-09-23 20:07 ` Mauro Carvalho Chehab [this message]
2014-09-24 3:00 ` Akihiro TSUKADA
2014-09-24 9:28 ` Mauro Carvalho Chehab
2014-09-24 11:14 ` Akihiro TSUKADA
2014-09-24 11:30 ` Mauro Carvalho Chehab
2014-09-24 12:06 ` Akihiro TSUKADA
2014-09-24 13:32 ` Mauro Carvalho Chehab
2014-09-24 14:26 ` Akihiro TSUKADA
2014-09-08 17:20 ` [PATCH v4 4/4] pt3: add support for Earthsoft PT3 ISDB-S/T receiver card tskd08
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=20140923170730.4d5d167e@recife.lan \
--to=mchehab@osg.samsung.com \
--cc=linux-media@vger.kernel.org \
--cc=tskd08@gmail.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.