at24: writing with SMBUS and no I2C_FUNC_SMBUS_WRITE_I2C_BLOCK
Hello -
I have a system that uses SMBUS, but without the I2C_FUNC_SMBUS_WRITE_I2C_BLOCK functionality. As it is today at24.c will only support read-only mode for this case.
Looking at at24_eeprom_write() the comments indicate it only supports page writes as the alternative is too slow. This decision seems to be the root of why SMBUS without I2C_FUNC_SMBUS_WRITE_I2C_BLOCK gives the read-only situation.
The notion of "slow" seems a bit arbitrary to me. Is there some other technical reason or gotcha hiding here that you know of?
Would a nicely written patch that adds write support for this case be acceptable? I have not written it yet, but would like to.
Cheers,
Curt
A message that is not in the archive (sent off-list or not yet received): 20140305183305.GS27140-qUQiAmfTcIp+XZJcv9eMoEEOCMrvLtNR@public.gmane.org
Wolfram Sang
Reviewed-byQuoted 3 lines
The notion of "slow" seems a bit arbitrary to me. Is there some other technical reason or gotcha hiding here that you know of?
$ git show 7aeb96642f70139a194d685b132605836f6f8dbb
commit 7aeb96642f70139a194d685b132605836f6f8dbb
Author: Jean Delvare <[email protected]> Date: Fri May 21 18:40:57 2010 +0200
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.)
Quoted 2 lines
Would a nicely written patch that adds write support for this case be acceptable? I have not written it yet, but would like to.
Yes, it would.
All the best,
Wolfram