diff options
Diffstat (limited to 'roms/u-boot/include/w1-eeprom.h')
-rw-r--r-- | roms/u-boot/include/w1-eeprom.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/roms/u-boot/include/w1-eeprom.h b/roms/u-boot/include/w1-eeprom.h new file mode 100644 index 000000000..b3cf77a81 --- /dev/null +++ b/roms/u-boot/include/w1-eeprom.h @@ -0,0 +1,31 @@ +/* SPDX-License-Identifier: GPL-2.0+ + * + * Copyright (c) 2015 Free Electrons + * Copyright (c) 2015 NextThing Co + * Copyright (c) 2018 Microchip Technology, Inc. + * + */ + +#ifndef __W1_EEPROM_H +#define __W1_EEPROM_H + +struct udevice; + +struct w1_eeprom_ops { + /* + * Reads a buff from the given EEPROM memory, starting at + * given offset and place the results into the given buffer. + * Should read given count of bytes. + * Should return 0 on success, and normal error.h on error + */ + int (*read_buf)(struct udevice *dev, unsigned int offset, + u8 *buf, unsigned int count); +}; + +int w1_eeprom_read_buf(struct udevice *dev, unsigned int offset, + u8 *buf, unsigned int count); + +int w1_eeprom_dm_init(void); + +int w1_eeprom_get_id(struct udevice *dev, u64 *id); +#endif |