From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko Schocher Date: Thu, 14 Apr 2011 08:38:35 +0200 Subject: [U-Boot] [PATCH v2] I2C: OMAP: detect more devices when probing an i2c bus In-Reply-To: <4DA40F55.5090602@ge.com> References: <4DA40F55.5090602@ge.com> Message-ID: <4DA6966B.2010701@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 Hello Nick, Nick Thompson wrote: > The omap24xx driver only seems to support devices that have a single subaddress > byte. With these types of devices, the first access in a bus transaction is > usually a write (writes the subaddress) followed by either a read or write to > access the devices registers. > > Many such devices will respond to a read as the first access, but there are at > least some that will NACK such a read. (e.g. ADV7180.) > > The probe function attempts to detect a devices ACK to a read access only and > fails to find devices that NACK a read. > > This commit modifies the probe function to start a write instead. This detects > devices that respond to reads (since they must also respond to writes) as well > as those that only respond to writes. The bus is immediately set to idle after a > (N)ACK avoiding actually writing anything to the device. > > Signed-off-by: Nick Thompson > --- > Tested on OMAP3530 with an ADV7180 video ADC. > > Detection of a device takes the same time as failing to find a device, so the > probe is slightly faster. > > V2 Changes: > Removed two checkpatch errors (space prohibited between function name and open > parenthesis) > > drivers/i2c/omap24xx_i2c.c | 42 +++++++++++------------------------------- > 1 files changed, 11 insertions(+), 31 deletions(-) Applied to u-boot-i2c.git, thanks. bye, Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany