summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-07-11 06:14:35 +0300
committerTom Rini <trini@konsulko.com>2021-07-28 21:29:37 +0300
commit59e11ebf841454a0991731f1ee6ae4eafd9cb235 (patch)
treed5c05a5f67669912c31a9522d45a833c979315dd /drivers
parent6f7abf64508b329c8b1d642d002ac950aee68f88 (diff)
downloadu-boot-59e11ebf841454a0991731f1ee6ae4eafd9cb235.tar.xz
i2c: Create a new Kconfig for I2C
At present we have CONFIG_SPL_I2C but not CONFIG_I2C. The reason CONFIG_I2C is not strictly necessary is that: a) We have CONFIG_SYS_I2C_LEGACY and CONFIG_DM_I2C for the two possible i2c stacks b) In U-Boot proper, we always build drivers/i2c/ regardless of the options Still, it is better to have CONFIG_I2C - it makes U-Boot proper similar to SPL/TPL, so we can (in a future commit) simplify the Makefile rules. Enable it by default, since as above, we have separate options (SYS_I2C_LEGACY and DM_I2C) to control whether it is 'really' enabled. Once we have migrated I2C to driver model, we can drop SYS_I2C_LEGACY and make DM_I2C become I2C. For now, this lets us simplify the Makefile rules. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heiko Schocher <hs@denx.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/i2c/Kconfig26
1 files changed, 24 insertions, 2 deletions
diff --git a/drivers/i2c/Kconfig b/drivers/i2c/Kconfig
index d6d2b67b8e..63d03a3ceb 100644
--- a/drivers/i2c/Kconfig
+++ b/drivers/i2c/Kconfig
@@ -2,7 +2,29 @@
# I2C subsystem configuration
#
-menu "I2C support"
+menuconfig I2C
+ bool "I2C support"
+ default y
+ help
+ Note:
+ This is a stand-in for an option to enable I2C support. In fact this
+ simply enables building of the I2C directory for U-Boot. The actual
+ I2C feature is enabled by DM_I2C (for driver model) and
+ the #define CONFIG_SYS_I2C_LEGACY (for the legacy I2C stack).
+
+ So at present there is no need to ever disable this option.
+
+ Eventually it will:
+
+ Enable support for the I2C (Inter-Integrated Circuit) bus in U-Boot.
+ I2C works with a clock and data line which can be driven by a
+ one or more masters or slaves. It is a fairly complex bus but is
+ widely used as it only needs two lines for communication. Speeds of
+ 400kbps are typical but up to 3.4Mbps is supported by some
+ hardware. Enable this option to build the drivers in drivers/i2c as
+ part of a U-Boot build.
+
+if I2C
config DM_I2C
bool "Enable Driver Model for I2C drivers"
@@ -528,4 +550,4 @@ config SYS_I2C_IHS
source "drivers/i2c/muxes/Kconfig"
-endmenu
+endif