From: Tom Rini Date: Sun, 4 Dec 2022 15:13:57 +0000 (-0500) Subject: global: Migrate CONFIG_SYS_I2C_DIRECT_BUS to CFG X-Git-Tag: v2023.07~207^2~5^2~23 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d8964b3e1d7233a1b45679c57985575ec0056022;p=platform%2Fkernel%2Fu-boot.git global: Migrate CONFIG_SYS_I2C_DIRECT_BUS to CFG Perform a simple rename of CONFIG_SYS_I2C_DIRECT_BUS to CFG_SYS_I2C_DIRECT_BUS Signed-off-by: Tom Rini --- diff --git a/README b/README index a9b225e..fe571f7 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 f204061..dd803ee 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 7f65db2..fe0cd75 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 3811b26..ef3820e 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