i2c_eeprom.c 999 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * Copyright (c) 2014 Google, Inc
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. */
  6. #include <common.h>
  7. #include <linux/err.h>
  8. #include <dm.h>
  9. #include <i2c.h>
  10. #include <i2c_eeprom.h>
  11. static int i2c_eeprom_read(struct udevice *dev, int offset, uint8_t *buf,
  12. int size)
  13. {
  14. return -ENODEV;
  15. }
  16. static int i2c_eeprom_write(struct udevice *dev, int offset,
  17. const uint8_t *buf, int size)
  18. {
  19. return -ENODEV;
  20. }
  21. struct i2c_eeprom_ops i2c_eeprom_std_ops = {
  22. .read = i2c_eeprom_read,
  23. .write = i2c_eeprom_write,
  24. };
  25. int i2c_eeprom_std_probe(struct udevice *dev)
  26. {
  27. return 0;
  28. }
  29. static const struct udevice_id i2c_eeprom_std_ids[] = {
  30. { .compatible = "i2c-eeprom" },
  31. { }
  32. };
  33. U_BOOT_DRIVER(i2c_eeprom_std) = {
  34. .name = "i2c_eeprom",
  35. .id = UCLASS_I2C_EEPROM,
  36. .of_match = i2c_eeprom_std_ids,
  37. .probe = i2c_eeprom_std_probe,
  38. .priv_auto_alloc_size = sizeof(struct i2c_eeprom),
  39. .ops = &i2c_eeprom_std_ops,
  40. };
  41. UCLASS_DRIVER(i2c_eeprom) = {
  42. .id = UCLASS_I2C_EEPROM,
  43. .name = "i2c_eeprom",
  44. };