Re: [PATCH] at24: Fall back to byte or word reads if needed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxx>
> > 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@xxxxxxxxxxxx>
> > Cc: Wolfram Sang <w.sang@xxxxxxxxxxxxxx>
> > Cc: Konstantin Lazarev <klazarev@xxxxxxxxxxxxx>
> 
> 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@xxxxxxxxxxxxxx>

Thanks for the review.

-- 
Jean Delvare
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux