[U-Boot] [PATCH] video: Remove dependecy of I2C_EDID
Jernej Skrabec
jernej.skrabec at siol.net
Tue Mar 28 22:39:20 UTC 2017
I2C_EDID currently selects DM_I2C. However, it is not needed. I2C_EDID
is used for building edid.c, which doesn't even use I2C bus, and by I2C
command, which knows how to use DM and old style I2C interface, so it is
not directly affected by this removal.
Furthermore, this selection can generate warning if DM display driver
is used on platform which doesn't implement DM I2C driver (for example,
sunxi platform with upcoming DM video & display driver).
Patch was tested with rockchip and sunxi boards and successfully
compiled exynos and tegra targets. They are the only consumers of
CONFIG_DISPLAY option, which is the only one which selects I2C_EDID.
Signed-off-by: Jernej Skrabec <jernej.skrabec at siol.net>
---
cmd/i2c.c | 10 ++++++----
drivers/video/Kconfig | 1 -
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/cmd/i2c.c b/cmd/i2c.c
index 473153fbd4..7b6306e525 100644
--- a/cmd/i2c.c
+++ b/cmd/i2c.c
@@ -1630,7 +1630,8 @@ static int do_sdram (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
* Syntax:
* i2c edid {i2c_chip}
*/
-#if defined(CONFIG_I2C_EDID)
+#if defined(CONFIG_I2C_EDID) && \
+ (defined(CONFIG_SYS_I2C) || defined(CONFIG_DM_I2C))
int do_edid(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
{
uint chip;
@@ -1665,7 +1666,7 @@ int do_edid(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
return 0;
}
-#endif /* CONFIG_I2C_EDID */
+#endif
#ifdef CONFIG_DM_I2C
static void show_bus(struct udevice *bus)
@@ -1936,9 +1937,10 @@ static cmd_tbl_t cmd_i2c_sub[] = {
defined(CONFIG_I2C_MULTI_BUS) || defined(CONFIG_DM_I2C)
U_BOOT_CMD_MKENT(dev, 1, 1, do_i2c_bus_num, "", ""),
#endif /* CONFIG_I2C_MULTI_BUS */
-#if defined(CONFIG_I2C_EDID)
+#if defined(CONFIG_I2C_EDID) && \
+ (defined(CONFIG_SYS_I2C) || defined(CONFIG_DM_I2C))
U_BOOT_CMD_MKENT(edid, 1, 1, do_edid, "", ""),
-#endif /* CONFIG_I2C_EDID */
+#endif
U_BOOT_CMD_MKENT(loop, 3, 1, do_i2c_loop, "", ""),
U_BOOT_CMD_MKENT(md, 3, 1, do_i2c_md, "", ""),
U_BOOT_CMD_MKENT(mm, 2, 1, do_i2c_mm, "", ""),
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 2069576958..2f340235ee 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -355,7 +355,6 @@ config VIDEO_MVEBU
config I2C_EDID
bool "Enable EDID library"
- depends on DM_I2C
default n
help
This enables library for accessing EDID data from an LCD panel.
--
2.12.1
More information about the U-Boot
mailing list