]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
i2c: Instantiate I2C controllers when selected
authorMichal Simek <michal.simek@xilinx.com>
Wed, 21 Oct 2015 12:38:05 +0000 (14:38 +0200)
committerMichal Simek <michal.simek@xilinx.com>
Wed, 21 Oct 2015 14:47:45 +0000 (16:47 +0200)
Do not enable both I2C controllers by default. Enable them only when
they are selected.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/i2c/zynq_i2c.c

index b3264af4526eb778262313334eca4d5ce4141ff4..380863bde148d83707f746376ec0757d23e9c4f0 100644 (file)
@@ -297,11 +297,15 @@ static unsigned int zynq_i2c_set_bus_speed(struct i2c_adapter *adap,
        return 0;
 }
 
+#ifdef CONFIG_ZYNQ_I2C0
 U_BOOT_I2C_ADAP_COMPLETE(zynq_0, zynq_i2c_init, zynq_i2c_probe, zynq_i2c_read,
                         zynq_i2c_write, zynq_i2c_set_bus_speed,
                         CONFIG_SYS_I2C_ZYNQ_SPEED, CONFIG_SYS_I2C_ZYNQ_SLAVE,
                         0)
+#endif
+#ifdef CONFIG_ZYNQ_I2C1
 U_BOOT_I2C_ADAP_COMPLETE(zynq_1, zynq_i2c_init, zynq_i2c_probe, zynq_i2c_read,
                         zynq_i2c_write, zynq_i2c_set_bus_speed,
                         CONFIG_SYS_I2C_ZYNQ_SPEED, CONFIG_SYS_I2C_ZYNQ_SLAVE,
                         1)
+#endif