From 20142019a96a72bf1516be93a86fc10d028fd136 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 10 Dec 2014 08:55:54 -0700 Subject: dm: Add a simple EEPROM driver There seem to be a few EEPROM drivers around - perhaps we should have a single standard one? This simple driver is used for sandbox testing, but could be pressed into more active service. Signed-off-by: Simon Glass Acked-by: Heiko Schocher Reviewed-by: Masahiro Yamada --- include/dm/uclass-id.h | 1 + include/i2c_eeprom.h | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 include/i2c_eeprom.h (limited to 'include') diff --git a/include/dm/uclass-id.h b/include/dm/uclass-id.h index 16e4224c16..f17c3c2b38 100644 --- a/include/dm/uclass-id.h +++ b/include/dm/uclass-id.h @@ -32,6 +32,7 @@ enum uclass_id { UCLASS_THERMAL, /* Thermal sensor */ UCLASS_I2C, /* I2C bus */ UCLASS_I2C_GENERIC, /* Generic I2C device */ + UCLASS_I2C_EEPROM, /* I2C EEPROM device */ UCLASS_COUNT, UCLASS_INVALID = -1, diff --git a/include/i2c_eeprom.h b/include/i2c_eeprom.h new file mode 100644 index 0000000000..ea6c962a39 --- /dev/null +++ b/include/i2c_eeprom.h @@ -0,0 +1,19 @@ +/* + * 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 { +}; + +#endif -- cgit