]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
sandbox: Move CONFIG_SYS_I2C_SANDBOX to Kconfig
authorSimon Glass <sjg@chromium.org>
Fri, 6 Mar 2015 20:19:04 +0000 (13:19 -0700)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 8 Sep 2015 20:28:59 +0000 (22:28 +0200)
Move this over to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Heiko Schocher<hs@denx.de>
configs/sandbox_defconfig
drivers/i2c/Kconfig
include/configs/sandbox.h

index 9fa60bdbece740058eec249e70a0d2b097557ced..a85084bfaa295edd14b5937dc8458d11b9ecfd7c 100644 (file)
@@ -21,3 +21,4 @@ CONFIG_BOOTSTAGE=y
 CONFIG_BOOTSTAGE_REPORT=y
 CONFIG_SANDBOX_GPIO=y
 CONFIG_SYS_VSNPRINTF=y
+CONFIG_SYS_I2C_SANDBOX=y
index 23a347a68c8a575a9bf226802b43408dbdefafde..378473c40ec79cd9874a20b7f27b205c286c907f 100644 (file)
@@ -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
index f714298d54698d26c1e81ba2ed01fc772cc4e747..30d41e5edb4fed7d42c034a2a201336f0b1e2f5b 100644 (file)
@@ -95,7 +95,6 @@
 #define CONFIG_SPI_FLASH_WINBOND
 
 #define CONFIG_CMD_I2C
-#define CONFIG_SYS_I2C_SANDBOX
 #define CONFIG_I2C_EDID
 #define CONFIG_I2C_EEPROM