From patchwork Mon Mar 2 08:58:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jun Chen X-Patchwork-Id: 243171 List-Id: U-Boot discussion From: ptchentw at gmail.com (Jun Chen) Date: Mon, 2 Mar 2020 16:58:56 +0800 Subject: [PATCH 3/4] i2c: designware_i2c: remove 'has_high_speed' In-Reply-To: <1583139537-65602-1-git-send-email-ptchentw@gmail.com> References: <1583139537-65602-1-git-send-email-ptchentw@gmail.com> Message-ID: <1583139537-65602-4-git-send-email-ptchentw@gmail.com> From: Jun Chen Remove 'has_high_speed' config since we can check high speed support from IC_COMP_PARAM_1 register. Signed-off-by: Jun Chen Signed-off-by: Jun Chen --- drivers/i2c/designware_i2c.c | 3 +-- drivers/i2c/designware_i2c.h | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/i2c/designware_i2c.c b/drivers/i2c/designware_i2c.c index f4fbf3b..74aef77 100644 --- a/drivers/i2c/designware_i2c.c +++ b/drivers/i2c/designware_i2c.c @@ -212,8 +212,7 @@ static int calc_bus_speed(struct dw_i2c *priv, int speed, ulong bus_clk, if (priv) scl_sda_cfg = priv->scl_sda_cfg; /* Allow high speed if there is no config, or the config allows it */ - if (speed >= I2C_SPEED_HIGH_RATE && - (!scl_sda_cfg || scl_sda_cfg->has_high_speed)) + if (speed >= I2C_SPEED_HIGH_RATE) i2c_spd = IC_SPEED_MODE_HIGH; else if (speed >= I2C_SPEED_FAST_PLUS_RATE) i2c_spd = IC_SPEED_MODE_FAST_PLUS; diff --git a/drivers/i2c/designware_i2c.h b/drivers/i2c/designware_i2c.h index 23f311b..5a04ce5 100644 --- a/drivers/i2c/designware_i2c.h +++ b/drivers/i2c/designware_i2c.h @@ -144,7 +144,6 @@ struct i2c_regs { /** * struct dw_scl_sda_cfg - I2C timing configuration * - * @has_high_speed: Support high speed (3.4Mbps) * @ss_hcnt: Standard speed high time in ns * @fs_hcnt: Fast speed high time in ns * @ss_lcnt: Standard speed low time in ns @@ -152,7 +151,6 @@ struct i2c_regs { * @sda_hold: SDA hold time */ struct dw_scl_sda_cfg { - bool has_high_speed; u32 ss_hcnt; u32 fs_hcnt; u32 ss_lcnt;