From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Warren Date: Tue, 30 Oct 2012 16:32:01 -0600 Subject: [U-Boot] [PATCH 2/2] WIP: tegra: i2c: Enable new CONFIG_SYS_I2C framework In-Reply-To: <1351618133-14909-2-git-send-email-sjg@chromium.org> References: <1351618133-14909-1-git-send-email-sjg@chromium.org> <1351618133-14909-2-git-send-email-sjg@chromium.org> Message-ID: <50905561.90602@wwwdotorg.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 10/30/2012 11:28 AM, Simon Glass wrote: > (just for illustration, please don't merge) > > This enables CONFIG_SYS_I2C on Tegra, updating existing boards and the Tegra > i2c driver to support this. > diff --git a/drivers/i2c/i2c_core.c b/drivers/i2c/i2c_core.c > +#ifdef CONFIG_TEGRA_I2C > +extern struct i2c_adapter tegra_i2c_adap[]; > +#endif I'm not sure why that's needed if the config files have to put the adpater list into a #define: > diff --git a/include/configs/seaboard.h b/include/configs/seaboard.h > +#define CONFIG_SYS_I2C > +#define CONFIG_SYS_I2C_ADAPTERS {&tegra_i2c_adap[0]} > +#define CONFIG_SYS_NUM_I2C_ADAPTERS TEGRA_I2C_NUM_CONTROLLERS But, why is CONFIG_SYS_I2C_ADAPTERS needed; can't the adapter init functions (which presumably would be called from board code or as a result of DT parsing) dynamically register themselves? Aside from that, this looks OK to me at a quick glance.