Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5945707imu; Mon, 21 Jan 2019 00:03:03 -0800 (PST) X-Google-Smtp-Source: ALg8bN5ectLTZuosLPxv/WJuhfjPYhD6Rf7tZE58I3xhP9VfiM0qamm25ItJShpI5r1eoVyoQrxG X-Received: by 2002:a63:4665:: with SMTP id v37mr27624682pgk.425.1548057783043; Mon, 21 Jan 2019 00:03:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548057783; cv=none; d=google.com; s=arc-20160816; b=LtpDT13KkOirLVL3BixYhKw3vaYty1DjeeOsIlygk03YrQRt7ewLBHRop2smK0ebD5 Wb9Vgc1tV71utNxSTF1Dagz3fEhUKGCN3hd72bgV5vwzGm3u9zJ9x+CLvXhwSWcLP5w1 +ZoJ6cEe/04iMUMBuTYn/JRIjljvAExZeUeowU8/HYBeLhyeLKhl1kdgQMs0bxJl5PYN aP55gVcItdjEKyaSJvy3I3DE7RqGld/5m6vSR8aIh25QoYEyr6fxT6qUSgVoITlhzbvT vWI3gmqVQBL0jufTigJJ99HCKnBmozb7NLFh2CIQFcmjiUc7Jz0/7+9PcUIWKplLQLim 9YYw== 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=L1RFYvIbxBLQ12IAL+bqO6Pn9I4T6xiQV1z/CTFm/Eo=; b=F1R+Um3ugHVyBYMmyS61WfR9jECpq4SUm2FGnMBzb4Lk4iMnsBrhc9iS330yKmuU+k 9Mm0pIvT3Qbfeop4+1AZ49Ej1Nv93c6JukGujeBVPGs5qEmwuLZHoi0kMUcWvkqCfEyp 5iETkRpsuHn13ialk9PPB0cJaVIP8nmzHFciyemirKhw4tci5oVozu7aMkzBX21+Njmd i1jj4agnadS/NL3vbDBX9zLw9S/WG8qkMGZSG4fmkSwyRPHUUoGJ0O6NKJFBPnn4OGBu +KIn4XyVUmKVNsi2qSqH0svpiafKNyOHR2wGQ8CHVlCWMXV7Ww6ld2FQRDYfNmzvr+aH RJWg== 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 gn22si8355693plb.19.2019.01.21.00.02.47; Mon, 21 Jan 2019 00:03:03 -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 S1729565AbfAUIBG (ORCPT + 99 others); Mon, 21 Jan 2019 03:01:06 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:9039 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1729230AbfAUIA7 (ORCPT ); Mon, 21 Jan 2019 03:00:59 -0500 X-UUID: c335e96718694e0cac5c6e98445a965e-20190121 X-UUID: c335e96718694e0cac5c6e98445a965e-20190121 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 314300069; Mon, 21 Jan 2019 16:00:40 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs08n1.mediatek.inc (172.21.101.55) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 21 Jan 2019 16:00:40 +0800 Received: from localhost.localdomain (10.17.3.153) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Mon, 21 Jan 2019 16:00:39 +0800 From: qii wang To: CC: , , , , , , , , , , Subject: [PATCH v3 2/6] i2c: mediatek: speeds is replaced by macros definitions Date: Mon, 21 Jan 2019 15:59:30 +0800 Message-ID: <1548057574-8061-3-git-send-email-qii.wang@mediatek.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1548057574-8061-1-git-send-email-qii.wang@mediatek.com> References: <1548057574-8061-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 Reviewed-by: Nicolas Boichat --- 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