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
|
|
@ -16,6 +16,7 @@ struct smbus_bus_operations {
|
|||
int (*block_read)(struct device *dev, u8 cmd, u8 bytes, u8 *buffer);
|
||||
int (*block_write)(struct device *dev, u8 cmd, u8 bytes,
|
||||
const u8 *buffer);
|
||||
int (*i2c_eeprom_read)(struct device *dev, u8 offset, u8 bytes, u8 *buffer);
|
||||
};
|
||||
|
||||
static inline const struct smbus_bus_operations *ops_smbus_bus(struct bus *bus)
|
||||
|
|
@ -54,6 +55,7 @@ static inline int smbus_write_byte(struct device *const dev, u8 addr, u8 val)
|
|||
|
||||
int smbus_block_read(struct device *dev, u8 cmd, u8 bytes, u8 *buffer);
|
||||
int smbus_block_write(struct device *dev, u8 cmd, u8 bytes, const u8 *buffer);
|
||||
int smbus_i2c_eeprom_read(struct device *dev, u8 cmd, u8 bytes, u8 *buffer);
|
||||
#endif
|
||||
|
||||
#endif /* DEVICE_SMBUS_H */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue