From patchwork Sat Aug 28 13:06:25 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Igor M. Liplianin" X-Patchwork-Id: 5381 Return-path: Envelope-to: mchehab@gaivota Delivery-date: Fri, 31 Dec 2010 08:15:29 -0200 Received: from mchehab by gaivota with local (Exim 4.72) (envelope-from ) id 1PYc1B-0002Ql-8s for mchehab@gaivota; Fri, 31 Dec 2010 08:15:29 -0200 Received: from casper.infradead.org [85.118.1.10] by gaivota with IMAP (fetchmail-6.3.17) for (single-drop); Fri, 31 Dec 2010 08:15:29 -0200 (BRST) Received: from vger.kernel.org ([209.132.180.67]) by casper.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1PYXbz-00017K-79; Fri, 31 Dec 2010 05:33:11 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752337Ab0LaFcg (ORCPT + 1 other); Fri, 31 Dec 2010 00:32:36 -0500 Received: from mail-ew0-f46.google.com ([209.85.215.46]:62090 "EHLO mail-ew0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752075Ab0LaFcO (ORCPT ); Fri, 31 Dec 2010 00:32:14 -0500 Received: by mail-ew0-f46.google.com with SMTP id 5so5311700ewy.19 for ; Thu, 30 Dec 2010 21:32:13 -0800 (PST) Received: by 10.14.53.75 with SMTP id f51mr9387271eec.35.1293773533082; Thu, 30 Dec 2010 21:32:13 -0800 (PST) Received: from useri.localnet ([93.125.74.3]) by mx.google.com with ESMTPS id t5sm11994271eeh.8.2010.12.30.21.32.11 (version=SSLv3 cipher=RC4-MD5); Thu, 30 Dec 2010 21:32:12 -0800 (PST) Message-ID: <4d1d6adc.857a0e0a.45e5.ffffd91e@mx.google.com> From: Abylay Ospan Date: Sat, 28 Aug 2010 16:06:25 +0300 Subject: [PATCH 12/18] stv0367: implement uncorrected blocks counter. To: , linux-media@vger.kernel.org, , Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Sender: Mauro Carvalho Chehab Signed-off-by: Abylay Ospan --- drivers/media/dvb/frontends/stv0367.c | 20 +++++++++++++++++++- 1 files changed, 19 insertions(+), 1 deletions(-) diff --git a/drivers/media/dvb/frontends/stv0367.c b/drivers/media/dvb/frontends/stv0367.c index 9439388..aaa2b44 100644 --- a/drivers/media/dvb/frontends/stv0367.c +++ b/drivers/media/dvb/frontends/stv0367.c @@ -3327,6 +3327,24 @@ static int stv0367cab_read_snr(struct dvb_frontend *fe, u16 *snr) return 0; } +static int stv0367cab_read_ucblcks(struct dvb_frontend *fe, u32 *ucblocks) +{ + struct stv0367_state *state = fe->demodulator_priv; + int corrected, tscount; + + *ucblocks = (stv0367_readreg(state, R367CAB_RS_COUNTER_5) << 8) + | stv0367_readreg(state, R367CAB_RS_COUNTER_4); + corrected = (stv0367_readreg(state, R367CAB_RS_COUNTER_3) << 8) + | stv0367_readreg(state, R367CAB_RS_COUNTER_2); + tscount = (stv0367_readreg(state, R367CAB_RS_COUNTER_2) << 8) + | stv0367_readreg(state, R367CAB_RS_COUNTER_1); + + dprintk("%s: uncorrected blocks=%d corrected blocks=%d tscount=%d\n", + __func__, *ucblocks, corrected, tscount); + + return 0; +}; + static struct dvb_frontend_ops stv0367cab_ops = { .info = { .name = "ST STV0367 DVB-C", @@ -3351,7 +3369,7 @@ static struct dvb_frontend_ops stv0367cab_ops = { /* .read_ber = stv0367cab_read_ber,*/ .read_signal_strength = stv0367cab_read_strength, .read_snr = stv0367cab_read_snr, -/* .read_ucblocks = stv0367cab_read_ucblcks,*/ + .read_ucblocks = stv0367cab_read_ucblcks, .get_tune_settings = stv0367_get_tune_settings, };