[PoC 059/241] global: Migrate CONFIG_I2C_MVTWSI to CFG

Tom Rini
2022-11-20T13:44:18Z

arch/arm/include/asm/arch-sunxi/i2c.h | 6 ++--
arch/arm/mach-kirkwood/include/mach/config.h | 2 +-
arch/arm/mach-mvebu/include/mach/config.h | 2 +-
drivers/i2c/mvtwsi.c | 38 ++++++++++----------
include/configs/db-88f6720.h | 2 +-
include/configs/db-88f6820-gp.h | 2 +-
include/configs/db-mv784mp-gp.h | 2 +-
include/configs/ds414.h | 2 +-
include/configs/maxbcm.h | 2 +-
include/configs/theadorable.h | 4 +--
scripts/config_whitelist.txt | 6 ++--
11 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/arch/arm/include/asm/arch-sunxi/i2c.h b/arch/arm/include/asm/arch-sunxi/i2c.h
index 241b44928a95..f0da46d863cf 100644
--- a/arch/arm/include/asm/arch-sunxi/i2c.h
+++ b/arch/arm/include/asm/arch-sunxi/i2c.h
@@ -8,13 +8,13 @@
#include <asm/arch/cpu.h>

#ifdef CONFIG_I2C0_ENABLE
-#define CONFIG_I2C_MVTWSI_BASE0 SUNXI_TWI0_BASE
+#define CFG_I2C_MVTWSI_BASE0 SUNXI_TWI0_BASE
#endif
#ifdef CONFIG_I2C1_ENABLE
-#define CONFIG_I2C_MVTWSI_BASE1 SUNXI_TWI1_BASE
+#define CFG_I2C_MVTWSI_BASE1 SUNXI_TWI1_BASE
#endif
#ifdef CONFIG_R_I2C_ENABLE
-#define CONFIG_I2C_MVTWSI_BASE2 SUNXI_R_TWI_BASE
+#define CFG_I2C_MVTWSI_BASE2 SUNXI_R_TWI_BASE
#endif

/* This is abp0-clk on sun4i/5i/7i / abp1-clk on sun6i/sun8i which is 24MHz */
diff --git a/arch/arm/mach-kirkwood/include/mach/config.h b/arch/arm/mach-kirkwood/include/mach/config.h
index a6de7676294b..fbef9c99b1d3 100644
--- a/arch/arm/mach-kirkwood/include/mach/config.h
+++ b/arch/arm/mach-kirkwood/include/mach/config.h
@@ -24,7 +24,7 @@

#include <asm/arch/soc.h>

-#define CONFIG_I2C_MVTWSI_BASE0 KW_TWSI_BASE
+#define CFG_I2C_MVTWSI_BASE0 KW_TWSI_BASE
#define MV_UART_CONSOLE_BASE KW_UART0_BASE
#define MV_SATA_BASE KW_SATA_BASE
#define MV_SATA_PORT0_OFFSET KW_SATA_PORT0_OFFSET
diff --git a/arch/arm/mach-mvebu/include/mach/config.h b/arch/arm/mach-mvebu/include/mach/config.h
index 2e06f2bdaee3..19f9f083129b 100644
--- a/arch/arm/mach-mvebu/include/mach/config.h
+++ b/arch/arm/mach-mvebu/include/mach/config.h
@@ -35,7 +35,7 @@
*/
#ifdef CONFIG_CMD_I2C
#ifndef CONFIG_SYS_I2C_SOFT
-#define CONFIG_I2C_MVTWSI
+#define CFG_I2C_MVTWSI
#endif
#endif

diff --git a/drivers/i2c/mvtwsi.c b/drivers/i2c/mvtwsi.c
index a9c7d6e1bc26..55f9b983e884 100644
--- a/drivers/i2c/mvtwsi.c
+++ b/drivers/i2c/mvtwsi.c
@@ -25,7 +25,7 @@
DECLARE_GLOBAL_DATA_PTR;

/*
- * Include a file that will provide CONFIG_I2C_MVTWSI_BASE*, and possibly other
+ * Include a file that will provide CFG_I2C_MVTWSI_BASE*, and possibly other
* settings
*/

