device/smbus: Add i2c_eeprom_read
Expose the existing i2c block read functionality usually used in romstage to the smbus_bus_operations for use in ramstage. This allows faster reading of I2C EEPROM in ramstage. TEST=Can read I2C EEPROM on Lenovo X220 using I2C block read. Change-Id: I1264f17317c3095f9661b0ab6aa3124a00ce86c5 Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/91028 Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Paul Menzel <paulepanter@mailbox.org> Reviewed-by: Alicja Michalska <ahplka19@gmail.com>
This commit is contained in:
parent
051516af1a
commit
c242193ca4
3 changed files with 27 additions and 4 deletions
|
|
@ -35,3 +35,11 @@ int smbus_block_write(struct device *dev, u8 cmd, u8 bytes, const u8 *buffer)
|
|||
return ops_smbus_bus(get_pbus_smbus(dev))->block_write(dev, cmd,
|
||||
bytes, buffer);
|
||||
}
|
||||
|
||||
int smbus_i2c_eeprom_read(struct device *dev, u8 cmd, u8 bytes, u8 *buffer)
|
||||
{
|
||||
CHECK_PRESENCE(i2c_eeprom_read);
|
||||
|
||||
return ops_smbus_bus(get_pbus_smbus(dev))->i2c_eeprom_read(dev, cmd,
|
||||
bytes, buffer);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue