From patchwork Wed Apr 17 00:42:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 2451791 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 96DBC3FDC4 for ; Wed, 17 Apr 2013 00:43:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755910Ab3DQAnC (ORCPT ); Tue, 16 Apr 2013 20:43:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60526 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755871Ab3DQAnB (ORCPT ); Tue, 16 Apr 2013 20:43:01 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r3H0h0DY031275 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 16 Apr 2013 20:43:00 -0400 Received: from pedra (vpn1-7-94.gru2.redhat.com [10.97.7.94]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r3H0gvdb006697 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 16 Apr 2013 20:42:59 -0400 Received: from v4l by pedra with local (Exim 4.80.1) (envelope-from ) id 1USGSU-0001Io-NP; Tue, 16 Apr 2013 21:42:46 -0300 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , Linux Media Mailing List Subject: [PATCH v2 24/31] [media] r820t: avoid rewrite all regs when not needed Date: Tue, 16 Apr 2013 21:42:35 -0300 Message-Id: <1366159362-3773-25-git-send-email-mchehab@redhat.com> In-Reply-To: <1366159362-3773-1-git-send-email-mchehab@redhat.com> References: <1366159362-3773-1-git-send-email-mchehab@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 To: unlisted-recipients:; (no To-header on input) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Signed-off-by: Mauro Carvalho Chehab --- drivers/media/tuners/r820t.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/media/tuners/r820t.c b/drivers/media/tuners/r820t.c index 2e6a690..fc660f2 100644 --- a/drivers/media/tuners/r820t.c +++ b/drivers/media/tuners/r820t.c @@ -2006,18 +2006,17 @@ static int r820t_imr_callibrate(struct r820t_priv *priv) if (priv->init_done) return 0; - /* Initialize registers */ - rc = r820t_write(priv, 0x05, - r820t_init_array, sizeof(r820t_init_array)); - if (rc < 0) - return rc; - /* Detect Xtal capacitance */ if ((priv->cfg->rafael_chip == CHIP_R820T) || (priv->cfg->rafael_chip == CHIP_R828S) || (priv->cfg->rafael_chip == CHIP_R820C)) { priv->xtal_cap_sel = XTAL_HIGH_CAP_0P; } else { + /* Initialize registers */ + rc = r820t_write(priv, 0x05, + r820t_init_array, sizeof(r820t_init_array)); + if (rc < 0) + return rc; for (i = 0; i < 3; i++) { rc = r820t_xtal_check(priv); if (rc < 0)