[PATCH 126/149] global: Migrate CONFIG_SYS_I2C_DIRECT_BUS to CFG

Tom Rini trini at konsulko.com
Sun Dec 4 16:13:57 CET 2022


Perform a simple rename of CONFIG_SYS_I2C_DIRECT_BUS to CFG_SYS_I2C_DIRECT_BUS

Signed-off-by: Tom Rini <trini at konsulko.com>
---
 README                 |  4 ++--
 cmd/i2c.c              |  4 ++--
 drivers/i2c/i2c_core.c | 10 +++++-----
 include/i2c.h          |  8 ++++----
 4 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/README b/README
index a9b225e45ecb..fe571f7ef0a6 100644
--- a/README
+++ b/README
@@ -843,7 +843,7 @@ The following options need to be configured:
 		CFG_SYS_NUM_I2C_BUSES
 		Hold the number of i2c buses you want to use.
 
-		CONFIG_SYS_I2C_DIRECT_BUS
+		CFG_SYS_I2C_DIRECT_BUS
 		define this, if you don't use i2c muxes on your hardware.
 		if CFG_SYS_I2C_MAX_HOPS is not defined or == 0 you can
 		omit this define.
@@ -855,7 +855,7 @@ The following options need to be configured:
 
 		CFG_SYS_I2C_BUSES
 		hold a list of buses you want to use, only used if
-		CONFIG_SYS_I2C_DIRECT_BUS is not defined, for example
+		CFG_SYS_I2C_DIRECT_BUS is not defined, for example
 		a board with CFG_SYS_I2C_MAX_HOPS = 1 and
 		CFG_SYS_NUM_I2C_BUSES = 9:
 
diff --git a/cmd/i2c.c b/cmd/i2c.c
index f204061cf09f..dd803ee22719 100644
--- a/cmd/i2c.c
+++ b/cmd/i2c.c
@@ -1699,7 +1699,7 @@ static int do_i2c_show_bus(struct cmd_tbl *cmdtp, int flag, int argc,
 
 		for (i = 0; i < CFG_SYS_NUM_I2C_BUSES; i++) {
 			printf("Bus %d:\t%s", i, I2C_ADAP_NR(i)->name);
-#ifndef CONFIG_SYS_I2C_DIRECT_BUS
+#ifndef CFG_SYS_I2C_DIRECT_BUS
 			int j;
 
 			for (j = 0; j < CFG_SYS_I2C_MAX_HOPS; j++) {
@@ -1735,7 +1735,7 @@ static int do_i2c_show_bus(struct cmd_tbl *cmdtp, int flag, int argc,
 			return -1;
 		}
 		printf("Bus %d:\t%s", i, I2C_ADAP_NR(i)->name);
-#ifndef CONFIG_SYS_I2C_DIRECT_BUS
+#ifndef CFG_SYS_I2C_DIRECT_BUS
 			int j;
 			for (j = 0; j < CFG_SYS_I2C_MAX_HOPS; j++) {
 				if (i2c_bus[i].next_hop[j].chip == 0)
diff --git a/drivers/i2c/i2c_core.c b/drivers/i2c/i2c_core.c
index 7f65db23205a..fe0cd75d94a1 100644
--- a/drivers/i2c/i2c_core.c
+++ b/drivers/i2c/i2c_core.c
@@ -33,14 +33,14 @@ struct i2c_adapter *i2c_get_adapter(int index)
 	return i2c_adap_p;
 }
 
-#if !defined(CONFIG_SYS_I2C_DIRECT_BUS)
+#if !defined(CFG_SYS_I2C_DIRECT_BUS)
 struct i2c_bus_hose i2c_bus[CFG_SYS_NUM_I2C_BUSES] =
 			CFG_SYS_I2C_BUSES;
 #endif
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#ifndef CONFIG_SYS_I2C_DIRECT_BUS
+#ifndef CFG_SYS_I2C_DIRECT_BUS
 /*
  * i2c_mux_set()
  * -------------
@@ -237,7 +237,7 @@ int i2c_set_bus_num(unsigned int bus)
 	if ((bus == I2C_BUS) && (I2C_ADAP->init_done > 0))
 		return 0;
 
-#ifndef CONFIG_SYS_I2C_DIRECT_BUS
+#ifndef CFG_SYS_I2C_DIRECT_BUS
 	if (bus >= CFG_SYS_NUM_I2C_BUSES)
 		return -1;
 #endif
@@ -249,7 +249,7 @@ int i2c_set_bus_num(unsigned int bus)
 		return -2;
 	}
 
-#ifndef CONFIG_SYS_I2C_DIRECT_BUS
+#ifndef CFG_SYS_I2C_DIRECT_BUS
 	i2c_mux_disconnect_all();
 #endif
 
@@ -257,7 +257,7 @@ int i2c_set_bus_num(unsigned int bus)
 	if (I2C_ADAP->init_done == 0)
 		i2c_init_bus(bus, I2C_ADAP->speed, I2C_ADAP->slaveaddr);
 
-#ifndef CONFIG_SYS_I2C_DIRECT_BUS
+#ifndef CFG_SYS_I2C_DIRECT_BUS
 	i2c_mux_set_all();
 #endif
 	return 0;
diff --git a/include/i2c.h b/include/i2c.h
index 3811b26c08e0..ef3820eaba7c 100644
--- a/include/i2c.h
+++ b/include/i2c.h
@@ -635,12 +635,12 @@ void i2c_early_init_f(void);
 
 #if !defined(CFG_SYS_I2C_MAX_HOPS)
 /* no muxes used bus = i2c adapters */
-#define CONFIG_SYS_I2C_DIRECT_BUS	1
+#define CFG_SYS_I2C_DIRECT_BUS	1
 #define CFG_SYS_I2C_MAX_HOPS		0
 #define CFG_SYS_NUM_I2C_BUSES	ll_entry_count(struct i2c_adapter, i2c)
 #else
 /* we use i2c muxes */
-#undef CONFIG_SYS_I2C_DIRECT_BUS
+#undef CFG_SYS_I2C_DIRECT_BUS
 #endif
 
 /* define the I2C bus number for RTC and DTT if not already done */
@@ -691,7 +691,7 @@ struct i2c_adapter {
 
 struct i2c_adapter *i2c_get_adapter(int index);
 
-#ifndef CONFIG_SYS_I2C_DIRECT_BUS
+#ifndef CFG_SYS_I2C_DIRECT_BUS
 struct i2c_mux {
 	int	id;
 	char	name[16];
@@ -720,7 +720,7 @@ extern struct i2c_bus_hose	i2c_bus[];
 #define	I2C_ADAP		I2C_ADAP_NR(gd->cur_i2c_bus)
 #define I2C_ADAP_HWNR		(I2C_ADAP->hwadapnr)
 
-#ifndef CONFIG_SYS_I2C_DIRECT_BUS
+#ifndef CFG_SYS_I2C_DIRECT_BUS
 #define I2C_MUX_PCA9540_ID	1
 #define I2C_MUX_PCA9540		{I2C_MUX_PCA9540_ID, "PCA9540B"}
 #define I2C_MUX_PCA9542_ID	2
-- 
2.25.1



More information about the U-Boot mailing list