public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tolunay Orkun <listmember@orkun.us>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH] soft_i2c/i2c_probe(): Perform reads instead of writes
Date: Thu, 26 May 2005 17:35:14 -0500	[thread overview]
Message-ID: <42964F22.60600@orkun.us> (raw)
In-Reply-To: <87ekbt3g7h.fsf@p4.48ers.dk>

Peter,

I believe the implementation was correct but the comment was wrong. It 
should be a write transaction with just address byte. After the address 
byte is transmitted the I2C slave will acknowledge (if present) and we 
finish the transaction by generating the stop condition. i.e. fake write.

Best regards,
Tolunay

Peter Korsgaard wrote:
> Hi,
> 
> The following little patch makes the i2c_probe function use reads
> instead of writes to match the comment (broken in r1.2).
> 
> * Patch by Peter Korsgaard, 26 May 2005:
>   Use reads instead of writes for probe in soft_i2c.
> 
> 
> 
> ------------------------------------------------------------------------
> 
> Index: common/soft_i2c.c
> ===================================================================
> RCS file: /cvsroot/u-boot/u-boot/common/soft_i2c.c,v
> retrieving revision 1.5
> diff -u -p -u -r1.5 soft_i2c.c
> --- common/soft_i2c.c	21 Nov 2004 00:06:35 -0000	1.5
> +++ common/soft_i2c.c	26 May 2005 19:45:05 -0000
> @@ -290,7 +290,7 @@ int i2c_probe(uchar addr)
>  
>  	/* perform 1 byte read transaction */
>  	send_start();
> -	rc = write_byte ((addr << 1) | 0);
> +	rc = write_byte ((addr << 1) | 1);
>  	send_stop();
>  
>  	return (rc ? 1 : 0);
> 
> 
> ------------------------------------------------------------------------
> 
> 

  reply	other threads:[~2005-05-26 22:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-26 20:06 [U-Boot-Users] [PATCH] soft_i2c/i2c_probe(): Perform reads instead of writes Peter Korsgaard
2005-05-26 22:35 ` Tolunay Orkun [this message]
2005-06-11 14:41   ` Peter Korsgaard
2005-06-14 21:34     ` Tolunay Orkun
2005-06-15  3:16       ` Eugene Surovegin
2005-06-15  6:25       ` Peter Korsgaard
2006-03-12  0:31 ` Wolfgang Denk

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=42964F22.60600@orkun.us \
    --to=listmember@orkun.us \
    --cc=u-boot@lists.denx.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