diff mbox

[U-Boot,04/14] sandbox: Move CONFIG_SYS_I2C_SANDBOX to Kconfig

Message ID 1425673154-28383-5-git-send-email-sjg@chromium.org
State Accepted
Delegated to: Simon Glass
Headers show

Commit Message

Simon Glass March 6, 2015, 8:19 p.m. UTC
Move this over to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 configs/sandbox_defconfig |  1 +
 drivers/i2c/Kconfig       | 30 ++++++++++++++++++++++++++++++
 include/configs/sandbox.h |  1 -
 3 files changed, 31 insertions(+), 1 deletion(-)

Comments

Heiko Schocher March 9, 2015, 7:28 a.m. UTC | #1
Hello Simon,

Am 06.03.2015 21:19, schrieb Simon Glass:
> Move this over to Kconfig and tidy up.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
>   configs/sandbox_defconfig |  1 +
>   drivers/i2c/Kconfig       | 30 ++++++++++++++++++++++++++++++
>   include/configs/sandbox.h |  1 -
>   3 files changed, 31 insertions(+), 1 deletion(-)

Thanks!

Acked-by: Heiko Schocher<hs@denx.de>

bye,
Heiko
Simon Glass April 9, 2015, 3:02 a.m. UTC | #2
On 9 March 2015 at 01:28, Heiko Schocher <hs@denx.de> wrote:
> Hello Simon,
>
> Am 06.03.2015 21:19, schrieb Simon Glass:
>>
>> Move this over to Kconfig and tidy up.
>>
>> Signed-off-by: Simon Glass <sjg@chromium.org>
>> ---
>>
>>   configs/sandbox_defconfig |  1 +
>>   drivers/i2c/Kconfig       | 30 ++++++++++++++++++++++++++++++
>>   include/configs/sandbox.h |  1 -
>>   3 files changed, 31 insertions(+), 1 deletion(-)
>
>
> Thanks!
>
> Acked-by: Heiko Schocher<hs@denx.de>

Applied to u-boot-dm/next.
diff mbox

Patch

diff --git a/configs/sandbox_defconfig b/configs/sandbox_defconfig
index 72740ef..8a5ae79 100644
--- a/configs/sandbox_defconfig
+++ b/configs/sandbox_defconfig
@@ -16,3 +16,4 @@  CONFIG_BOOTSTAGE=y
 CONFIG_SANDBOX_GPIO=y
 CONFIG_SYS_VSNPRINTF=y
 CONFIG_SANDBOX_SERIAL=y
+CONFIG_SYS_I2C_SANDBOX=y
diff --git a/drivers/i2c/Kconfig b/drivers/i2c/Kconfig
index 692810d..a974ac5 100644
--- a/drivers/i2c/Kconfig
+++ b/drivers/i2c/Kconfig
@@ -22,6 +22,36 @@  config DM_I2C_COMPAT
 	  to convert all code for a board in a single commit. It should not
 	  be enabled for any board in an official release.
 
+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
diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h
index 3b3e1f4..fd76056 100644
--- a/include/configs/sandbox.h
+++ b/include/configs/sandbox.h
@@ -92,7 +92,6 @@ 
 #define CONFIG_SPI_FLASH_WINBOND
 
 #define CONFIG_CMD_I2C
-#define CONFIG_SYS_I2C_SANDBOX
 #define CONFIG_I2C_EDID
 #define CONFIG_I2C_EEPROM