global: Migrate CONFIG_SYS_I2C_DIRECT_BUS to CFG
authorTom Rini <trini@konsulko.com>
Sun, 4 Dec 2022 15:13:57 +0000 (10:13 -0500)
committerTom Rini <trini@konsulko.com>
Fri, 23 Dec 2022 15:15:12 +0000 (10:15 -0500)
Perform a simple rename of CONFIG_SYS_I2C_DIRECT_BUS to CFG_SYS_I2C_DIRECT_BUS

Signed-off-by: Tom Rini <trini@konsulko.com>
README
cmd/i2c.c
drivers/i2c/i2c_core.c
include/i2c.h

diff --git a/README b/README
index a9b225e..fe571f7 100644 (file)
--- 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:
 
index f204061..dd803ee 100644 (file)
--- 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)
index 7f65db2..fe0cd75 100644 (file)
@@ -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;
index 3811b26..ef3820e 100644 (file)
@@ -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