All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [PATCH 04/12] i2c: designware_i2c: Rename 'max' speed to 'high' speed
Date: Sat, 21 Dec 2019 09:15:17 -0700	[thread overview]
Message-ID: <20191221161525.27976-5-sjg@chromium.org> (raw)
In-Reply-To: <20191221161525.27976-1-sjg@chromium.org>

Some SoCs support a higher speed than what is currently called 'max' in
this driver. Rename it to 'high' speed, which is the official name of the
3.4MHz speed.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 drivers/i2c/designware_i2c.c | 10 +++++-----
 drivers/i2c/designware_i2c.h |  8 ++++----
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/i2c/designware_i2c.c b/drivers/i2c/designware_i2c.c
index 138fc72561..dd1cc0b823 100644
--- a/drivers/i2c/designware_i2c.c
+++ b/drivers/i2c/designware_i2c.c
@@ -62,10 +62,10 @@ static unsigned int __dw_i2c_set_bus_speed(struct i2c_regs *i2c_base,
 	unsigned int ena;
 	int i2c_spd;
 
-	/* Allow max speed if there is no config, or the config allows it */
-	if (speed >= I2C_MAX_SPEED &&
-	    (!scl_sda_cfg || scl_sda_cfg->has_max_speed))
-		i2c_spd = IC_SPEED_MODE_MAX;
+	/* Allow high speed if there is no config, or the config allows it */
+	if (speed >= I2C_HIGH_SPEED &&
+	    (!scl_sda_cfg || scl_sda_cfg->has_high_speed))
+		i2c_spd = IC_SPEED_MODE_HIGH;
 	else if (speed >= I2C_FAST_SPEED)
 		i2c_spd = IC_SPEED_MODE_FAST;
 	else
@@ -80,7 +80,7 @@ static unsigned int __dw_i2c_set_bus_speed(struct i2c_regs *i2c_base,
 	cntl = (readl(&i2c_base->ic_con) & (~IC_CON_SPD_MSK));
 
 	switch (i2c_spd) {
-	case IC_SPEED_MODE_MAX:
+	case IC_SPEED_MODE_HIGH:
 		cntl |= IC_CON_SPD_SS;
 		if (scl_sda_cfg) {
 			hcnt = scl_sda_cfg->fs_hcnt;
diff --git a/drivers/i2c/designware_i2c.h b/drivers/i2c/designware_i2c.h
index 39e62bcf51..fcb7dde83a 100644
--- a/drivers/i2c/designware_i2c.h
+++ b/drivers/i2c/designware_i2c.h
@@ -137,16 +137,16 @@ struct i2c_regs {
 /* Speed Selection */
 #define IC_SPEED_MODE_STANDARD	1
 #define IC_SPEED_MODE_FAST	2
-#define IC_SPEED_MODE_MAX	3
+#define IC_SPEED_MODE_HIGH	3
 
-#define I2C_MAX_SPEED		3400000
+#define I2C_HIGH_SPEED		3400000
 #define I2C_FAST_SPEED		400000
 #define I2C_STANDARD_SPEED	100000
 
 /**
  * struct dw_scl_sda_cfg - I2C timing configuration
  *
- * @has_max_speed: Support maximum speed (1Mbps)
+ * @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
@@ -154,7 +154,7 @@ struct i2c_regs {
  * @sda_hold: SDA hold time
  */
 struct dw_scl_sda_cfg {
-	bool has_max_speed;
+	bool has_high_speed;
 	u32 ss_hcnt;
 	u32 fs_hcnt;
 	u32 ss_lcnt;
-- 
2.24.1.735.g03f4e72817-goog

  parent reply	other threads:[~2019-12-21 16:15 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-21 16:15 [PATCH 00/12] i2c: designware_ic2: Improvements to timing Simon Glass
2019-12-21 16:15 ` [PATCH 01/12] i2c: designware_i2c: Add more registers Simon Glass
2019-12-23  8:15   ` Tan, Ley Foon
2019-12-25 10:20     ` pt
2019-12-21 16:15 ` [PATCH 02/12] i2c: designware_i2c: Don't allow changing IC_CLK Simon Glass
2019-12-21 16:15 ` [PATCH 03/12] i2c: designware_i2c: Include clk.h in the header file Simon Glass
2019-12-23  8:17   ` Tan, Ley Foon
2019-12-21 16:15 ` Simon Glass [this message]
2019-12-21 16:15 ` [PATCH 05/12] i2c: designware_i2c: Use an enum for selected speed mode Simon Glass
2019-12-21 16:15 ` [PATCH 06/12] i2c: designware_i2c: Use an accurate bus clock instead of MHz Simon Glass
2019-12-21 16:15 ` [PATCH 07/12] i2c: designware_i2c: Bring in the binding file Simon Glass
2019-12-21 16:15 ` [PATCH 08/12] i2c: designware_i2c: Read device-tree properties Simon Glass
2019-12-21 16:15 ` [PATCH 09/12] i2c: designware_i2c: Drop scl_sda_cfg parameter Simon Glass
2019-12-21 16:15 ` [PATCH 10/12] i2c: designware_i2c: Put hold config in a struct Simon Glass
2019-12-21 16:15 ` [PATCH 11/12] i2c: designware_i2c: Rewrite timing calculation Simon Glass
2019-12-21 16:15 ` [PATCH 12/12] i2c: designware_i2c: Add spike supression Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191221161525.27976-5-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.