mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 15:14:43 +00:00
d7e28918aa
This patch implements the reading functionality for the generic I2C EEPROM driver, which was just a non-functional stub until now. Since the page size will be of importance for the writing support, we add suitable members to the private data structure to keep track of it. Compatibility strings for a range of at24c* chips are added. Signed-off-by: Mario Six <mario.six@gdsys.cc> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heiko Schocher <hs@denx.de>
23 lines
488 B
C
23 lines
488 B
C
/*
|
|
* Copyright (c) 2014 Google, Inc
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0+
|
|
*/
|
|
|
|
#ifndef __I2C_EEPROM
|
|
#define __I2C_EEPROM
|
|
|
|
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);
|
|
};
|
|
|
|
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;
|
|
};
|
|
|
|
#endif
|