From patchwork Wed Jul 2 15:52:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 4466561 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1829D9F390 for ; Wed, 2 Jul 2014 15:52:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3BFD52038E for ; Wed, 2 Jul 2014 15:52:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 46E3D201F4 for ; Wed, 2 Jul 2014 15:52:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932147AbaGBPwl (ORCPT ); Wed, 2 Jul 2014 11:52:41 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:35719 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755076AbaGBPwe (ORCPT ); Wed, 2 Jul 2014 11:52:34 -0400 Received: from [201.74.152.26] (helo=smtp.w2.samsung.com) by bombadil.infradead.org with esmtpsa (Exim 4.80.1 #2 (Red Hat Linux)) id 1X2Mpi-0006tI-D8; Wed, 02 Jul 2014 15:52:30 +0000 Received: from mchehab by smtp.w2.samsung.com with local (Exim 4.80.1) (envelope-from ) id 1X2Mpe-0006EZ-4m; Wed, 02 Jul 2014 12:52:26 -0300 From: Mauro Carvalho Chehab To: Patrick Boettcher Cc: Mauro Carvalho Chehab , Linux Media Mailing List , Mauro Carvalho Chehab Subject: [PATCH RFC 5/9] dib8000: Adjust the dBm measure for Mygica S870 Date: Wed, 2 Jul 2014 12:52:19 -0300 Message-Id: <1404316343-23856-6-git-send-email-m.chehab@samsung.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1404316343-23856-1-git-send-email-m.chehab@samsung.com> References: <1404316343-23856-1-git-send-email-m.chehab@samsung.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP With Mygica S870, there's a difference of ~10dB to ~13dB when compared with the current scale. I suspect that this is because dib8096gp uses a different set of AGC adjust parameters. Anyway, better to adjust it, in order to have a more precise measure. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb-frontends/dib8000.c | 2 ++ drivers/media/dvb-frontends/dibx000_common.h | 2 ++ drivers/media/usb/dvb-usb/dib0700_devices.c | 2 ++ 3 files changed, 6 insertions(+) diff --git a/drivers/media/dvb-frontends/dib8000.c b/drivers/media/dvb-frontends/dib8000.c index 3de8934a5b3d..4ecf1a6181cc 100644 --- a/drivers/media/dvb-frontends/dib8000.c +++ b/drivers/media/dvb-frontends/dib8000.c @@ -4064,6 +4064,8 @@ static int dib8000_get_stats(struct dvb_frontend *fe, fe_status_t stat) db = interpolate_value(val, strength_to_db_table, ARRAY_SIZE(strength_to_db_table)) - 131000; + if (state->current_agc) + db += state->current_agc->dbm_adjust; c->strength.stat[0].svalue = db; /* UCB/BER/CNR measures require lock */ diff --git a/drivers/media/dvb-frontends/dibx000_common.h b/drivers/media/dvb-frontends/dibx000_common.h index b538e0555c95..76c9b8e9ed44 100644 --- a/drivers/media/dvb-frontends/dibx000_common.h +++ b/drivers/media/dvb-frontends/dibx000_common.h @@ -111,6 +111,8 @@ struct dibx000_agc_config { u16 min_thres; u16 max_thres; } split; + + int dbm_adjust; }; struct dibx000_bandwidth_config { diff --git a/drivers/media/usb/dvb-usb/dib0700_devices.c b/drivers/media/usb/dvb-usb/dib0700_devices.c index 501947eaacfe..baffa8fe09ef 100644 --- a/drivers/media/usb/dvb-usb/dib0700_devices.c +++ b/drivers/media/usb/dvb-usb/dib0700_devices.c @@ -1452,6 +1452,8 @@ static struct dibx000_agc_config dib8090_agc_config[2] = { .beta_exp = 51, .perform_agc_softsplit = 0, + + .dbm_adjust = 13000, /* Empirical adjust the Signal strength scale */ }, { .band_caps = BAND_CBAND,