Convert CONFIG_SYS_I2C_LEGACY to Kconfig and add CONFIG_[ST]PL_SYS_I2C_LEGACY
[platform/kernel/u-boot.git] / board / compulab / common / eeprom.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * (C) Copyright 2011 CompuLab, Ltd. <www.compulab.co.il>
4  *
5  * Authors: Nikita Kiryanov <nikita@compulab.co.il>
6  *          Igor Grinberg <grinberg@compulab.co.il>
7  */
8
9 #ifndef _EEPROM_
10 #define _EEPROM_
11 #include <errno.h>
12
13 #if CONFIG_IS_ENABLED(SYS_I2C_LEGACY)
14 int cl_eeprom_read_mac_addr(uchar *buf, uint eeprom_bus);
15 u32 cl_eeprom_get_board_rev(uint eeprom_bus);
16 int cl_eeprom_get_product_name(uchar *buf, uint eeprom_bus);
17 #else
18 static inline int cl_eeprom_read_mac_addr(uchar *buf, uint eeprom_bus)
19 {
20         return 1;
21 }
22 static inline u32 cl_eeprom_get_board_rev(uint eeprom_bus)
23 {
24         return 0;
25 }
26 static inline int cl_eeprom_get_product_name(uchar *buf, uint eeprom_bus)
27 {
28         return -ENOSYS;
29 }
30 #endif
31
32 #endif