X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=include%2Fi2c.h;h=ccffc195527547c7d46ae8809b373212eb75f181;hb=29d280c88a1ff331dce2d4c7a5aaf2402aa0fd8a;hp=695cb7655f535c7a60cd4102361ae215a43339d6;hpb=235c5b8315c6a9eb566fd3d99a098cc6db869fc5;p=platform%2Fkernel%2Fu-boot.git diff --git a/include/i2c.h b/include/i2c.h index 695cb76..ccffc19 100644 --- a/include/i2c.h +++ b/include/i2c.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ /* * Copyright (C) 2009 Sergey Kubushyn * Copyright (C) 2009 - 2013 Heiko Schocher @@ -6,8 +7,6 @@ * (C) Copyright 2001 * Gerald Van Baren, Custom IDEAS, vanbaren@cideas.com. * - * SPDX-License-Identifier: GPL-2.0+ - * * The original I2C interface was * (C) 2000 by Paolo Scaffardi (arsenio@tin.it) * AIRVENT SAM s.p.a - RIMINI(ITALY) @@ -537,6 +536,27 @@ int i2c_chip_ofdata_to_platdata(struct udevice *dev, struct dm_i2c_chip *chip); */ void i2c_dump_msgs(struct i2c_msg *msg, int nmsgs); +/** + * i2c_emul_find() - Find an emulator for an i2c sandbox device + * + * This looks at the device's 'emul' phandle + * + * @dev: Device to find an emulator for + * @emulp: Returns the associated emulator, if found * + * @return 0 if OK, -ENOENT or -ENODEV if not found + */ +int i2c_emul_find(struct udevice *dev, struct udevice **emulp); + +/** + * i2c_emul_get_device() - Find the device being emulated + * + * Given an emulator this returns the associated device + * + * @emul: Emulator for the device + * @return device that @emul is emulating + */ +struct udevice *i2c_emul_get_device(struct udevice *emul); + #ifndef CONFIG_DM_I2C /*