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.
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:
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++) {
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)
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()
* -------------
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
return -2;
}
-#ifndef CONFIG_SYS_I2C_DIRECT_BUS
+#ifndef CFG_SYS_I2C_DIRECT_BUS
i2c_mux_disconnect_all();
#endif
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;
#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 */
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];
#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