From patchwork Tue Jul 23 15:24:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Lee X-Patchwork-Id: 2832027 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5D2A5C0319 for ; Tue, 23 Jul 2013 15:24:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2F4C5201DF for ; Tue, 23 Jul 2013 15:24:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0EB46201DD for ; Tue, 23 Jul 2013 15:24:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932138Ab3GWPYP (ORCPT ); Tue, 23 Jul 2013 11:24:15 -0400 Received: from mail-pb0-f52.google.com ([209.85.160.52]:42206 "EHLO mail-pb0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757536Ab3GWPYO (ORCPT ); Tue, 23 Jul 2013 11:24:14 -0400 Received: by mail-pb0-f52.google.com with SMTP id xa12so8495175pbc.25 for ; Tue, 23 Jul 2013 08:24:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=SeuZl2l+HXfOvB+XX331nABAs/lNd7NGKa7w0Jy6NS4=; b=Ufl+en2yjCdD25tLOsz2tRNDitH0E+Wc/pK+O/0ZkD3XtCke3TYoPYwVEx1/MER2lW 6nquLuwDvXEOiKGs6GOolRKughClEdh9b28HAeuQYQv+9BR1VRxeaeEZoWaZY04pQOqQ zzEDCFqybEKIURVSu2GbqFZlTSHarrwYDjNq/S7lljtOY4ZklYWORBzEK0Plz7lSTSd+ x2PwaIb6gy/n/aX/DavY9R27T3ibT+1x50OhIFVXWyxyjJsNOiRPDZgrCT+jfXbP6AsF jCdOgbo525L1QDj3P58gdWth+AYoFfcKW6ErmEdstn20dHiTf/n3oFuQfFRgbjXaI5eZ 05JQ== X-Received: by 10.68.143.199 with SMTP id sg7mr37506270pbb.13.1374593054179; Tue, 23 Jul 2013 08:24:14 -0700 (PDT) Received: from dvb.updatelee.net (S0106c0c1c01263ff.ed.shawcable.net. [68.148.74.18]) by mx.google.com with ESMTPSA id aj3sm45937927pad.8.2013.07.23.08.24.13 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 23 Jul 2013 08:24:13 -0700 (PDT) From: Chris Lee To: linux-media@vger.kernel.org Cc: Chris Lee Subject: [PATCH] gp8psk: Implement gp8psk_fe_read_ber Date: Tue, 23 Jul 2013 09:24:02 -0600 Message-Id: <1374593042-13574-1-git-send-email-updatelee@gmail.com> X-Mailer: git-send-email 1.8.1.2 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, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 Signed-off-by: Chris Lee --- drivers/media/usb/dvb-usb/gp8psk-fe.c | 13 ++++++++++--- drivers/media/usb/dvb-usb/gp8psk.h | 1 + 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/media/usb/dvb-usb/gp8psk-fe.c b/drivers/media/usb/dvb-usb/gp8psk-fe.c index 5864f37..223a3ca 100644 --- a/drivers/media/usb/dvb-usb/gp8psk-fe.c +++ b/drivers/media/usb/dvb-usb/gp8psk-fe.c @@ -68,11 +68,18 @@ static int gp8psk_fe_read_status(struct dvb_frontend* fe, fe_status_t *status) return 0; } -/* not supported by this Frontend */ static int gp8psk_fe_read_ber(struct dvb_frontend* fe, u32 *ber) { - (void) fe; - *ber = 0; + struct gp8psk_fe_state *st = fe->demodulator_priv; + + u8 buf[4]; + + if (gp8psk_usb_in_op(st->d, GET_BER_RATE, 0, 0, buf, 4)) { + return -EINVAL; + } + + *ber = (buf[3] << 24) + (buf[2] << 16) + (buf[1] << 8) + buf[0]; + return 0; } diff --git a/drivers/media/usb/dvb-usb/gp8psk.h b/drivers/media/usb/dvb-usb/gp8psk.h index ed32b9d..ff6bb3c 100644 --- a/drivers/media/usb/dvb-usb/gp8psk.h +++ b/drivers/media/usb/dvb-usb/gp8psk.h @@ -52,6 +52,7 @@ extern int dvb_usb_gp8psk_debug; #define GET_SERIAL_NUMBER 0x93 /* in */ #define USE_EXTRA_VOLT 0x94 #define GET_FPGA_VERS 0x95 +#define GET_BER_RATE 0x9B #define CW3K_INIT 0x9d /* PSK_configuration bits */