From patchwork Sat Dec 21 16:15:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1214542 X-Patchwork-Delegate: hs@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="d0XXsbTE"; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47g9hy2fWyz9sR4 for ; Sun, 22 Dec 2019 03:16:18 +1100 (AEDT) Received: from phobos.denx.de (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B9CA68168D; Sat, 21 Dec 2019 17:15:50 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="d0XXsbTE"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CB2A28163D; Sat, 21 Dec 2019 17:15:40 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x142.google.com (mail-il1-x142.google.com [IPv6:2607:f8b0:4864:20::142]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 9300380194 for ; Sat, 21 Dec 2019 17:15:37 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x142.google.com with SMTP id t17so10604888ilm.13 for ; Sat, 21 Dec 2019 08:15:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YciwnyrhsbXLryZrkKhxqAtN1tEUDldo49a+/xg4TAs=; b=d0XXsbTEqId/bkd1057R4jLUP3T01q9hztjQvan6Aqin7ZcPB9sgXBSPZh9CvM1Ab5 owgcLmTe8MgBZIFXA8vPOFRCPhzlSIBOtgvZxL3NTRVsKScVlOlPPanWxMQESe3Z4dI1 2+dJCsY07Nevu0n3oUhbWzPdVLUWXbh8mLGgM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YciwnyrhsbXLryZrkKhxqAtN1tEUDldo49a+/xg4TAs=; b=MA6gNZN9bLqX6GlfbIQ1qvBo5ymiuHfjSLm9E3r9YWYCUuEOUqw6vtbre8+wfv2t4/ DxzbGvW2I5G1PusZqJBe6JfoQ2RuNZFJWomL80XqGUsez/0JB/wqVhP5lRt4EHuZw1Bo IVYM9+bHlcX1Pg8JLLPz+CWdOI1dhQKzbJz6POu3Q5iis341Ohbldj8a+MMe2KZ65SbS KIW0m0xYeAyeNZF7KyHaRAh2NpwUsff+Xf9hVOW5MWrNyJSprdYqPVNsMHGAfIXv6R88 3uxujLXIhBrfasoYA57uhrqd5/j7eJ484DY6YJgqqoX4aSrHDGzWEmutm2HWxesjXLut KfKw== X-Gm-Message-State: APjAAAUIPLuG/Qb2ApN2wxxBGVf4FHSgY1D6A4tGfdgfbphFZcpEDkUr pibWxlflkhQpMcn1d23epuIq7yLIPEM= X-Google-Smtp-Source: APXvYqzuIq7uQIcKaoKhG+X1F2gvCz3kBA/I67PFP49dfX4GQLdXdXxy7tf2w9B1Mz5XKU30zPLPww== X-Received: by 2002:a92:4891:: with SMTP id j17mr16810070ilg.33.1576944936416; Sat, 21 Dec 2019 08:15:36 -0800 (PST) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id r20sm4945005ioc.35.2019.12.21.08.15.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Dec 2019 08:15:36 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Subject: [PATCH 04/12] i2c: designware_i2c: Rename 'max' speed to 'high' speed Date: Sat, 21 Dec 2019 09:15:17 -0700 Message-Id: <20191221161525.27976-5-sjg@chromium.org> X-Mailer: git-send-email 2.24.1.735.g03f4e72817-goog In-Reply-To: <20191221161525.27976-1-sjg@chromium.org> References: <20191221161525.27976-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.26 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jun Chen Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.101.4 at phobos.denx.de X-Virus-Status: Clean 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 --- 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;