From patchwork Fri Jan 2 13:56:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 5559161 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C23379F344 for ; Fri, 2 Jan 2015 13:57:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0213C2022D for ; Fri, 2 Jan 2015 13:57:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 256E22021B for ; Fri, 2 Jan 2015 13:57:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752132AbbABN5D (ORCPT ); Fri, 2 Jan 2015 08:57:03 -0500 Received: from mail-wi0-f179.google.com ([209.85.212.179]:49643 "EHLO mail-wi0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752121AbbABN5B (ORCPT ); Fri, 2 Jan 2015 08:57:01 -0500 Received: by mail-wi0-f179.google.com with SMTP id ex7so27806432wid.12 for ; Fri, 02 Jan 2015 05:57:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Qq3F2nv1peWt/mIBm5qfZACbBkvmaXfzXT9Nj+TQJ8w=; b=P4dIv8QWdd7sgEZgOdSWVRt+EmbHAEcC1DJAy7dGur204cTLsysGyLXf9q54WHRODv rvMruhBTGqq6Fz7TZwm82JFlje0646BBfiv9kJy6GmHq9m0MhhzfMDD6a1Qcu8EAsGI1 TfWpmTExRyorDxw2EeCGikmZgLqgXUUJI7CaBT9g5na6+YcO/+o6UVrCkp9q72cexZF3 L3ZRFb/w6Sz/P/aEmUIV/v858YS5l8W88HVb1ymE8z0osYv0W2od5N4oVSgXKBpbiB45 wcNgxHfrWYvO0JE+wIpHv+IuvdMEMtYFS+JKogE47hgXC2AdMRd/GZzxTmc6LgA/8OZl Z4xg== X-Received: by 10.194.185.243 with SMTP id ff19mr145996037wjc.126.1420207020140; Fri, 02 Jan 2015 05:57:00 -0800 (PST) Received: from localhost.localdomain (dab-far1-h-1-8.dab.02.net. [82.132.222.244]) by mx.google.com with ESMTPSA id fc6sm3520943wib.12.2015.01.02.05.56.58 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 02 Jan 2015 05:56:59 -0800 (PST) From: Malcolm Priestley To: linux-media@vger.kernel.org Cc: Malcolm Priestley Subject: [PATCH 5/5] lmedm04: add read snr, signal strength and ber call backs Date: Fri, 2 Jan 2015 13:56:31 +0000 Message-Id: <1420206991-3939-5-git-send-email-tvboxspy@gmail.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1420206991-3939-1-git-send-email-tvboxspy@gmail.com> References: <1420206991-3939-1-git-send-email-tvboxspy@gmail.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.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 This allows calling the original functions providing the streaming is off. Signed-off-by: Malcolm Priestley --- drivers/media/usb/dvb-usb-v2/lmedm04.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/drivers/media/usb/dvb-usb-v2/lmedm04.c b/drivers/media/usb/dvb-usb-v2/lmedm04.c index a9c7fd0..5de6f7c 100644 --- a/drivers/media/usb/dvb-usb-v2/lmedm04.c +++ b/drivers/media/usb/dvb-usb-v2/lmedm04.c @@ -145,6 +145,10 @@ struct lme2510_state { void *usb_buffer; /* Frontend original calls */ int (*fe_read_status)(struct dvb_frontend *, fe_status_t *); + int (*fe_read_signal_strength)(struct dvb_frontend *, u16 *); + int (*fe_read_snr)(struct dvb_frontend *, u16 *); + int (*fe_read_ber)(struct dvb_frontend *, u32 *); + int (*fe_read_ucblocks)(struct dvb_frontend *, u32 *); int (*fe_set_voltage)(struct dvb_frontend *, fe_sec_voltage_t); u8 dvb_usb_lme2510_firmware; }; @@ -877,6 +881,9 @@ static int dm04_read_signal_strength(struct dvb_frontend *fe, u16 *strength) { struct lme2510_state *st = fe_to_priv(fe); + if (st->fe_read_signal_strength && !st->stream_on) + return st->fe_read_signal_strength(fe, strength); + switch (st->tuner_config) { case TUNER_LG: *strength = 0xff - st->signal_level; @@ -898,6 +905,9 @@ static int dm04_read_snr(struct dvb_frontend *fe, u16 *snr) { struct lme2510_state *st = fe_to_priv(fe); + if (st->fe_read_snr && !st->stream_on) + return st->fe_read_snr(fe, snr); + switch (st->tuner_config) { case TUNER_LG: *snr = 0xff - st->signal_sn; @@ -917,6 +927,11 @@ static int dm04_read_snr(struct dvb_frontend *fe, u16 *snr) static int dm04_read_ber(struct dvb_frontend *fe, u32 *ber) { + struct lme2510_state *st = fe_to_priv(fe); + + if (st->fe_read_ber && !st->stream_on) + return st->fe_read_ber(fe, ber); + *ber = 0; return 0; @@ -924,6 +939,11 @@ static int dm04_read_ber(struct dvb_frontend *fe, u32 *ber) static int dm04_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks) { + struct lme2510_state *st = fe_to_priv(fe); + + if (st->fe_read_ucblocks && !st->stream_on) + return st->fe_read_ucblocks(fe, ucblocks); + *ucblocks = 0; return 0; @@ -1036,6 +1056,10 @@ static int dm04_lme2510_frontend_attach(struct dvb_usb_adapter *adap) } st->fe_read_status = adap->fe[0]->ops.read_status; + st->fe_read_signal_strength = adap->fe[0]->ops.read_signal_strength; + st->fe_read_snr = adap->fe[0]->ops.read_snr; + st->fe_read_ber = adap->fe[0]->ops.read_ber; + st->fe_read_ucblocks = adap->fe[0]->ops.read_ucblocks; adap->fe[0]->ops.read_status = dm04_read_status; adap->fe[0]->ops.read_signal_strength = dm04_read_signal_strength;