diff options
author | Simon Glass <sjg@chromium.org> | 2015-03-06 13:19:04 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2015-04-18 11:11:38 -0600 |
commit | 1174aada87897098767bceba478443191451eb94 (patch) | |
tree | 4b335f71cae10eccc38baeed555793c25db72165 /drivers/i2c | |
parent | 8156345dfec385d3fd394acb7ef9f78aca35f003 (diff) | |
download | u-boot-imx-1174aada87897098767bceba478443191451eb94.zip u-boot-imx-1174aada87897098767bceba478443191451eb94.tar.gz u-boot-imx-1174aada87897098767bceba478443191451eb94.tar.bz2 |
sandbox: Move CONFIG_SYS_I2C_SANDBOX to Kconfig
Move this over to Kconfig and tidy up.
Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Heiko Schocher<hs@denx.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/Kconfig | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/drivers/i2c/Kconfig b/drivers/i2c/Kconfig index 739badc..ba43019 100644 --- a/drivers/i2c/Kconfig +++ b/drivers/i2c/Kconfig @@ -28,6 +28,36 @@ config DM_I2C_GPIO bindings are supported. Binding info: doc/device-tree-bindings/i2c/i2c-gpio.txt +config SYS_I2C_SANDBOX + bool "Sandbox I2C driver" + depends on SANDBOX && DM_I2C + help + Enable I2C support for sandbox. This is an emulation of a real I2C + bus. Devices can be attached to the bus using the device tree + which specifies the driver to use. As an example, see this device + tree fragment from sandbox.dts. It shows that the I2C bus has a + single EEPROM at address 0x2c (7-bit address) which is emulated by + the driver for "sandbox,i2c-eeprom", which is in + drivers/misc/i2c_eeprom_emul.c. + + i2c@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + compatible = "sandbox,i2c"; + clock-frequency = <400000>; + eeprom@2c { + reg = <0x2c>; + compatible = "i2c-eeprom"; + emul { + compatible = "sandbox,i2c-eeprom"; + sandbox,filename = "i2c.bin"; + sandbox,size = <128>; + }; + }; + }; + + config SYS_I2C_UNIPHIER bool "UniPhier I2C driver" depends on ARCH_UNIPHIER && DM_I2C |