public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
To: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Cc: Linux I2C <linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Konstantin Lazarev
	<klazarev-rphTv4pjVZMJGwgDXS7ZQA@public.gmane.org>
Subject: Re: [PATCH] at24: Fall back to byte or word reads if needed
Date: Mon, 8 Mar 2010 16:15:07 +0100	[thread overview]
Message-ID: <20100308161507.34913f7f@hyperion.delvare> (raw)
In-Reply-To: <20100308132454.GC3375-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>

Hi Wolfram,

On Mon, 8 Mar 2010 14:24:54 +0100, Wolfram Sang wrote:
> On Mon, Mar 08, 2010 at 08:50:08AM +0100, Jean Delvare wrote:
> > From: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
> > Subject: at24: Fall back to byte or word reads if needed
> > 
> > Increase the portability of the at24 driver by letting it read from
> > EEPROM chips connected to cheap SMBus controllers that support neither
> > raw I2C messages nor even I2C block reads. All SMBus controllers
> > should support either word reads or byte reads, so read support
> > becomes universal, much like with the legacy "eeprom" driver.
> > 
> > Obviously, this only works with EEPROM chips up to AT24C16, that use
> > 8-bit offset addressing. 16-bit offset addressing is almost impossible
> > to support on SMBus controllers.
> > 
> > I did not add universal support for writes, as I had no immediate need
> > for this, but it could be added later if needed (with the same
> > performance issue as byte and word reads have, of course.)
> > 
> > Signed-off-by: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
> > Cc: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> > Cc: Konstantin Lazarev <klazarev-rphTv4pjVZMJGwgDXS7ZQA@public.gmane.org>
> 
> I wondered a bit if switch-case would make the code more readable instead of
> if-elseif-elseif-else. But definately no show-stopper.

Good point, I'll post an updated version soon.

> I don't have hardware to actually test the new functionality, other than that
> it appears good to me. Thanks!
> 
> Reviewed-by: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>

Thanks for the review.

-- 
Jean Delvare

  parent reply	other threads:[~2010-03-08 15:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-08  7:50 [PATCH] at24: Fall back to byte or word reads if needed Jean Delvare
     [not found] ` <20100308085008.366915c3-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2010-03-08 13:24   ` Wolfram Sang
     [not found]     ` <20100308132454.GC3375-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2010-03-08 15:15       ` Jean Delvare [this message]
2010-03-08 14:12   ` Ben Dooks

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=20100308161507.34913f7f@hyperion.delvare \
    --to=khali-puyad+kwke1g9huczpvpmw@public.gmane.org \
    --cc=klazarev-rphTv4pjVZMJGwgDXS7ZQA@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    /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