From patchwork Fri Jul 1 14:03:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 9209941 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1C8E8607D8 for ; Fri, 1 Jul 2016 14:03:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E7DC28672 for ; Fri, 1 Jul 2016 14:03:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 039C8286AA; Fri, 1 Jul 2016 14:03:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9D5D7286B7 for ; Fri, 1 Jul 2016 14:03:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752670AbcGAOD3 (ORCPT ); Fri, 1 Jul 2016 10:03:29 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:35623 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752659AbcGAOD2 (ORCPT ); Fri, 1 Jul 2016 10:03:28 -0400 Received: from 177.17.252.210.dynamic.adsl.gvt.net.br ([177.17.252.210] helo=smtp.w2.samsung.com) by bombadil.infradead.org with esmtpsa (Exim 4.85_2 #1 (Red Hat Linux)) id 1bIz2P-0007PW-6K; Fri, 01 Jul 2016 14:03:21 +0000 Received: from mchehab by smtp.w2.samsung.com with local (Exim 4.87) (envelope-from ) id 1bIz2L-0004cT-7w; Fri, 01 Jul 2016 11:03:17 -0300 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , Linux Media Mailing List , Mauro Carvalho Chehab , Sergey Kozlov , Abylay Ospan Subject: [PATCH 2/4] cxd2841er: provide signal strength for DVB-C Date: Fri, 1 Jul 2016 11:03:14 -0300 Message-Id: <61dea922c711592c5bf13a2ced7da4b31fa8a9fc.1467381792.git.mchehab@s-opensource.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <75889448cdfcea311a0c0f5e1c8cc022915dd4fe.1467381792.git.mchehab@s-opensource.com> References: <75889448cdfcea311a0c0f5e1c8cc022915dd4fe.1467381792.git.mchehab@s-opensource.com> In-Reply-To: <75889448cdfcea311a0c0f5e1c8cc022915dd4fe.1467381792.git.mchehab@s-opensource.com> References: <75889448cdfcea311a0c0f5e1c8cc022915dd4fe.1467381792.git.mchehab@s-opensource.com> To: unlisted-recipients:; (no To-header on input) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently, there's no stats for DVB-C. Let's at least return signal strength. The scale is different than on DVB-T, so let's use a relative scale, for now. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb-frontends/cxd2841er.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/media/dvb-frontends/cxd2841er.c b/drivers/media/dvb-frontends/cxd2841er.c index 543b20155efc..e35f5d0d3f34 100644 --- a/drivers/media/dvb-frontends/cxd2841er.c +++ b/drivers/media/dvb-frontends/cxd2841er.c @@ -1752,6 +1752,12 @@ static void cxd2841er_read_signal_strength(struct dvb_frontend *fe) /* Formula was empirically determinated @ 410 MHz */ p->strength.stat[0].uvalue = ((s32)strength) * 366 / 100 - 89520; break; /* Code moved out of the function */ + case SYS_DVBC_ANNEX_A: + strength = cxd2841er_read_agc_gain_t_t2(priv, + p->delivery_system); + p->strength.stat[0].scale = FE_SCALE_RELATIVE; + p->strength.stat[0].uvalue = strength; + break; case SYS_ISDBT: strength = 65535 - cxd2841er_read_agc_gain_i( priv, p->delivery_system);