From patchwork Fri Apr 22 09:00:22 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 726551 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p3M90YZQ029369 for ; Fri, 22 Apr 2011 09:00:34 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753977Ab1DVJAc (ORCPT ); Fri, 22 Apr 2011 05:00:32 -0400 Received: from mail-wy0-f174.google.com ([74.125.82.174]:38086 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752914Ab1DVJAa (ORCPT ); Fri, 22 Apr 2011 05:00:30 -0400 Received: by wya21 with SMTP id 21so316042wya.19 for ; Fri, 22 Apr 2011 02:00:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:subject:from:to:content-type:date:message-id :mime-version:x-mailer:content-transfer-encoding; bh=zY1kmkb8SA9ksKWlqjnZMdJ2SmYmU0M3XPnqg6lhTAw=; b=RhDPIbo7/EW/eKCoKAk99/TPYJZmxfg+9IAKCcsqukzbkET1RJDh2aOdP8A6ACSSjC R+t/CU2rS5E35hQIqEjXBOa/WUfAmGStqfDdxpfAqR2t9queVWK9ZO4xw2RwC1ZV6h4+ L7zcn/JlT/dZcIcVSutXkKVZKKgXr1inQ1JX8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:content-type:date:message-id:mime-version:x-mailer :content-transfer-encoding; b=bL+Qt3FIi7IQiKSU2H5R8vkjrtKLM4g6wXbX8fX3rARkhNIs7sAcs9xMxrmxiwMuLL xxQIBdcClZARP6Vrgw9MjlDLwIi0QHJkdo6b8uRWJtb29raqYYRRnSPGrnfihIadQBvX s6JEJnkbXbmig2Kp6hA/U/Ey+ZaDPsmWAmZbI= Received: by 10.216.24.92 with SMTP id w70mr504360wew.43.1303462828991; Fri, 22 Apr 2011 02:00:28 -0700 (PDT) Received: from [10.64.64.65] (94.197.127.231.threembb.co.uk [94.197.127.231]) by mx.google.com with ESMTPS id g22sm1304861wes.12.2011.04.22.02.00.26 (version=SSLv3 cipher=OTHER); Fri, 22 Apr 2011 02:00:27 -0700 (PDT) Subject: [PATCH] IX2505V Keep I2C gate control alive. From: Malcolm Priestley To: linux-media@vger.kernel.org Date: Fri, 22 Apr 2011 10:00:22 +0100 Message-ID: <1303462822.2525.2.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.32.2 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 22 Apr 2011 09:00:34 +0000 (UTC) Gate could close after first I2C message. On stv0288 it does. Keep 2nd and 3rd message I2C gate control alive. Remove unnecessary gate closing in this module. Signed-off-by: Malcolm Priestley --- drivers/media/dvb/frontends/ix2505v.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/media/dvb/frontends/ix2505v.c b/drivers/media/dvb/frontends/ix2505v.c index 6c2e929..9a517a4 100644 --- a/drivers/media/dvb/frontends/ix2505v.c +++ b/drivers/media/dvb/frontends/ix2505v.c @@ -218,11 +218,13 @@ static int ix2505v_set_params(struct dvb_frontend *fe, fe->ops.i2c_gate_ctrl(fe, 1); len = sizeof(data); - ret |= ix2505v_write(state, data, len); data[2] |= 0x4; /* set TM = 1 other bits same */ + if (fe->ops.i2c_gate_ctrl) + fe->ops.i2c_gate_ctrl(fe, 1); + len = 1; ret |= ix2505v_write(state, &data[2], len); /* write byte 4 only */ @@ -233,12 +235,12 @@ static int ix2505v_set_params(struct dvb_frontend *fe, deb_info("Data 2=[%x%x]\n", data[2], data[3]); + if (fe->ops.i2c_gate_ctrl) + fe->ops.i2c_gate_ctrl(fe, 1); + len = 2; ret |= ix2505v_write(state, &data[2], len); /* write byte 4 & 5 */ - if (fe->ops.i2c_gate_ctrl) - fe->ops.i2c_gate_ctrl(fe, 0); - if (state->config->min_delay_ms) msleep(state->config->min_delay_ms);