mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: mchehab@infradead.org
To: linux-kernel@vger.kernel.org
Cc: linux-dvb-maintainer@linuxtv.org,
	Oliver Endriss <o.endriss@gmx.de>,
	Mauro Carvalho Chehab <mchehab@infradead.org>
Subject: [PATCH 6/7] V4L/DVB (4784): [saa7146_i2c] short_delay mode fixed for fast machines
Date: Fri, 03 Nov 2006 01:02:14 -0300	[thread overview]
Message-ID: <20061103040214.PS1889240006@infradead.org> (raw)
In-Reply-To: <20061103035925.PS9047100000@infradead.org>


From: Oliver Endriss <o.endriss@gmx.de>

TT DVB-C 2300 runs at 137 kHz I2C speed. short_delay mode did not work
reliably on fast machines with that speed. Increased max loop count from
20 to 50. Moved dummy access out of the loop.

Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
---

 drivers/media/common/saa7146_i2c.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/media/common/saa7146_i2c.c b/drivers/media/common/saa7146_i2c.c
index d9953f7..5297a36 100644
--- a/drivers/media/common/saa7146_i2c.c
+++ b/drivers/media/common/saa7146_i2c.c
@@ -217,11 +217,9 @@ static int saa7146_i2c_writeout(struct s
 		}
 		/* wait until we get a transfer done or error */
 		timeout = jiffies + HZ/100 + 1; /* 10ms */
+		/* first read usually delivers bogus results... */
+		saa7146_i2c_status(dev);
 		while(1) {
-			/**
-			 *  first read usually delivers bogus results...
-			 */
-			saa7146_i2c_status(dev);
 			status = saa7146_i2c_status(dev);
 			if ((status & 0x3) != 1)
 				break;
@@ -232,10 +230,10 @@ static int saa7146_i2c_writeout(struct s
 				DEB_I2C(("saa7146_i2c_writeout: timed out waiting for end of xfer\n"));
 				return -EIO;
 			}
-			if ((++trial < 20) && short_delay)
+			if (++trial < 50 && short_delay)
 				udelay(10);
 			else
-			msleep(1);
+				msleep(1);
 		}
 	}
 


  parent reply	other threads:[~2006-11-03  4:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-03  3:59 [PATCH 0/7] V4L/DVB fixes mchehab
2006-11-03  4:02 ` [PATCH 1/7] V4L/DVB (4752): DVB: Add DVB_FE_CUSTOMISE support for MT2060 mchehab
2006-11-03  4:02 ` [PATCH 2/7] V4L/DVB (4785): Budget-ci: Change DEBIADDR_IR to a safer default mchehab
2006-11-03  4:02 ` [PATCH 3/7] V4L/DVB (4786): Pvrusb2: use NULL instead of 0 mchehab
2006-11-03  4:02 ` [PATCH 4/7] V4L/DVB (4787): Budget-ci: Inversion setting fixed for Technotrend 1500 T mchehab
2006-11-03  4:02 ` [PATCH 7/7] V4L/DVB (4751): Fix DBV_FE_CUSTOMISE for card drivers compiled into kernel mchehab
2006-11-03  4:02 ` mchehab [this message]
2006-11-03  4:02 ` [PATCH 5/7] V4L/DVB (4770): Fix mode switch of Compro Videomate T300 mchehab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061103040214.PS1889240006@infradead.org \
    --to=mchehab@infradead.org \
    --cc=linux-dvb-maintainer@linuxtv.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=o.endriss@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®