diff options
author | Simon Glass <sjg@chromium.org> | 2019-11-14 12:57:50 -0700 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-12-02 18:25:25 -0500 |
commit | cb3ef6810a27c8ddf5db8694bcef9337f27d12ce (patch) | |
tree | 9ef10a73bda6de409282c9021026957efa598c6a /include/eeprom.h | |
parent | 533cee0a9cdccc9c65959bf2d41c3c7eb12e13f2 (diff) |
common: Move old EEPROM functions into a new header
These functions do not use driver model but are still used. Move them to a
new eeprom.h header file.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'include/eeprom.h')
-rw-r--r-- | include/eeprom.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/eeprom.h b/include/eeprom.h new file mode 100644 index 0000000000..61eb826a73 --- /dev/null +++ b/include/eeprom.h @@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * (C) Copyright 2000-2009 + * Wolfgang Denk, DENX Software Engineering, wd@denx.de. + */ + +#ifndef __EEPROM_LEGACY_H +#define __EEPROM_LEGACY_H + +#ifdef CONFIG_CMD_EEPROM +void eeprom_init(int bus); +int eeprom_read(uint dev_addr, uint offset, uchar *buffer, uint cnt); +int eeprom_write(uint dev_addr, uint offset, uchar *buffer, uint cnt); +#else +/* + * Some EEPROM code is depecated because it used the legacy I2C interface. Add + * some macros here so we don't have to touch every one of those uses + */ +#define eeprom_init(bus) +#define eeprom_read(dev_addr, offset, buffer, cnt) ((void)-ENOSYS) +#define eeprom_write(dev_addr, offset, buffer, cnt) ((void)-ENOSYS) +#endif + +#endif |