diff options
author | Stefan Roese <sr@denx.de> | 2016-04-27 07:02:12 (GMT) |
---|---|---|
committer | Heiko Schocher <hs@denx.de> | 2016-05-17 06:28:50 (GMT) |
commit | b6a77b0ce8ac21c154f02907c364b6d3e3c8af5e (patch) | |
tree | 67b980cdd9b641cffb2e2f0a2277a36e6b11580f /drivers | |
parent | d79ac324789839b4b10b37e2ff64dd9e4a92441e (diff) | |
download | u-boot-fsl-qoriq-b6a77b0ce8ac21c154f02907c364b6d3e3c8af5e.tar.xz |
i2c: designware_i2c: Optionally check enable status register
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 <sr@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Reviewed-by: Heiko Schocher <hs@denx.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/i2c/designware_i2c.c | 9 |
1 files changed, 9 insertions, 0 deletions
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 |