From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Warren Date: Mon, 22 Oct 2007 11:30:43 -0400 Subject: [U-Boot-Users] I2C scanning In-Reply-To: References: <471CBA57.7060005@qstreams.com> Message-ID: <471CC223.8020805@qstreams.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Yasothabalan Ramaswamy-TLS,Chennai wrote: > I am able to switch between both the buses, by CONFIG_I2C_MODULE to 1 or > 2. > > #if (CFG_I2C_MODULE == 2) > #define I2C_BASE MPC5XXX_I2C2 > #elif (CFG_I2C_MODULE == 1) > #define I2C_BASE MPC5XXX_I2C1 > #else > #error CFG_I2C_MODULE is not properly configured > #endif > > But my problem is I have to scan both the buses dynamically in the run > time. > > I understand. Please re-read my earlier response, and do some research into your I2C controller. The other I2C controller (fsl_i2c.c), supports run-time switching between buses, and may or not be applicable to your CPU. If it's not, here's an opportunity for you to update the 5xxx driver. regards, Ben