public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] i2c: Instantiate I2C controllers when selected
@ 2015-10-27 15:02 Michal Simek
  2015-10-28  5:56 ` Heiko Schocher
  0 siblings, 1 reply; 4+ messages in thread
From: Michal Simek @ 2015-10-27 15:02 UTC (permalink / raw)
  To: u-boot

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 | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/i2c/zynq_i2c.c b/drivers/i2c/zynq_i2c.c
index b3264af4526e..380863bde148 100644
--- a/drivers/i2c/zynq_i2c.c
+++ b/drivers/i2c/zynq_i2c.c
@@ -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
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-10-28  8:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-27 15:02 [U-Boot] [PATCH] i2c: Instantiate I2C controllers when selected Michal Simek
2015-10-28  5:56 ` Heiko Schocher
2015-10-28  7:08   ` Michal Simek
2015-10-28  8:55     ` Heiko Schocher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox