Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1098022imu; Fri, 21 Dec 2018 12:32:57 -0800 (PST) X-Google-Smtp-Source: ALg8bN4vxfJeSRPUZJR7NaVbtSYZGlU2wsUl1/UNLorvBNk3veYrv1HozhAQHaxkpQHEG3UFczlJ X-Received: by 2002:a63:1766:: with SMTP id 38mr3696702pgx.299.1545424377816; Fri, 21 Dec 2018 12:32:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545424377; cv=none; d=google.com; s=arc-20160816; b=fhvTsZOxU8cKMa6owoWT8QzQEgbd6ovC9WhqOjWfc6utyZd/qhr4to8JfkjwK0/gaZ qdHB6z7eUvSgbP4vae2Vig9Qb0HL8Hkp21uZu4X+eQa19OH+ikrtYjvPYN7yiCHoLaWC BiiW/ZdgunWQOKNIpvaBmQIE1PBj5ZhEAyGasFnHEbWb4TvIsNWKI9LzK+sgNNzYt0Nv YukS3LJOfTlSfMnCMErMjhopl5Jlh69RQ2JHj4ZT/dnb3Le8u9zv5V/13kTP4Z7vXMVD ZJu1senxuprmuyO5+cgMiV2h7RL7+S1vMLGXpun3nkqs0qpYB3SFZfJMiiOvGYJXE6ck qqhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=HEmbuZGSulmpLbxegztwTPz+xR0oBiFNMtn6tCc2Jk0=; b=E9VE4FIJbChUCqugaLYZd9lH6oDwrc1ahcLuBPa1qhwLAclINfSmpYzAKnufy5IPNm Zr5sisTBQTRpax6Ek+P4tVGvEPbM/ribBoD8YSSjHMhdUM+B4xX/QNetbCShSB3vJQIx ND+WKwYpOPzni6z9P8f78IbG1tI3k4insp9J/BzSH7gnaCV6ZVPmfO7zNCN7HlV0QK0q vplutiq4ibEea0UNN/Np/KF9ZtwV3HlzgcX0rfZoyI8EMo4ivGIpw60NtPdfuBGxcCDX DdYB2H5nYUi2ssbqlGr3CYvcJoB5l4uRUZ1z+k5c/LEV0dRq1Z87d2MNoZxxe/uu4y/1 m/ng== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k15si21946110pgi.99.2018.12.21.12.32.42; Fri, 21 Dec 2018 12:32:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390440AbeLUM7I (ORCPT + 99 others); Fri, 21 Dec 2018 07:59:08 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:59013 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S2388253AbeLUM7H (ORCPT ); Fri, 21 Dec 2018 07:59:07 -0500 X-UUID: 3dcaf488c5c24a52ab458e341ded707b-20181221 X-UUID: 3dcaf488c5c24a52ab458e341ded707b-20181221 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1672867; Fri, 21 Dec 2018 20:59:02 +0800 Received: from mtkcas09.mediatek.inc (172.21.101.178) by mtkmbs03n1.mediatek.inc (172.21.101.181) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 21 Dec 2018 20:59:01 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas09.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Fri, 21 Dec 2018 20:59:01 +0800 From: qii wang To: CC: , , , , , , , , Subject: [PATCH 2/6] i2c: mediatek: speeds is replaced by macros definitions Date: Fri, 21 Dec 2018 20:58:27 +0800 Message-ID: <1545397111-24183-3-git-send-email-qii.wang@mediatek.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1545397111-24183-1-git-send-email-qii.wang@mediatek.com> References: <1545397111-24183-1-git-send-email-qii.wang@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Different speeds have been defined by macros, so we use macros definitions. Signed-off-by: qii wang --- drivers/i2c/busses/i2c-mt65xx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/busses/i2c-mt65xx.c b/drivers/i2c/busses/i2c-mt65xx.c index a74ef76..7396449 100644 --- a/drivers/i2c/busses/i2c-mt65xx.c +++ b/drivers/i2c/busses/i2c-mt65xx.c @@ -456,7 +456,7 @@ static int mtk_i2c_do_transfer(struct mtk_i2c *i2c, struct i2c_msg *msgs, control_reg = readw(i2c->base + OFFSET_CONTROL) & ~(I2C_CONTROL_DIR_CHANGE | I2C_CONTROL_RS); - if ((i2c->speed_hz > 400000) || (left_num >= 1)) + if ((i2c->speed_hz > MAX_FS_MODE_SPEED) || (left_num >= 1)) control_reg |= I2C_CONTROL_RS; if (i2c->op == I2C_MASTER_WRRD) @@ -465,7 +465,7 @@ static int mtk_i2c_do_transfer(struct mtk_i2c *i2c, struct i2c_msg *msgs, writew(control_reg, i2c->base + OFFSET_CONTROL); /* set start condition */ - if (i2c->speed_hz <= 100000) + if (i2c->speed_hz <= I2C_DEFAULT_SPEED) writew(I2C_ST_START_CON, i2c->base + OFFSET_EXT_CONF); else writew(I2C_FS_START_CON, i2c->base + OFFSET_EXT_CONF); -- 1.7.9.5