From: Eugene Surovegin Date: Tue, 14 Jun 2005 20:16:36 -0700 Subject: [U-Boot-Users] [PATCH] soft_i2c/i2c_probe(): Perform reads instead of writes In-Reply-To: <42AF4D6E.8050208@orkun.us> References: <87ekbt3g7h.fsf@p4.48ers.dk> <42964F22.60600@orkun.us> <87hdg5c5w8.fsf@p4.48ers.dk> <42AF4D6E.8050208@orkun.us> Message-ID: <20050615031636.GA13466@gate.ebshome.net> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tue, Jun 14, 2005 at 04:34:38PM -0500, Tolunay Orkun wrote: > Peter Korsgaard wrote: > > >>>>>>"Tolunay" == Tolunay Orkun writes: > >>>>>> > >>>>>> > > > >Hi, and sorry for the slow response! > > > >Tolunay> Peter, I believe the implementation was correct but the > >Tolunay> comment was wrong. It should be a write transaction with > >Tolunay> just address byte. After the address byte is transmitted the > >Tolunay> I2C slave will acknowledge (if present) and we finish the > >Tolunay> transaction by generating the stop condition. i.e. fake > >Tolunay> write. > > > >Why write? Wouldn't a zero byte read transaction be safer? > > > > > > > I have read somewhere (that I cannot find now), that some device would > lock up on 0-byte read vs 0-byte write. Since the current code is > working as it is unless there is demonstrable problem with it, I would > fix the comment only. Ebony (PPC440GP eval board) has a device like this, IIRC it's a clock driver, zero-read locks the bus completely. In general, zero write is safer, also SMBUS spec defines such transaction as SMBUS QUICK; interestingly, there is no read equivalent :). Also, from personal testing, using zero-write as detection hack, yields more devices than zero-read. -- Eugene