From patchwork Sat Dec 28 17:04:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 3414211 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 C042F9F374 for ; Sat, 28 Dec 2013 17:05:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EB4192011B for ; Sat, 28 Dec 2013 17:05:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 24C7420103 for ; Sat, 28 Dec 2013 17:05:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755514Ab3L1RFG (ORCPT ); Sat, 28 Dec 2013 12:05:06 -0500 Received: from mail-wg0-f47.google.com ([74.125.82.47]:64547 "EHLO mail-wg0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755301Ab3L1RFF (ORCPT ); Sat, 28 Dec 2013 12:05:05 -0500 Received: by mail-wg0-f47.google.com with SMTP id n12so8896437wgh.2 for ; Sat, 28 Dec 2013 09:05:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:to:date:content-type:mime-version :content-transfer-encoding; bh=tKWG2a+XQLFM9Dao+0maEB3X0jgsNnu7v2yk5byYzIg=; b=YP7m1cl4eu9/zI3SOgG5CwyqN4e/PPfRrJdEWpUA9fbl14qNG8dLv3gTtsZHfMMvnv QhSMPWzgrOrk+RsPRT5qH+C0xTbayX9wsaN1L5r8U6uN8PG6fjS+POXMx+sLCREXHwIX D/BFFPqlT1zUegaVY7BkesXFwruZt1QaNXWymX/wQTmv99Ob+I/BTvvxqLP8abKn6Vzv XhELBG7EypTkE/0FMBJH/smqf2KMM9tj0j0e6UXq4XWvzmt2LBKLmaJSXkxI4J2pNQb1 6jzf8AMrMrNXGtop32b8kq9VTiWF7gyYyHFrxKSbrm6nMSJDuWg/THXp2dSPyn3exx36 OCwQ== X-Received: by 10.180.90.230 with SMTP id bz6mr34116756wib.17.1388250304389; Sat, 28 Dec 2013 09:05:04 -0800 (PST) Received: from [192.168.1.100] (188.29.109.137.threembb.co.uk. [188.29.109.137]) by mx.google.com with ESMTPSA id fj8sm60691903wib.1.2013.12.28.09.05.03 for (version=SSLv3 cipher=RC4-SHA bits=128/128); Sat, 28 Dec 2013 09:05:03 -0800 (PST) Message-ID: <1388250291.5893.5.camel@canaries32-MCP7A> Subject: [PATCH 3/3] m88rs2000: Correct m88rs2000_get_fec From: Malcolm Priestley To: linux-media@vger.kernel.org Date: Sat, 28 Dec 2013 17:04:51 +0000 X-Mailer: Evolution 3.10.1-2ubuntu2 Mime-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.4 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 Value of fec is achieved by the upper nibble bits 6,7 & 8. Signed-off-by: Malcolm Priestley --- drivers/media/dvb-frontends/m88rs2000.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/media/dvb-frontends/m88rs2000.c b/drivers/media/dvb-frontends/m88rs2000.c index 002b109..b235146 100644 --- a/drivers/media/dvb-frontends/m88rs2000.c +++ b/drivers/media/dvb-frontends/m88rs2000.c @@ -581,18 +581,20 @@ static fe_code_rate_t m88rs2000_get_fec(struct m88rs2000_state *state) reg = m88rs2000_readreg(state, 0x76); m88rs2000_writereg(state, 0x9a, 0xb0); + reg &= 0xf0; + reg >>= 5; + switch (reg) { - case 0x88: + case 0x4: return FEC_1_2; - case 0x68: + case 0x3: return FEC_2_3; - case 0x48: + case 0x2: return FEC_3_4; - case 0x28: + case 0x1: return FEC_5_6; - case 0x18: + case 0x0: return FEC_7_8; - case 0x08: default: break; }