From patchwork Thu Jul 24 20:29:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 4619841 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 576319F39B for ; Thu, 24 Jul 2014 20:29:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 815D1201DD for ; Thu, 24 Jul 2014 20:29:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9D139201D3 for ; Thu, 24 Jul 2014 20:29:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934607AbaGXU3d (ORCPT ); Thu, 24 Jul 2014 16:29:33 -0400 Received: from qmta02.emeryville.ca.mail.comcast.net ([76.96.30.24]:48538 "EHLO qmta02.emeryville.ca.mail.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934176AbaGXU3c (ORCPT ); Thu, 24 Jul 2014 16:29:32 -0400 Received: from omta14.emeryville.ca.mail.comcast.net ([76.96.30.60]) by qmta02.emeryville.ca.mail.comcast.net with comcast id WL4K1o0021HpZEsA2LVXhy; Thu, 24 Jul 2014 20:29:31 +0000 Received: from mail.gonehiking.org ([50.134.149.16]) by omta14.emeryville.ca.mail.comcast.net with comcast id WLVW1o0050MU7Qa8aLVWjU; Thu, 24 Jul 2014 20:29:31 +0000 Received: from lorien.sisa.samsung.com (lorien-wl.internal [192.168.1.40]) by mail.gonehiking.org (Postfix) with ESMTP id 7DF593FC88; Thu, 24 Jul 2014 14:29:29 -0600 (MDT) From: Shuah Khan To: m.chehab@samsung.com, dheitmueller@kernellabs.com Cc: Shuah Khan , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] media: drx39xyj - use drxj_set_lna_state() and remove duplicate LNA code Date: Thu, 24 Jul 2014 14:29:28 -0600 Message-Id: <1406233768-7976-1-git-send-email-shuah.kh@samsung.com> X-Mailer: git-send-email 1.9.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20140121; t=1406233771; bh=MjtpdN+2ynypAcR76btaMWUOYcwf95pAPFhtRpg4AmY=; h=Received:Received:Received:From:To:Subject:Date:Message-Id; b=X/Y9ZWzHI8SSNcg31KMsdLbCg8vbOKIIuy+39t35YF44bv68F1ShKadH1gFOcGS2S KIo3TB8oxkUiud7O+6d/6WgITm/4RG53O3zeoRBy0HpEV+yYSIBb7AMd2H4XJKlTX4 /ezkn3hLV5MYUOpiSeKHqS4ua/zyqIe4803JshKhikQgcknb9LQp6Xl91d/b0vPtzm Ijf1X8FsdFYP3mCzQRh2DzEE+sqNfFI3ZMHPTb2JMWkSF7RN5S4zGVsv/SaX6HscE+ 8TqEtFILGJdILLqNYwPzRfooMpDezqmbjXkxh6XjT8iFO4RyVshH8k7VndkvigJTdj 6/OyY0KqNsfIA== 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_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,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 drx39xxj_set_lna() and drx39xxj_set_frontend() set LNA. Instead of duplicating LNA configure code, change to use drxj_set_lna_state() which sets LNA to the caller requested state (on or off). Signed-off-by: Shuah Khan --- This patch depends on previous patch that added drxj_set_lna_state(). https://lkml.org/lkml/2014/7/24/469 drivers/media/dvb-frontends/drx39xyj/drxj.c | 29 ++------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/drivers/media/dvb-frontends/drx39xyj/drxj.c b/drivers/media/dvb-frontends/drx39xyj/drxj.c index 31fee7b..d6d2930 100644 --- a/drivers/media/dvb-frontends/drx39xyj/drxj.c +++ b/drivers/media/dvb-frontends/drx39xyj/drxj.c @@ -12154,13 +12154,7 @@ static int drx39xxj_set_frontend(struct dvb_frontend *fe) return -EINVAL; } /* Just for giggles, let's shut off the LNA again.... */ - uio_data.uio = DRX_UIO1; - uio_data.value = false; - result = ctrl_uio_write(demod, &uio_data); - if (result != 0) { - pr_err("Failed to disable LNA!\n"); - return 0; - } + drxj_set_lna_state(demod, false); /* After set_frontend, except for strength, stats aren't available */ p->strength.stat[0].scale = FE_SCALE_RELATIVE; @@ -12243,26 +12237,7 @@ static int drx39xxj_set_lna(struct dvb_frontend *fe) } } - /* Turn off the LNA */ - uio_cfg.uio = DRX_UIO1; - uio_cfg.mode = DRX_UIO_MODE_READWRITE; - /* Configure user-I/O #3: enable read/write */ - result = ctrl_set_uio_cfg(demod, &uio_cfg); - if (result) { - pr_err("Failed to setup LNA GPIO!\n"); - return result; - } - - uio_data.uio = DRX_UIO1; - uio_data.value = c->lna; - result = ctrl_uio_write(demod, &uio_data); - if (result != 0) { - pr_err("Failed to %sable LNA!\n", - c->lna ? "en" : "dis"); - return result; - } - - return 0; + return drxj_set_lna_state(demod, c->lna); } static int drx39xxj_get_tune_settings(struct dvb_frontend *fe,