blob: 814134a2cb1e076747464098e50fc06a160d10bf [file] [log] [blame]
Googlere00b8eb2019-07-08 16:37:07 -07001/*
2 * Copyright (c) 2014 Google, Inc
Googlera8fd56b2024-10-24 14:04:51 +08003 *
4 * SPDX-License-Identifier: GPL-2.0+
Googlere00b8eb2019-07-08 16:37:07 -07005 */
6
7#include <common.h>
8#include <linux/err.h>
9#include <dm.h>
10#include <i2c.h>
11#include <i2c_eeprom.h>
12
Googlera8fd56b2024-10-24 14:04:51 +080013static int i2c_eeprom_read(struct udevice *dev, int offset, uint8_t *buf,
14 int size)
Googlere00b8eb2019-07-08 16:37:07 -070015{
16 return -ENODEV;
17}
18
Googlera8fd56b2024-10-24 14:04:51 +080019static int i2c_eeprom_write(struct udevice *dev, int offset,
20 const uint8_t *buf, int size)
Googler3cec7d72023-12-13 10:05:01 +000021{
Googlera8fd56b2024-10-24 14:04:51 +080022 return -ENODEV;
Googler3cec7d72023-12-13 10:05:01 +000023}
24
Googlera8fd56b2024-10-24 14:04:51 +080025struct i2c_eeprom_ops i2c_eeprom_std_ops = {
26 .read = i2c_eeprom_read,
27 .write = i2c_eeprom_write,
28};
29
30int i2c_eeprom_std_probe(struct udevice *dev)
Googlere00b8eb2019-07-08 16:37:07 -070031{
32 return 0;
33}
34
35static const struct udevice_id i2c_eeprom_std_ids[] = {
Googlera8fd56b2024-10-24 14:04:51 +080036 { .compatible = "i2c-eeprom" },
Googlere00b8eb2019-07-08 16:37:07 -070037 { }
38};
39
40U_BOOT_DRIVER(i2c_eeprom_std) = {
Googlera8fd56b2024-10-24 14:04:51 +080041 .name = "i2c_eeprom",
42 .id = UCLASS_I2C_EEPROM,
43 .of_match = i2c_eeprom_std_ids,
44 .probe = i2c_eeprom_std_probe,
45 .priv_auto_alloc_size = sizeof(struct i2c_eeprom),
46 .ops = &i2c_eeprom_std_ops,
Googlere00b8eb2019-07-08 16:37:07 -070047};
48
49UCLASS_DRIVER(i2c_eeprom) = {
50 .id = UCLASS_I2C_EEPROM,
51 .name = "i2c_eeprom",
52};