X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=include%2Fi2c_eeprom.h;h=cd620d519fca478307a9f511ad69585c92d8d872;hb=f9a48654ee70fbad29f487d074fd36a1548b4209;hp=bb5c6b118b9345cf277fd1afaf3da74c58499b59;hpb=1f5541c8818d3ecd243f9bbf58db9ea5f55a3195;p=platform%2Fkernel%2Fu-boot.git diff --git a/include/i2c_eeprom.h b/include/i2c_eeprom.h index bb5c6b1..cd620d5 100644 --- a/include/i2c_eeprom.h +++ b/include/i2c_eeprom.h @@ -1,7 +1,6 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ /* * Copyright (c) 2014 Google, Inc - * - * SPDX-License-Identifier: GPL-2.0+ */ #ifndef __I2C_EEPROM @@ -11,13 +10,14 @@ struct i2c_eeprom_ops { int (*read)(struct udevice *dev, int offset, uint8_t *buf, int size); int (*write)(struct udevice *dev, int offset, const uint8_t *buf, int size); + int (*size)(struct udevice *dev); }; 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; + /* The EEPROM's capacity in bytes */ + unsigned long size; }; /* @@ -44,4 +44,13 @@ int i2c_eeprom_read(struct udevice *dev, int offset, uint8_t *buf, int size); */ int i2c_eeprom_write(struct udevice *dev, int offset, uint8_t *buf, int size); +/* + * i2c_eeprom_size() - get size of I2C EEPROM chip + * + * @dev: Chip to query + * + * @return +ve size in bytes on success, -ve on failure + */ +int i2c_eeprom_size(struct udevice *dev); + #endif