Skip to content
Snippets Groups Projects
Commit c70c71d8 authored by Simon Glass's avatar Simon Glass
Browse files

dm: i2c: Add I2C emulation driver for sandbox


In order to test I2C we need some sort of emulation interface. Add hooks
to allow a driver to emulate an I2C device for sandbox.

Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
Acked-by: default avatarHeiko Schocher <hs@denx.de>
Reviewed-by: default avatarMasahiro Yamada <yamada.m@jp.panasonic.com>
parent 63656b76
No related branches found
No related tags found
No related merge requests found
...@@ -27,6 +27,7 @@ obj-$(CONFIG_SYS_I2C_OMAP34XX) += omap24xx_i2c.o ...@@ -27,6 +27,7 @@ obj-$(CONFIG_SYS_I2C_OMAP34XX) += omap24xx_i2c.o
obj-$(CONFIG_SYS_I2C_PPC4XX) += ppc4xx_i2c.o obj-$(CONFIG_SYS_I2C_PPC4XX) += ppc4xx_i2c.o
obj-$(CONFIG_SYS_I2C_RCAR) += rcar_i2c.o obj-$(CONFIG_SYS_I2C_RCAR) += rcar_i2c.o
obj-$(CONFIG_SYS_I2C_S3C24X0) += s3c24x0_i2c.o obj-$(CONFIG_SYS_I2C_S3C24X0) += s3c24x0_i2c.o
obj-$(CONFIG_SYS_I2C_SANDBOX) += i2c-emul-uclass.o
obj-$(CONFIG_SYS_I2C_SH) += sh_i2c.o obj-$(CONFIG_SYS_I2C_SH) += sh_i2c.o
obj-$(CONFIG_SYS_I2C_SOFT) += soft_i2c.o obj-$(CONFIG_SYS_I2C_SOFT) += soft_i2c.o
obj-$(CONFIG_SYS_I2C_TEGRA) += tegra_i2c.o obj-$(CONFIG_SYS_I2C_TEGRA) += tegra_i2c.o
......
/*
* Copyright (c) 2014 Google, Inc
*
* SPDX-License-Identifier: GPL-2.0+
*/
#include <common.h>
#include <dm.h>
#include <i2c.h>
UCLASS_DRIVER(i2c_emul) = {
.id = UCLASS_I2C_EMUL,
.name = "i2c_emul",
};
...@@ -19,6 +19,7 @@ enum uclass_id { ...@@ -19,6 +19,7 @@ enum uclass_id {
UCLASS_TEST_FDT, UCLASS_TEST_FDT,
UCLASS_TEST_BUS, UCLASS_TEST_BUS,
UCLASS_SPI_EMUL, /* sandbox SPI device emulator */ UCLASS_SPI_EMUL, /* sandbox SPI device emulator */
UCLASS_I2C_EMUL, /* sandbox I2C device emulator */
UCLASS_SIMPLE_BUS, UCLASS_SIMPLE_BUS,
/* U-Boot uclasses start here */ /* U-Boot uclasses start here */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment