@@ -61,6 +61,7 @@ config I2C_CHARDEV
config I2C_MUX
tristate "I2C bus multiplexing support"
+ select I2C_SMBUS
help
Say Y here if you want the I2C core to support the ability to
handle multiplexed I2C bus topologies, by presenting each
@@ -22,6 +22,7 @@
#include <linux/acpi.h>
#include <linux/i2c.h>
#include <linux/i2c-mux.h>
+#include <linux/i2c-smbus.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of.h>
@@ -429,6 +430,9 @@ int i2c_mux_add_adapter(struct i2c_mux_core *muxc,
dev_info(&parent->dev, "Added multiplexed i2c bus %d\n",
i2c_adapter_id(&priv->adap));
+ if (muxc->register_spd)
+ i2c_register_spd(&priv->adap);
+
muxc->adapter[muxc->num_adapters++] = &priv->adap;
return 0;
@@ -21,6 +21,7 @@ struct i2c_mux_core {
unsigned int mux_locked:1;
unsigned int arbitrator:1;
unsigned int gate:1;
+ unsigned int register_spd:1;
void *priv;
This extension allows mux drivers to instruct i2c_mux_add_adapter to call i2c_register_spd. First user of this feature will be gpio mux. Note: In order to avoid a link error we have to ensure that I2C_SMBUS=y if I2C_MUX=y. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> --- v2: - Select I2C_SMBUS to avoid a link error if I2C_MUX=y and I2C_SMBUS=m --- drivers/i2c/Kconfig | 1 + drivers/i2c/i2c-mux.c | 4 ++++ include/linux/i2c-mux.h | 1 + 3 files changed, 6 insertions(+)