mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-11 15:37:23 +00:00
b7c25b11b6
Sandbox i2c works using emulation drivers which are currently children of the i2c device: rtc_0: rtc@43 { reg = <0x43>; compatible = "sandbox-rtc"; emul { compatible = "sandbox,i2c-rtc"; }; }; In this case the emulation device is attached to i2c bus on address 0x43 and provides the Real-Time-Clock (RTC) functionality. However this is not ideal, since every device on an I2C bus has a child device. This is only really the case for sandbox, but we want to avoid special-case code for sandbox. A better approach seems to be to add a separate node on the bus, an 'emulation parent'. This can be given a bogus address (such as 0xff) and hides all the emulators away. Then we can use a phandle to point from the device to the correct emualtor, and only on sandbox. The code to find an emulator does not interfere with normal i2c operation. Add a new UCLASS_I2C_EMUL_PARENT uclass which allows finding an emulator given a bus, and finding a bus given an emulator. This will be used in a follow-on patch. Signed-off-by: Simon Glass <sjg@chromium.org> |
||
---|---|---|
.. | ||
platform_data | ||
device-internal.h | ||
device.h | ||
fdtaddr.h | ||
lists.h | ||
of.h | ||
of_access.h | ||
of_addr.h | ||
of_extra.h | ||
ofnode.h | ||
pinctrl.h | ||
platdata.h | ||
read.h | ||
root.h | ||
test.h | ||
uclass-id.h | ||
uclass-internal.h | ||
uclass.h | ||
util.h |