From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko Schocher Date: Fri, 20 Mar 2015 06:31:27 +0100 Subject: [U-Boot] [PATCH 8/8] driver/i2c/mxc: Add I2C3 and I2C4 for LS2085A In-Reply-To: <1426782050-24954-8-git-send-email-yorksun@freescale.com> References: <1426782050-24954-1-git-send-email-yorksun@freescale.com> <1426782050-24954-8-git-send-email-yorksun@freescale.com> Message-ID: <550BB0AF.3000800@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Yrok, Am 19.03.2015 17:20, schrieb York Sun: > LS2085A uses mxc I2C driver and has four I2C buses. > > Signed-off-by: York Sun > CC: Heiko Schocher > --- > drivers/i2c/mxc_i2c.c | 16 +++++++++++++++- > 1 file changed, 15 insertions(+), 1 deletion(-) > > diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c > index fc5ee35..02a173e 100644 > --- a/drivers/i2c/mxc_i2c.c > +++ b/drivers/i2c/mxc_i2c.c > @@ -114,6 +114,9 @@ static u16 i2c_clk_div[50][2] = { > #ifndef CONFIG_SYS_MXC_I2C3_SPEED > #define CONFIG_SYS_MXC_I2C3_SPEED 100000 > #endif > +#ifndef CONFIG_SYS_MXC_I2C4_SPEED > +#define CONFIG_SYS_MXC_I2C4_SPEED 100000 > +#endif > > #ifndef CONFIG_SYS_MXC_I2C1_SLAVE > #define CONFIG_SYS_MXC_I2C1_SLAVE 0 > @@ -124,6 +127,9 @@ static u16 i2c_clk_div[50][2] = { > #ifndef CONFIG_SYS_MXC_I2C3_SLAVE > #define CONFIG_SYS_MXC_I2C3_SLAVE 0 > #endif > +#ifndef CONFIG_SYS_MXC_I2C4_SLAVE > +#define CONFIG_SYS_MXC_I2C4_SLAVE 0 > +#endif > > > /* > @@ -545,10 +551,18 @@ U_BOOT_I2C_ADAP_COMPLETE(mxc1, mxc_i2c_init, mxc_i2c_probe, > CONFIG_SYS_MXC_I2C2_SLAVE, 1) > #if defined(CONFIG_MX31) || defined(CONFIG_MX35) ||\ > defined(CONFIG_MX51) || defined(CONFIG_MX53) ||\ > - defined(CONFIG_MX6) || defined(CONFIG_LS102XA) > + defined(CONFIG_MX6) || defined(CONFIG_LS102XA) ||\ > + defined(CONFIG_LS2085A) > U_BOOT_I2C_ADAP_COMPLETE(mxc2, mxc_i2c_init, mxc_i2c_probe, > mxc_i2c_read, mxc_i2c_write, > mxc_i2c_set_bus_speed, > CONFIG_SYS_MXC_I2C3_SPEED, > CONFIG_SYS_MXC_I2C3_SLAVE, 2) > #endif > +#ifdef CONFIG_LS2085A > +U_BOOT_I2C_ADAP_COMPLETE(mxc3, mxc_i2c_init, mxc_i2c_probe, > + mxc_i2c_read, mxc_i2c_write, > + mxc_i2c_set_bus_speed, > + CONFIG_SYS_MXC_I2C4_SPEED, > + CONFIG_SYS_MXC_I2C4_SLAVE, 3) > +#endif Dummy question ... CONFIG_LS2085A (and CONFIG_LS102XA) are board spezific defines, right? If so, I do not want them in driver specific code... because every board which uses this driver has to add here more defines. Could you introduce a SoC or at least a driver specific define here? Maybe CONFIG_SYS_I2C_MXC_I2C4 if no SoC specific code is possible ... Thanks! bye, Heiko -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany