From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko Schocher Date: Thu, 28 Apr 2016 08:06:49 +0200 Subject: [U-Boot] [PATCH] i2c: designware_i2c: Optionally check enable status register In-Reply-To: <1461740532-27074-1-git-send-email-sr@denx.de> References: <1461740532-27074-1-git-send-email-sr@denx.de> Message-ID: <5721A879.2070704@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 Stefan, Am 27.04.2016 um 09:02 schrieb Stefan Roese: > Some platforms don't implement the enable status register at offset 0x9c. > The SPEAr600 platform is one of them. The recently added check to this > status register can't be performend on these platforms. > > This patch introduces a new config option that can be enabled on such > platforms not supporting this register. > > Signed-off-by: Stefan Roese > Cc: Heiko Schocher > --- > drivers/i2c/designware_i2c.c | 9 +++++++++ > 1 file changed, 9 insertions(+) No objections, but I miss an entry in drivers/i2c/Kconfig or at least an entry in README. Please add this, thanks! bye, Heiko > > diff --git a/drivers/i2c/designware_i2c.c b/drivers/i2c/designware_i2c.c > index 0c7cd0b..e60fd0a 100644 > --- a/drivers/i2c/designware_i2c.c > +++ b/drivers/i2c/designware_i2c.c > @@ -36,6 +36,14 @@ struct dw_i2c { > struct dw_scl_sda_cfg *scl_sda_cfg; > }; > > +#ifdef CONFIG_SYS_I2C_DW_ENABLE_STATUS_UNSUPPORTED > +static void dw_i2c_enable(struct i2c_regs *i2c_base, bool enable) > +{ > + u32 ena = enable ? IC_ENABLE_0B : 0; > + > + writel(ena, &i2c_base->ic_enable); > +} > +#else > static void dw_i2c_enable(struct i2c_regs *i2c_base, bool enable) > { > u32 ena = enable ? IC_ENABLE_0B : 0; > @@ -56,6 +64,7 @@ static void dw_i2c_enable(struct i2c_regs *i2c_base, bool enable) > > printf("timeout in %sabling I2C adapter\n", enable ? "en" : "dis"); > } > +#endif > > /* > * i2c_set_bus_speed - Set the i2c speed > -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany