Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3199909pxk; Mon, 21 Sep 2020 07:42:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVA1XLCZU1fF9hq7KiQl3SEGaStRIl2rmFf/OgKZIy8yV31dnNwCIg0wUMIVwvrH/hoJdy X-Received: by 2002:a50:fe07:: with SMTP id f7mr54903880edt.173.1600699378292; Mon, 21 Sep 2020 07:42:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600699378; cv=none; d=google.com; s=arc-20160816; b=qk7Z9IKF9DGxRTU3aO6I1FwtJfY/bLSY5gSnHsPjPAfu8VbKoUICXIDyLJYEQlPU5O GL6f2uTd/RtgqG4olE6649+MlQGale9q1l5UuLp/5tA2wggO4X1yK4gmf3excLRDDOHz O1o1rb8zzNUUKHc4V58jThB0VIzBmK/if6IWbi0aI3yAx9lB1vLGzZRacQHA/Q/Hot4B 1BaEltpy/R8SNIhRM51wJFSPFp7sXhWg18P2pwPRgAOilMh0e4c+xQrH/krikoKTzqdr 8tiquk5XvWcMWws9+ztyyJE7QbFwy7wUOBSKkcGg6ZylEoGxYeysxwo9MD3kFCQGgaRc W3rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=YhCzizBF5F/pTdYI4uKReYnPyQNSLygI/49KaK7rNS4=; b=irtruVXMlj1TH7n3X5jHe9ZJRb1QoNpVWNIOpGYObe8l2dD69zIh7AAgBvfxnvXq6A 6Kjc6YHWJnFvxySXWaW4vNcLT/a8/WbOtl+YkzAy+iQ4PGeYvmeNuCE0cWoMCGLxKGGB iHt0dnb9ZlJQ7bJhuqYMXyJrsq8yRVuOOMprxldjgMvirjh0hrjvrRMdqZS6BXwGc6sv ua3DC0Ft/vjz0F2jIjMG+16QoJr+Wo9gdaj9XnAeWPrc3sCkSe0tjBgAa3ak0V1f1w6s xVAwLfbJUsZxN06Lzn13D/UlyMXVxmed/L/EUIqMLfjHJHboRx3zgWUKGYwmBM1oQ1Vp HD1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=S8dOr7n3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b1si8615554ejg.435.2020.09.21.07.42.34; Mon, 21 Sep 2020 07:42:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=S8dOr7n3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727977AbgIUOlE (ORCPT + 99 others); Mon, 21 Sep 2020 10:41:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:49796 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727928AbgIUOk5 (ORCPT ); Mon, 21 Sep 2020 10:40:57 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6B7DD2371F; Mon, 21 Sep 2020 14:40:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600699252; bh=epOgRHJDgXsxln8kuvcmrBtLdvOqe96oF8UpA61L8X0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S8dOr7n3XFo3w/dITei4kEhijo8bA7pfeJjTGLdIoTAzNQHX+9LDRzwxg07Rah27X T+lOxryJphhl3GV7UN0LaoBe2vBRH6o9TuF/YXhL7HrJFo3CXn32+5NoA9nFyUlNro otRQ1V8+p2AiS1RVz5r22jCdDLLWLnGmrsFfeCgU= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Qii Wang , Andy Shevchenko , Wolfram Sang , Sasha Levin , linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH AUTOSEL 5.8 19/20] i2c: mediatek: Send i2c master code at more than 1MHz Date: Mon, 21 Sep 2020 10:40:26 -0400 Message-Id: <20200921144027.2135390-19-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200921144027.2135390-1-sashal@kernel.org> References: <20200921144027.2135390-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Qii Wang [ Upstream commit b44658e755b5a733e9df04449facbc738df09170 ] The master code needs to being sent when the speed is more than I2C_MAX_FAST_MODE_PLUS_FREQ, not I2C_MAX_FAST_MODE_FREQ in the latest I2C-bus specification and user manual. Signed-off-by: Qii Wang Reviewed-by: Andy Shevchenko Signed-off-by: Wolfram Sang Signed-off-by: Sasha Levin --- drivers/i2c/busses/i2c-mt65xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-mt65xx.c b/drivers/i2c/busses/i2c-mt65xx.c index deef69e569062..440b12eba1e3c 100644 --- a/drivers/i2c/busses/i2c-mt65xx.c +++ b/drivers/i2c/busses/i2c-mt65xx.c @@ -736,7 +736,7 @@ static int mtk_i2c_set_speed(struct mtk_i2c *i2c, unsigned int parent_clk) for (clk_div = 1; clk_div <= max_clk_div; clk_div++) { clk_src = parent_clk / clk_div; - if (target_speed > I2C_MAX_FAST_MODE_FREQ) { + if (target_speed > I2C_MAX_FAST_MODE_PLUS_FREQ) { /* Set master code speed register */ ret = mtk_i2c_calculate_speed(i2c, clk_src, I2C_MAX_FAST_MODE_FREQ, -- 2.25.1