xref: /rk3399_rockchip-uboot/drivers/i2c/intel_i2c.c (revision abb0b01e7a22c4a1f3fdd2301fae7276e857b04b)
1 /*
2  * Copyright (c) 2015 Google, Inc
3  * Written by Simon Glass <sjg@chromium.org>
4  *
5  * SPDX-License-Identifier:     GPL-2.0+
6  */
7 
8 #include <common.h>
9 #include <dm.h>
10 #include <i2c.h>
11 #include <asm/io.h>
12 
13 int intel_i2c_xfer(struct udevice *bus, struct i2c_msg *msg, int nmsgs)
14 {
15 	return -ENOSYS;
16 }
17 
18 int intel_i2c_probe_chip(struct udevice *bus, uint chip_addr, uint chip_flags)
19 {
20 	return -ENOSYS;
21 }
22 
23 int intel_i2c_set_bus_speed(struct udevice *bus, unsigned int speed)
24 {
25 	return 0;
26 }
27 
28 static int intel_i2c_probe(struct udevice *dev)
29 {
30 	return 0;
31 }
32 
33 static const struct dm_i2c_ops intel_i2c_ops = {
34 	.xfer		= intel_i2c_xfer,
35 	.probe_chip	= intel_i2c_probe_chip,
36 	.set_bus_speed	= intel_i2c_set_bus_speed,
37 };
38 
39 static const struct udevice_id intel_i2c_ids[] = {
40 	{ .compatible = "intel,ich-i2c" },
41 	{ }
42 };
43 
44 U_BOOT_DRIVER(intel_i2c) = {
45 	.name	= "i2c_intel",
46 	.id	= UCLASS_I2C,
47 	.of_match = intel_i2c_ids,
48 	.per_child_auto_alloc_size = sizeof(struct dm_i2c_chip),
49 	.ops	= &intel_i2c_ops,
50 	.probe	= intel_i2c_probe,
51 };
52