I2C patch queue
- Fix AT24 EEPROM partial write (Patrick Venture) -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEE+qvnXhKRciHc/Wuy4+MsLN6twN4FAmIvSAkACgkQ4+MsLN6t wN5qiw/+MViuFuv1weGfQzCqnJYNE+6KYzIYAiN+sgeyVIGknjC6oneOvBkk6tSJ A5e/J6OS88Nvw7SroQ8u1EL6m1DYXWm8rKxP6PtzCysVYE31oXLTM4Ca2ZabhOHo 6omw2klunZQhzBrpPqv6k9UolvDMquIMOfA2M7hndkwx/OP3cz7iwQnJ9PzvMXmp IeB5cGWo0bcNXpm1i+l7K+P2IqRWLO83UgpsMyRR5on3CL1efkQJ2IY9PJ6oQawH ahvyeAxqQC04t1bmYQN2qYD6k7m0Kp/2yTonlUq+V7WxkD2fqz/Pc0WBU/8qrYtI vZTzH/x5fJ05LXLCH9cYp+IRyXOvs+gCZL44BJcPc4VLXlI1ueRqKdfcFeKjc9TA ffDX7erAG3q3QXz/5S4f+QddUxIyhnL+C2WULbCMvsNiFo43/dtFOw5oLTSBt7++ V5xWghwFxehcI5dC1+awnRsSMY+dFEiEMxYnF9Um849s3hpq9AtkwyeeYDIWl0eX bOgIR3lvCikHjfnvUsIAcS7eZQ1v9sBsRaQnyOnVhavF0+MSKtsb5iH8Y3HVahoB zG6yh7PIDHtxl7CeHmZFKh5MGPtFHj5Nttu8hHFAalmupokptchDjKld1/UimIUg TFjdTLzdRa/YAZqBsO4ieqz5J2L0MdsrYfUrakZB/CxgN5VhGqc= =YU2e -----END PGP SIGNATURE----- Merge tag 'i2c-20220314' of https://github.com/philmd/qemu into staging I2C patch queue - Fix AT24 EEPROM partial write (Patrick Venture) # gpg: Signature made Mon 14 Mar 2022 13:50:01 GMT # gpg: using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE # gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.org>" [unknown] # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: FAAB E75E 1291 7221 DCFD 6BB2 E3E3 2C2C DEAD C0DE * tag 'i2c-20220314' of https://github.com/philmd/qemu: hw/nvram: at24 return 0xff if 1 byte address Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
352998df1c
@ -58,9 +58,10 @@ int at24c_eeprom_event(I2CSlave *s, enum i2c_event event)
|
||||
|
||||
switch (event) {
|
||||
case I2C_START_SEND:
|
||||
case I2C_START_RECV:
|
||||
case I2C_FINISH:
|
||||
ee->haveaddr = 0;
|
||||
/* fallthrough */
|
||||
case I2C_START_RECV:
|
||||
DPRINTK("clear\n");
|
||||
if (ee->blk && ee->changed) {
|
||||
int len = blk_pwrite(ee->blk, 0, ee->mem, ee->rsize, 0);
|
||||
@ -84,6 +85,10 @@ uint8_t at24c_eeprom_recv(I2CSlave *s)
|
||||
EEPROMState *ee = AT24C_EE(s);
|
||||
uint8_t ret;
|
||||
|
||||
if (ee->haveaddr == 1) {
|
||||
return 0xff;
|
||||
}
|
||||
|
||||
ret = ee->mem[ee->cur];
|
||||
|
||||
ee->cur = (ee->cur + 1u) % ee->rsize;
|
||||
|
Loading…
Reference in New Issue
Block a user