video: Remove dependecy of I2C_EDID
PATCH 1/1 video: Remove dependecy of I2C_EDID
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.
---
cmd/i2c.c | 10 ++++++---- drivers/video/Kconfig | 1 - 2 files changed, 6 insertions(+), 5 deletions(-)
cmd/i2c.c +6 -4
@@ -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 */ +#endifU_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, "", ""),
drivers/video/Kconfig +0 -1
@@ -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.
Signature · 1 line
2.12.1
PATCH 1/1 video: Remove dependecy of I2C_EDID
Hi,
Quoted 25 lines · Jernej Skrabec
I2C_EDIDcurrently selectsDM_I2C. However, it is not needed.I2C_EDIDis used for buildingedid.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_DISPLAYoption, which is the only one which selectsI2C_EDID.Signed-off-by Jernej Skrabec <[email protected]>---
cmd/i2c.c | 10 ++++++---- drivers/video/Kconfig | 1 - 2 files changed, 6 insertions(+), 5 deletions(-)cmd/i2c.c +0
-0
cmd/i2c.c static int do_sdram (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) · line 1634
Quoted 6 lines
cmd/i2c.c +2
-1@@ -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 ))
The correct solution here I think is to convert sunxi to DM_I2C. We should not be adding new features to the old code.
Quoted 38 lines
cmd/i2c.c +4
-3int 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 */ +#endifU_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, "", ""),drivers/video/Kconfig +0
-2@@ -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. --
Quoted 2 lines
2.12.1
Regards,
Simon
PATCH 1/1 video: Remove dependecy of I2C_EDID
Hi,
Dne nedelja, 09. april 2017 ob 21:28:47 CEST je Simon Glass napisal(a):
Quoted 33 lines
Hi,
Quoted 30 lines · Jernej Skrabec
I2C_EDIDcurrently selectsDM_I2C. However, it is not needed.I2C_EDIDis used for buildingedid.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_DISPLAYoption, which is the only one which selectsI2C_EDID.Signed-off-by Jernej Skrabec <[email protected]>---
cmd/i2c.c | 10 ++++++---- drivers/video/Kconfig | 1 - 2 files changed, 6 insertions(+), 5 deletions(-)cmd/i2c.c +0
-0@@ -1630,7 +1630,8 @@ static int do_sdram (cmd_tbl_t * cmdtp, int flag,int argc, char * const argv[])>
* Syntax:
* i2c edid {i2c_chip}
*/
Quoted 6 lines
cmd/i2c.c static int do_sdram (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) · line 1634
Quoted 3 lines
cmd/i2c.c +2
-1-#if defined(CONFIG_I2C_EDID ) +#if defined(CONFIG_I2C_EDID ) && \ + (defined(CONFIG_SYS_I2C ) || defined(CONFIG_DM_I2C ))The correct solution here I think is to convert sunxi to
DM_I2C. We should not be adding new features to the old code.
With the "old code" you referring to i2c command? Actually, I'm not sure if "i2c edid" command can be useful on most platforms. I know that rk3288 has multiplexed I2C controller pins with HDMI DDC pins, where this make sense. But for example on sunxi, in order to be useful, it would mean that dw_hdmi driver has to register DDC as I2C driver.
I'm also not sure why "i2c edid" code knows how to use old and DM I2C interface when it is surrounded by a symbol, which always selects DM_I2C. Well, in sunxi case, that actually prevents build failure, but still produces unwanted warning.
Otherwise I agree that converting sunxi to DM_I2C should be done and patch for that already exists, but it was not merged yet:
https://patchwork.ozlabs.org/patch/734375/
Regards,
Jernej
Quoted 60 lines
Quoted 53 lines
int
do_edid(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]){uint chip;cmd/i2c.c +0
-0@@ -1665,7 +1666,7 @@ int do_edid(cmd_tbl_t *cmdtp, int flag, int argc,char *const argv[])>
return 0;}
cmd/i2c.c +4
-3-#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 */ +#endifU_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, "", ""),drivers/video/Kconfig +0
-1@@ -355,7 +355,6 @@ config VIDEO_MVEBU config I2C_EDID bool "Enable EDID library" - depends on DM_I2Cdefault n
helpQuoted 4 lines
This enables library for accessing EDID data from an LCD panel.
--
2.12.1Regards,
Simon
PATCH 1/1 video: Remove dependecy of I2C_EDID
Hi,
Quoted 49 lines · Jernej Å krabec
Hi,
Dne nedelja, 09. april 2017 ob 21:28:47 CEST je Simon Glass napisal(a):
Quoted 33 lines
Hi,
Quoted 30 lines · Jernej Skrabec
I2C_EDIDcurrently selectsDM_I2C. However, it is not needed.I2C_EDIDis used for buildingedid.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_DISPLAYoption, which is the only one which selectsI2C_EDID.Signed-off-by Jernej Skrabec <[email protected]>---
cmd/i2c.c | 10 ++++++---- drivers/video/Kconfig | 1 - 2 files changed, 6 insertions(+), 5 deletions(-)cmd/i2c.c +0
-0@@ -1630,7 +1630,8 @@ static int do_sdram (cmd_tbl_t * cmdtp, int flag,int argc, char * const argv[])>
* Syntax:
* i2c edid {i2c_chip}
*/Quoted 6 lines
cmd/i2c.c static int do_sdram (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) · line 1634
Quoted 3 lines
cmd/i2c.c +2
-1-#if defined(CONFIG_I2C_EDID ) +#if defined(CONFIG_I2C_EDID ) && \ + (defined(CONFIG_SYS_I2C ) || defined(CONFIG_DM_I2C ))The correct solution here I think is to convert sunxi to
DM_I2C. We should not be adding new features to the old code.With the "old code" you referring to i2c command? Actually, I'm not sure if "i2c edid" command can be useful on most platforms. I know that rk3288 has multiplexed I2C controller pins with HDMI DDC pins, where this make sense. But for example on sunxi, in order to be useful, it would mean that
dw_hdmidriver has to register DDC as I2C driver.
Quoted 8 lines
I'm also not sure why "i2c edid" code knows how to use old and DM I2C interface when it is surrounded by a symbol, which always selects
DM_I2C. Well, in sunxi case, that actually prevents build failure, but still produces unwanted warning.Otherwise I agree that converting sunxi to
DM_I2Cshould be done and patch for that already exists, but it was not merged yet:
https://patchwork.ozlabs.org/patch/734375/
Sounds good. Let's get that merged and then we don't need to worry about the legacy I2C.
Regards
Simon