diff options
author | Simon Glass | 2019-11-14 12:57:50 -0700 |
---|---|---|
committer | Tom Rini | 2019-12-02 18:25:25 -0500 |
commit | cb3ef6810a27c8ddf5db8694bcef9337f27d12ce (patch) | |
tree | 9ef10a73bda6de409282c9021026957efa598c6a /include | |
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')
-rw-r--r-- | include/common.h | 15 | ||||
-rw-r--r-- | include/eeprom.h | 24 |
2 files changed, 24 insertions, 15 deletions
diff --git a/include/common.h b/include/common.h index 64d0cf542e8..8b37b587474 100644 --- a/include/common.h +++ b/include/common.h @@ -116,21 +116,6 @@ phys_size_t get_effective_memsize(void); void reset_phy (void); void fdc_hw_init (void); -/* $(BOARD)/eeprom.c */ -#ifdef CONFIG_CMD_EEPROM -void eeprom_init (int bus); -int eeprom_read (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cnt); -int eeprom_write (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned 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 - #if !defined(CONFIG_ENV_EEPROM_IS_ON_I2C) && defined(CONFIG_SYS_I2C_EEPROM_ADDR) # define CONFIG_SYS_DEF_EEPROM_ADDR CONFIG_SYS_I2C_EEPROM_ADDR #endif diff --git a/include/eeprom.h b/include/eeprom.h new file mode 100644 index 00000000000..61eb826a734 --- /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 |