w1-eeprom.h 820 B

123456789101112131415161718192021222324252627282930313233
  1. /* SPDX-License-Identifier: GPL-2.0+
  2. *
  3. * Copyright (c) 2015 Free Electrons
  4. * Copyright (c) 2015 NextThing Co
  5. * Copyright (c) 2018 Microchip Technology, Inc.
  6. *
  7. */
  8. #ifndef __W1_EEPROM_H
  9. #define __W1_EEPROM_H
  10. struct udevice;
  11. struct w1_eeprom_ops {
  12. /*
  13. * Reads a buff from the given EEPROM memory, starting at
  14. * given offset and place the results into the given buffer.
  15. * Should read given count of bytes.
  16. * Should return 0 on success, and normal error.h on error
  17. */
  18. int (*read_buf)(struct udevice *dev, unsigned int offset,
  19. u8 *buf, unsigned int count);
  20. };
  21. int w1_eeprom_read_buf(struct udevice *dev, unsigned int offset,
  22. u8 *buf, unsigned int count);
  23. int w1_eeprom_dm_init(void);
  24. int w1_eeprom_register_new_device(u64 id);
  25. int w1_eeprom_get_id(struct udevice *dev, u64 *id);
  26. #endif