[PATCH 07/13] i2c: S3C24X0: Finish Kconfig migration

Jaehoon Chung jh80.chung at samsung.com
Sat Aug 28 07:14:49 CEST 2021


On 8/18/21 6:59 AM, Tom Rini wrote:
> Finish moving this driver to Kconfig.
> - Update the dependency logic for Exynos5 too
> - Remove the unused CONFIG_SYS_I2C_S3C24X0_SPEED variable
> - Drop CONFIG_SYS_I2C_S3C24X0_SLAVE as it's always set to 0.
> - Move the internal SYS_I2C_S3C24X0_SLAVE define closer to the only user.
> 
> Cc: Jaehoon Chung <jh80.chung at samsung.com>
> Signed-off-by: Tom Rini <trini at konsulko.com>

Reviewed-by: Jaehoon Chung <jh80.chung at samsung.com>

Best Regards,
Jaehoon Chung

> ---
>  configs/arndale_defconfig        | 1 +
>  configs/odroid-xu3_defconfig     | 1 +
>  configs/peach-pi_defconfig       | 1 +
>  configs/peach-pit_defconfig      | 1 +
>  configs/smdk5250_defconfig       | 1 +
>  configs/smdk5420_defconfig       | 1 +
>  configs/snow_defconfig           | 1 +
>  configs/spring_defconfig         | 1 +
>  drivers/i2c/Kconfig              | 2 +-
>  drivers/i2c/s3c24x0_i2c.c        | 8 ++------
>  include/configs/exynos5-common.h | 5 -----
>  11 files changed, 11 insertions(+), 12 deletions(-)
> 
> diff --git a/configs/arndale_defconfig b/configs/arndale_defconfig
> index 133c0eb8884e..f475bdefe5f7 100644
> --- a/configs/arndale_defconfig
> +++ b/configs/arndale_defconfig
> @@ -31,6 +31,7 @@ CONFIG_CMD_EXT4_WRITE=y
>  CONFIG_ENV_OVERWRITE=y
>  CONFIG_ENV_IS_IN_MMC=y
>  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
> +CONFIG_SYS_I2C_S3C24X0=y
>  CONFIG_SUPPORT_EMMC_BOOT=y
>  CONFIG_MMC_DW=y
>  CONFIG_MMC_SDHCI=y
> diff --git a/configs/odroid-xu3_defconfig b/configs/odroid-xu3_defconfig
> index f56dfb7d8e2f..150eacdbebe8 100644
> --- a/configs/odroid-xu3_defconfig
> +++ b/configs/odroid-xu3_defconfig
> @@ -42,6 +42,7 @@ CONFIG_ADC_EXYNOS=y
>  CONFIG_DFU_MMC=y
>  CONFIG_SET_DFU_ALT_INFO=y
>  CONFIG_SYS_DFU_DATA_BUF_SIZE=0x2000000
> +CONFIG_SYS_I2C_S3C24X0=y
>  CONFIG_SUPPORT_EMMC_BOOT=y
>  CONFIG_MMC_DW=y
>  CONFIG_MTD=y
> diff --git a/configs/peach-pi_defconfig b/configs/peach-pi_defconfig
> index 92d6be43f817..e8509d8dcbc2 100644
> --- a/configs/peach-pi_defconfig
> +++ b/configs/peach-pi_defconfig
> @@ -38,6 +38,7 @@ CONFIG_USE_ENV_SPI_BUS=y
>  CONFIG_ENV_SPI_BUS=1
>  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
>  CONFIG_I2C_CROS_EC_TUNNEL=y
> +CONFIG_SYS_I2C_S3C24X0=y
>  CONFIG_I2C_MUX=y
>  CONFIG_I2C_ARB_GPIO_CHALLENGE=y
>  CONFIG_CROS_EC_KEYB=y
> diff --git a/configs/peach-pit_defconfig b/configs/peach-pit_defconfig
> index 824a664904e8..aaec917c177f 100644
> --- a/configs/peach-pit_defconfig
> +++ b/configs/peach-pit_defconfig
> @@ -37,6 +37,7 @@ CONFIG_USE_ENV_SPI_BUS=y
>  CONFIG_ENV_SPI_BUS=1
>  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
>  CONFIG_I2C_CROS_EC_TUNNEL=y
> +CONFIG_SYS_I2C_S3C24X0=y
>  CONFIG_I2C_MUX=y
>  CONFIG_I2C_ARB_GPIO_CHALLENGE=y
>  CONFIG_CROS_EC_KEYB=y
> diff --git a/configs/smdk5250_defconfig b/configs/smdk5250_defconfig
> index 3ed1947fd682..d0a25139ac0f 100644
> --- a/configs/smdk5250_defconfig
> +++ b/configs/smdk5250_defconfig
> @@ -38,6 +38,7 @@ CONFIG_ENV_IS_IN_SPI_FLASH=y
>  CONFIG_USE_ENV_SPI_BUS=y
>  CONFIG_ENV_SPI_BUS=1
>  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
> +CONFIG_SYS_I2C_S3C24X0=y
>  CONFIG_SUPPORT_EMMC_BOOT=y
>  CONFIG_MMC_DW=y
>  CONFIG_MMC_SDHCI=y
> diff --git a/configs/smdk5420_defconfig b/configs/smdk5420_defconfig
> index 7b739400a5bf..e484b234dd0b 100644
> --- a/configs/smdk5420_defconfig
> +++ b/configs/smdk5420_defconfig
> @@ -33,6 +33,7 @@ CONFIG_ENV_IS_IN_SPI_FLASH=y
>  CONFIG_USE_ENV_SPI_BUS=y
>  CONFIG_ENV_SPI_BUS=1
>  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
> +CONFIG_SYS_I2C_S3C24X0=y
>  CONFIG_SUPPORT_EMMC_BOOT=y
>  CONFIG_MMC_DW=y
>  CONFIG_MMC_SDHCI=y
> diff --git a/configs/snow_defconfig b/configs/snow_defconfig
> index a5fbd1d346da..f91cfeda8b9c 100644
> --- a/configs/snow_defconfig
> +++ b/configs/snow_defconfig
> @@ -43,6 +43,7 @@ CONFIG_USE_ENV_SPI_BUS=y
>  CONFIG_ENV_SPI_BUS=1
>  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
>  CONFIG_I2C_CROS_EC_LDO=y
> +CONFIG_SYS_I2C_S3C24X0=y
>  CONFIG_I2C_MUX=y
>  CONFIG_I2C_ARB_GPIO_CHALLENGE=y
>  CONFIG_CROS_EC_KEYB=y
> diff --git a/configs/spring_defconfig b/configs/spring_defconfig
> index 53c375e5b4f2..dbebf0ba6191 100644
> --- a/configs/spring_defconfig
> +++ b/configs/spring_defconfig
> @@ -43,6 +43,7 @@ CONFIG_USE_ENV_SPI_BUS=y
>  CONFIG_ENV_SPI_BUS=1
>  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
>  CONFIG_I2C_CROS_EC_LDO=y
> +CONFIG_SYS_I2C_S3C24X0=y
>  CONFIG_I2C_MUX=y
>  CONFIG_I2C_ARB_GPIO_CHALLENGE=y
>  CONFIG_CROS_EC_KEYB=y
> diff --git a/drivers/i2c/Kconfig b/drivers/i2c/Kconfig
> index 63d03a3cebfc..a50c1f38336d 100644
> --- a/drivers/i2c/Kconfig
> +++ b/drivers/i2c/Kconfig
> @@ -449,7 +449,7 @@ config SYS_I2C_OCTEON
>  
>  config SYS_I2C_S3C24X0
>  	bool "Samsung I2C driver"
> -	depends on ARCH_EXYNOS4 && DM_I2C
> +	depends on (ARCH_EXYNOS4 || ARCH_EXYNOS5) && DM_I2C
>  	help
>  	  Support for Samsung I2C controller as Samsung SoCs.
>  
> diff --git a/drivers/i2c/s3c24x0_i2c.c b/drivers/i2c/s3c24x0_i2c.c
> index 56f0f69885e4..e0f499d759f8 100644
> --- a/drivers/i2c/s3c24x0_i2c.c
> +++ b/drivers/i2c/s3c24x0_i2c.c
> @@ -21,12 +21,6 @@
>  #include <i2c.h>
>  #include "s3c24x0_i2c.h"
>  
> -#ifndef CONFIG_SYS_I2C_S3C24X0_SLAVE
> -#define SYS_I2C_S3C24X0_SLAVE_ADDR	0
> -#else
> -#define SYS_I2C_S3C24X0_SLAVE_ADDR	CONFIG_SYS_I2C_S3C24X0_SLAVE
> -#endif
> -
>  DECLARE_GLOBAL_DATA_PTR;
>  
>  /*
> @@ -83,6 +77,8 @@ static void i2c_ch_init(struct s3c24x0_i2c *i2c, int speed, int slaveadd)
>  	writel(I2C_MODE_MT | I2C_TXRX_ENA, &i2c->iicstat);
>  }
>  
> +#define SYS_I2C_S3C24X0_SLAVE_ADDR	0
> +
>  static int s3c24x0_i2c_set_bus_speed(struct udevice *dev, unsigned int speed)
>  {
>  	struct s3c24x0_i2c_bus *i2c_bus = dev_get_priv(dev);
> diff --git a/include/configs/exynos5-common.h b/include/configs/exynos5-common.h
> index 9297fbdc0817..784ddd191b64 100644
> --- a/include/configs/exynos5-common.h
> +++ b/include/configs/exynos5-common.h
> @@ -96,11 +96,6 @@
>  #define EXYNOS_COPY_SPI_FNPTR_ADDR	0x02020058
>  #define SPI_FLASH_UBOOT_POS	(CONFIG_SEC_FW_SIZE + CONFIG_BL1_SIZE)
>  
> -/* I2C */
> -#define CONFIG_SYS_I2C_S3C24X0
> -#define CONFIG_SYS_I2C_S3C24X0_SPEED	100000		/* 100 Kbps */
> -#define CONFIG_SYS_I2C_S3C24X0_SLAVE    0x0
> -
>  /* SPI */
>  
>  /* Ethernet Controllor Driver */
> 



More information about the U-Boot mailing list