]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - include/i2c_eeprom.h
bootstage: Record the time taken to set up driver model
[people/ms/u-boot.git] / include / i2c_eeprom.h
index ea6c962a3932f3bc7a28276a93e2bc9c45f2a2cf..bb5c6b118b9345cf277fd1afaf3da74c58499b59 100644 (file)
@@ -14,6 +14,34 @@ struct i2c_eeprom_ops {
 };
 
 struct i2c_eeprom {
+       /* The EEPROM's page size in byte */
+       unsigned long pagesize;
+       /* The EEPROM's page width in bits (pagesize = 2^pagewidth) */
+       unsigned pagewidth;
 };
 
+/*
+ * i2c_eeprom_read() - read bytes from an I2C EEPROM chip
+ *
+ * @dev:       Chip to read from
+ * @offset:    Offset within chip to start reading
+ * @buf:       Place to put data
+ * @size:      Number of bytes to read
+ *
+ * @return 0 on success, -ve on failure
+ */
+int i2c_eeprom_read(struct udevice *dev, int offset, uint8_t *buf, int size);
+
+/*
+ * i2c_eeprom_write() - write bytes to an I2C EEPROM chip
+ *
+ * @dev:       Chip to write to
+ * @offset:    Offset within chip to start writing
+ * @buf:       Buffer containing data to write
+ * @size:      Number of bytes to write
+ *
+ * @return 0 on success, -ve on failure
+ */
+int i2c_eeprom_write(struct udevice *dev, int offset, uint8_t *buf, int size);
+
 #endif