@@ -197,29 +197,29 @@ inline uint calc_tick(uint speed)
static struct mvtwsi_registers *twsi_get_base(struct i2c_adapter *adap)
{
switch (adap->hwadapnr) {
-#ifdef CONFIG_I2C_MVTWSI_BASE0
+#ifdef CFG_I2C_MVTWSI_BASE0
case 0:
- return (struct mvtwsi_registers *)CONFIG_I2C_MVTWSI_BASE0;
+ return (struct mvtwsi_registers *)CFG_I2C_MVTWSI_BASE0;
#endif
-#ifdef CONFIG_I2C_MVTWSI_BASE1
+#ifdef CFG_I2C_MVTWSI_BASE1
case 1:
- return (struct mvtwsi_registers *)CONFIG_I2C_MVTWSI_BASE1;
+ return (struct mvtwsi_registers *)CFG_I2C_MVTWSI_BASE1;
#endif
-#ifdef CONFIG_I2C_MVTWSI_BASE2
+#ifdef CFG_I2C_MVTWSI_BASE2
case 2:
- return (struct mvtwsi_registers *)CONFIG_I2C_MVTWSI_BASE2;
+ return (struct mvtwsi_registers *)CFG_I2C_MVTWSI_BASE2;
#endif
-#ifdef CONFIG_I2C_MVTWSI_BASE3
+#ifdef CFG_I2C_MVTWSI_BASE3
case 3:
- return (struct mvtwsi_registers *)CONFIG_I2C_MVTWSI_BASE3;
+ return (struct mvtwsi_registers *)CFG_I2C_MVTWSI_BASE3;
#endif
-#ifdef CONFIG_I2C_MVTWSI_BASE4
+#ifdef CFG_I2C_MVTWSI_BASE4
case 4:
- return (struct mvtwsi_registers *)CONFIG_I2C_MVTWSI_BASE4;
+ return (struct mvtwsi_registers *)CFG_I2C_MVTWSI_BASE4;
#endif
-#ifdef CONFIG_I2C_MVTWSI_BASE5
+#ifdef CFG_I2C_MVTWSI_BASE5
case 5:
- return (struct mvtwsi_registers *)CONFIG_I2C_MVTWSI_BASE5;
+ return (struct mvtwsi_registers *)CFG_I2C_MVTWSI_BASE5;
#endif
default:
printf("Missing mvtwsi controller %d base\n", adap->hwadapnr);
@@ -737,41 +737,41 @@ static int twsi_i2c_write(struct i2c_adapter *adap, uchar chip, uint addr,
10000);
}

-#ifdef CONFIG_I2C_MVTWSI_BASE0
+#ifdef CFG_I2C_MVTWSI_BASE0
U_BOOT_I2C_ADAP_COMPLETE(twsi0, twsi_i2c_init, twsi_i2c_probe,
twsi_i2c_read, twsi_i2c_write,
twsi_i2c_set_bus_speed,
CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE, 0)
#endif
-#ifdef CONFIG_I2C_MVTWSI_BASE1
+#ifdef CFG_I2C_MVTWSI_BASE1
U_BOOT_I2C_ADAP_COMPLETE(twsi1, twsi_i2c_init, twsi_i2c_probe,
twsi_i2c_read, twsi_i2c_write,
twsi_i2c_set_bus_speed,
CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE, 1)

#endif
-#ifdef CONFIG_I2C_MVTWSI_BASE2
+#ifdef CFG_I2C_MVTWSI_BASE2
U_BOOT_I2C_ADAP_COMPLETE(twsi2, twsi_i2c_init, twsi_i2c_probe,
twsi_i2c_read, twsi_i2c_write,
twsi_i2c_set_bus_speed,
CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE, 2)

#endif
-#ifdef CONFIG_I2C_MVTWSI_BASE3
+#ifdef CFG_I2C_MVTWSI_BASE3
U_BOOT_I2C_ADAP_COMPLETE(twsi3, twsi_i2c_init, twsi_i2c_probe,
twsi_i2c_read, twsi_i2c_write,
twsi_i2c_set_bus_speed,
CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE, 3)

#endif
-#ifdef CONFIG_I2C_MVTWSI_BASE4
+#ifdef CFG_I2C_MVTWSI_BASE4
U_BOOT_I2C_ADAP_COMPLETE(twsi4, twsi_i2c_init, twsi_i2c_probe,
twsi_i2c_read, twsi_i2c_write,
twsi_i2c_set_bus_speed,
CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE, 4)

#endif
-#ifdef CONFIG_I2C_MVTWSI_BASE5
+#ifdef CFG_I2C_MVTWSI_BASE5
U_BOOT_I2C_ADAP_COMPLETE(twsi5, twsi_i2c_init, twsi_i2c_probe,
twsi_i2c_read, twsi_i2c_write,
twsi_i2c_set_bus_speed,
diff --git a/include/configs/db-88f6720.h b/include/configs/db-88f6720.h
index ef9c457e1020..54de2d0d8334 100644
--- a/include/configs/db-88f6720.h
+++ b/include/configs/db-88f6720.h
@@ -17,7 +17,7 @@
*/

/* I2C */
-#define CONFIG_I2C_MVTWSI_BASE0 MVEBU_TWSI_BASE
+#define CFG_I2C_MVTWSI_BASE0 MVEBU_TWSI_BASE

/* USB/EHCI configuration */

diff --git a/include/configs/db-88f6820-gp.h b/include/configs/db-88f6820-gp.h
index 6dbf582d733b..2cbe4eb440b4 100644
--- a/include/configs/db-88f6820-gp.h
+++ b/include/configs/db-88f6820-gp.h
@@ -11,7 +11,7 @@
*/

/* I2C */
-#define CONFIG_I2C_MVTWSI_BASE0 MVEBU_TWSI_BASE
+#define CFG_I2C_MVTWSI_BASE0 MVEBU_TWSI_BASE

/* Environment in SPI NOR flash */

diff --git a/include/configs/db-mv784mp-gp.h b/include/configs/db-mv784mp-gp.h
index bf8b35102ad7..5c6d7fa1b776 100644
--- a/include/configs/db-mv784mp-gp.h
+++ b/include/configs/db-mv784mp-gp.h
@@ -13,7 +13,7 @@
*/

/* I2C */
-#define CONFIG_I2C_MVTWSI_BASE0 MVEBU_TWSI_BASE
+#define CFG_I2C_MVTWSI_BASE0 MVEBU_TWSI_BASE

/* USB/EHCI configuration */

diff --git a/include/configs/ds414.h b/include/configs/ds414.h
index e69883ba73bc..9446acba7923 100644
--- a/include/configs/ds414.h
+++ b/include/configs/ds414.h
@@ -17,7 +17,7 @@
*/

/* I2C */
-#define CONFIG_I2C_MVTWSI_BASE0 MVEBU_TWSI_BASE
+#define CFG_I2C_MVTWSI_BASE0 MVEBU_TWSI_BASE

/*
* mv-common.h should be defined after CMD configs since it used them
diff --git a/include/configs/maxbcm.h b/include/configs/maxbcm.h
index 5ad945b55896..413597e09b26 100644
--- a/include/configs/maxbcm.h
+++ b/include/configs/maxbcm.h
@@ -19,7 +19,7 @@
*/

/* I2C */
-#define CONFIG_I2C_MVTWSI_BASE0 MVEBU_TWSI_BASE
+#define CFG_I2C_MVTWSI_BASE0 MVEBU_TWSI_BASE

/* SPI NOR flash default params, used by sf commands */

diff --git a/include/configs/theadorable.h b/include/configs/theadorable.h
index 9722b0db72aa..2ce92845f1c0 100644
--- a/include/configs/theadorable.h
+++ b/include/configs/theadorable.h
@@ -25,8 +25,8 @@
*/

/* I2C */
-#define CONFIG_I2C_MVTWSI_BASE0 MVEBU_TWSI_BASE
-#define CONFIG_I2C_MVTWSI_BASE1 MVEBU_TWSI1_BASE
+#define CFG_I2C_MVTWSI_BASE0 MVEBU_TWSI_BASE
+#define CFG_I2C_MVTWSI_BASE1 MVEBU_TWSI1_BASE

/* USB/EHCI configuration */

diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 501e39bb4900..1798a7420cd7 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -59,9 +59,9 @@ CFG_HSMMC2_8BIT
CFG_HW_ENV_SETTINGS
CFG_I2C_ENV_EEPROM_BUS
CFG_I2C_MULTI_BUS
-CONFIG_I2C_MVTWSI
-CONFIG_I2C_MVTWSI_BASE0
-CONFIG_I2C_MVTWSI_BASE1
+CFG_I2C_MVTWSI
+CFG_I2C_MVTWSI_BASE0
+CFG_I2C_MVTWSI_BASE1
CONFIG_I2C_RTC_ADDR
CONFIG_ICS307_REFCLK_HZ
CONFIG_IMX6_PWM_PER_CLK
--
2.25.1