From patchwork Tue Mar 24 21:12:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antti Palosaari X-Patchwork-Id: 6085951 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 48C549F318 for ; Tue, 24 Mar 2015 21:13:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7755C201EC for ; Tue, 24 Mar 2015 21:13:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 76E6C20212 for ; Tue, 24 Mar 2015 21:13:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752275AbbCXVNZ (ORCPT ); Tue, 24 Mar 2015 17:13:25 -0400 Received: from mail.kapsi.fi ([217.30.184.167]:60347 "EHLO mail.kapsi.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752939AbbCXVNK (ORCPT ); Tue, 24 Mar 2015 17:13:10 -0400 Received: from dyn3-82-128-188-243.psoas.suomi.net ([82.128.188.243] helo=localhost.localdomain.localdomain) by mail.kapsi.fi with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YaW8K-0000up-W2; Tue, 24 Mar 2015 23:13:09 +0200 From: Antti Palosaari To: linux-media@vger.kernel.org Cc: Antti Palosaari Subject: [PATCH 8/8] ts2020: do not use i2c_transfer() on sleep() Date: Tue, 24 Mar 2015 23:12:13 +0200 Message-Id: <1427231533-4277-9-git-send-email-crope@iki.fi> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1427231533-4277-1-git-send-email-crope@iki.fi> References: <1427231533-4277-1-git-send-email-crope@iki.fi> X-SA-Exim-Connect-IP: 82.128.188.243 X-SA-Exim-Mail-From: crope@iki.fi X-SA-Exim-Scanned: No (on mail.kapsi.fi); SAEximRunCond expanded to false 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.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, 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 There is no need to use bulk i2c_transfer() to write single register. Use write register function instead. Signed-off-by: Antti Palosaari --- drivers/media/dvb-frontends/ts2020.c | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/drivers/media/dvb-frontends/ts2020.c b/drivers/media/dvb-frontends/ts2020.c index b1d91dc..90164a3 100644 --- a/drivers/media/dvb-frontends/ts2020.c +++ b/drivers/media/dvb-frontends/ts2020.c @@ -123,29 +123,14 @@ static int ts2020_readreg(struct dvb_frontend *fe, u8 reg) static int ts2020_sleep(struct dvb_frontend *fe) { struct ts2020_priv *priv = fe->tuner_priv; - int ret; - u8 buf[] = { 10, 0 }; - struct i2c_msg msg = { - .addr = priv->i2c_address, - .flags = 0, - .buf = buf, - .len = 2 - }; - - if (priv->tuner == TS2020_M88TS2022) - buf[0] = 0x00; - - if (fe->ops.i2c_gate_ctrl) - fe->ops.i2c_gate_ctrl(fe, 1); - - ret = i2c_transfer(priv->i2c, &msg, 1); - if (ret != 1) - printk(KERN_ERR "%s: i2c error\n", __func__); + u8 u8tmp; - if (fe->ops.i2c_gate_ctrl) - fe->ops.i2c_gate_ctrl(fe, 0); + if (priv->tuner == TS2020_M88TS2020) + u8tmp = 0x0a; /* XXX: probably wrong */ + else + u8tmp = 0x00; - return (ret == 1) ? 0 : ret; + return ts2020_writereg(fe, u8tmp, 0x00); } static int ts2020_init(struct dvb_frontend *fe)