
Hi Tom,
On 8/17/21 4:59 PM, Tom Rini wrote:
This converts the following to Kconfig: CONFIG_SYS_I2C_SOFT CONFIG_SYS_I2C_SOFT_SPEED CONFIG_SYS_I2C_SOFT_SLAVE
Signed-off-by: Tom Rini trini@konsulko.com
board/sunxi/board.c | 2 +- configs/Colombus_defconfig | 3 +++ configs/UTOO_P66_defconfig | 3 +++ configs/ethernut5_defconfig | 2 ++ configs/km_kirkwood_128m16_defconfig | 2 ++ configs/km_kirkwood_defconfig | 2 ++ configs/km_kirkwood_pci_defconfig | 2 ++ configs/kmcoge5un_defconfig | 2 ++ configs/kmnusa_defconfig | 2 ++ configs/kmsuse2_defconfig | 2 ++ configs/snapper9260_defconfig | 2 ++ configs/snapper9g20_defconfig | 2 ++ drivers/i2c/Kconfig | 19 +++++++++++++++++++ include/configs/ethernut5.h | 3 --- include/configs/km/km_arm.h | 4 ---- include/configs/snapper9260.h | 3 --- include/configs/sunxi-common.h | 5 +---- 17 files changed, 45 insertions(+), 15 deletions(-)
diff --git a/board/sunxi/board.c b/board/sunxi/board.c index 1a46100e408d..2b7d655678d0 100644 --- a/board/sunxi/board.c +++ b/board/sunxi/board.c @@ -47,7 +47,7 @@ #include <sy8106a.h> #include <asm/setup.h>
-#if defined CONFIG_VIDEO_LCD_PANEL_I2C && !(defined CONFIG_SPL_BUILD) +#if defined(CONFIG_VIDEO_LCD_PANEL_I2C)
The soft i2c bus is only used by a DM driver (sunxi_de), and DM is not enabled in SPL, so this bus is not needed in SPL.
This worked because the condition for CONFIG_SYS_I2C_SOFT, and thus for compiling the driver, also included !(defined CONFIG_SPL_BUILD).
Your change will increase the size of SPL, but I think it should be fine. The increase will be temporary, as I am working on a patch series to finish the DM_I2C conversion for sunxi.
Cheers, Samuel
diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h index 958b850da4a8..4f7049a4de61 100644 --- a/include/configs/sunxi-common.h +++ b/include/configs/sunxi-common.h @@ -205,10 +205,7 @@ #endif #endif
-#if defined CONFIG_VIDEO_LCD_PANEL_I2C && !(defined CONFIG_SPL_BUILD)
(this condition here)
-#define CONFIG_SYS_I2C_SOFT -#define CONFIG_SYS_I2C_SOFT_SPEED 50000 -#define CONFIG_SYS_I2C_SOFT_SLAVE 0x00 +#if defined(CONFIG_VIDEO_LCD_PANEL_I2C) /* We use pin names in Kconfig and sunxi_name_to_gpio() */ #define CONFIG_SOFT_I2C_GPIO_SDA soft_i2c_gpio_sda #define CONFIG_SOFT_I2C_GPIO_SCL soft_i2c_gpio_scl