blob: 814134a2cb1e076747464098e50fc06a160d10bf [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>
Masahiro Yamadaf9d52cc2014-12-18 20:00:26 +09008#include <linux/err.h>
Simon Glass6ca4ba02014-12-10 08:55:54 -07009#include <dm.h>
10#include <i2c.h>
11#include <i2c_eeprom.h>
12
13static int i2c_eeprom_read(struct udevice *dev, int offset, uint8_t *buf,
14 int size)
15{
16 return -ENODEV;
17}
18
19static int i2c_eeprom_write(struct udevice *dev, int offset,
20 const uint8_t *buf, int size)
21{
22 return -ENODEV;
23}
24
25struct 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)
31{
32 return 0;
33}
34
35static const struct udevice_id i2c_eeprom_std_ids[] = {
36 { .compatible = "i2c-eeprom" },
37 { }
38};
39
40U_BOOT_DRIVER(i2c_eeprom_std) = {
41 .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,
47};
48
49UCLASS_DRIVER(i2c_eeprom) = {
50 .id = UCLASS_I2C_EEPROM,
51 .name = "i2c_eeprom",
52};