]> git.ipfire.org Git - people/ms/u-boot.git/blob - drivers/misc/i2c_eeprom.c
x86: Add a simple superio driver for SMSC LPC47M
[people/ms/u-boot.git] / drivers / misc / i2c_eeprom.c
1 /*
2 * Copyright (c) 2014 Google, Inc
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
7 #include <common.h>
8 #include <dm.h>
9 #include <i2c.h>
10 #include <i2c_eeprom.h>
11
12 static int i2c_eeprom_read(struct udevice *dev, int offset, uint8_t *buf,
13 int size)
14 {
15 return -ENODEV;
16 }
17
18 static int i2c_eeprom_write(struct udevice *dev, int offset,
19 const uint8_t *buf, int size)
20 {
21 return -ENODEV;
22 }
23
24 struct i2c_eeprom_ops i2c_eeprom_std_ops = {
25 .read = i2c_eeprom_read,
26 .write = i2c_eeprom_write,
27 };
28
29 int i2c_eeprom_std_probe(struct udevice *dev)
30 {
31 return 0;
32 }
33
34 static const struct udevice_id i2c_eeprom_std_ids[] = {
35 { .compatible = "i2c-eeprom" },
36 { }
37 };
38
39 U_BOOT_DRIVER(i2c_eeprom_std) = {
40 .name = "i2c_eeprom",
41 .id = UCLASS_I2C_EEPROM,
42 .of_match = i2c_eeprom_std_ids,
43 .probe = i2c_eeprom_std_probe,
44 .priv_auto_alloc_size = sizeof(struct i2c_eeprom),
45 .ops = &i2c_eeprom_std_ops,
46 };
47
48 UCLASS_DRIVER(i2c_eeprom) = {
49 .id = UCLASS_I2C_EEPROM,
50 .name = "i2c_eeprom",
51 };