blob: d0548ecc4e5f3a222242b27a2536eb5b9f2f8838 [file] [log] [blame]
Simon Glass6ca4ba02014-12-10 08:55:54 -07001/*
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
12static int i2c_eeprom_read(struct udevice *dev, int offset, uint8_t *buf,
13 int size)
14{
15 return -ENODEV;
16}
17
18static int i2c_eeprom_write(struct udevice *dev, int offset,
19 const uint8_t *buf, int size)
20{
21 return -ENODEV;
22}
23
24struct i2c_eeprom_ops i2c_eeprom_std_ops = {
25 .read = i2c_eeprom_read,
26 .write = i2c_eeprom_write,
27};
28
29int i2c_eeprom_std_probe(struct udevice *dev)
30{
31 return 0;
32}
33
34static const struct udevice_id i2c_eeprom_std_ids[] = {
35 { .compatible = "i2c-eeprom" },
36 { }
37};
38
39U_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
48UCLASS_DRIVER(i2c_eeprom) = {
49 .id = UCLASS_I2C_EEPROM,
50 .name = "i2c_eeprom",
51};