From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anatolij Gustschin Date: Thu, 9 May 2019 08:20:17 +0200 Subject: [U-Boot] [PATCH v2 1/2] wandboard: Don't use I2C speed Kconfig settings with DM_I2C In-Reply-To: <20190508232952.6531-1-tpiepho@impinj.com> References: <20190508232952.6531-1-tpiepho@impinj.com> Message-ID: <20190509082017.6dc6df23@crub> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wed, 8 May 2019 23:30:01 +0000 Trent Piepho tpiepho at impinj.com wrote: ... > diff --git a/board/wandboard/wandboard.c b/board/wandboard/wandboard.c > index 69fbc8b690..9d7a94ff9d 100644 > --- a/board/wandboard/wandboard.c > +++ b/board/wandboard/wandboard.c > @@ -46,6 +46,15 @@ DECLARE_GLOBAL_DATA_PTR; > #define ETH_PHY_AR8035_POWER IMX_GPIO_NR(7, 13) > #define REV_DETECTION IMX_GPIO_NR(2, 28) > > +/* Speed defined in Kconfig is only applicable when not using DM_I2C. */ > +#ifdef CONFIG_DM_I2C > +#define I2C1_SPEED_NON_DM 0 > +#define I2C2_SPEED_NON_DM 0 > +#else > +#define I2C1_SPEED_NON_DM CONFIG_SYS_MXC_I2C1_SPEED > +#define I2C2_SPEED_NON_DM CONFIG_SYS_MXC_I2C2_SPEED Shouldn't we change this to #ifdef CONFIG_DM_I2C #define I2C2_SPEED_NON_DM 0 #define I2C3_SPEED_NON_DM 0 #else #define I2C2_SPEED_NON_DM CONFIG_SYS_MXC_I2C2_SPEED #define I2C3_SPEED_NON_DM CONFIG_SYS_MXC_I2C3_SPEED #endif ... setup_i2c(1, I2C2_SPEED_NON_DM, 0x7f, &mx6q_i2c2_pad_info); setup_i2c(2, I2C3_SPEED_NON_DM, 0x7f, &mx6q_i2c3_pad_info); ? Because the first argument to setup_i2c() is the bus number which starts counting from 0, but the CONFIG_SYS_MXC_I2C* start counting from 1. This doesn't affect the actual configuration since the speed value is currently the same for all buses. But it is more accurate. -- Anatolij