From: Wolfgang Denk Date: Fri, 04 Sep 2009 10:31:00 +0200 Subject: [U-Boot] Odd value for I2C_TIMEOUT in fsl_i2c.c In-Reply-To: <4A9FDF1E.4090908@freescale.com> References: <4A9FDF1E.4090908@freescale.com> Message-ID: <20090904083100.4F126832E8DE@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Timur Tabi, In message <4A9FDF1E.4090908@freescale.com> you wrote: > Currently we define I2C_TIMEOUT like this: > > #define I2C_TIMEOUT (CONFIG_SYS_HZ / 4) = 250, that is. > CONFIG_HZ is 1000, so I2C_TIMEOUT is equal to 250. However, the way it's used, 250 isn't the number of ticks per second, it's used as number of microseconds. If CONFIG_HZ is changed to 100, does that mean that we want to call usec2ticks(25)? CONFIG_SYS_HZ is a constant of 1000. We do not change constants. > Surely, one millisecond is not too long of a timeout? It definitely depends which sort of timeout this is. I guess there is some specification? Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Don't put off for tomorrow what you can do today, because if you enjoy it today you can do it again tomorrow.