From patchwork Mon Sep 21 16:28:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 263617 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7013DC43468 for ; Mon, 21 Sep 2020 16:55:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 323DD206FB for ; Mon, 21 Sep 2020 16:55:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600707341; bh=sZ0X34q0lCuHz7JePqUQnYkx562+2UZhjKzVlNe39q0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Pd08s/gTQnmoEkKk/fcVtxslwzjsH3DoOnRY/T5O8YZTq8FElH5BIIyjINBfFBosZ twTI3VPZDt+dOvSEbu8+vZQvdu5iojZoRI0w9SAi5nnRqTL1By4m0TgzxnyWaXWymq 9eQm9SQJfueJ8apVeyYW2Nhkdv7QvKGkuZ4ipgg8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727943AbgIUQpo (ORCPT ); Mon, 21 Sep 2020 12:45:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:51816 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727337AbgIUQpn (ORCPT ); Mon, 21 Sep 2020 12:45:43 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7A45920874; Mon, 21 Sep 2020 16:45:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706743; bh=sZ0X34q0lCuHz7JePqUQnYkx562+2UZhjKzVlNe39q0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DzNbnxzREGDPxX+6aF0/M10GWjYMggfTSqNnHVWlPjcPgP2cEgsYgIWAhgNnI8Nxx l9yP+MKnHMvAvDdxbjnEH1V1i9Vo34PjjdynSLhqby/zU4jE3sGGkqihyVh50J4Vno Z8Q90F/mhCrQiQWNfaoPMqcPEyQglusBiDAUjS6s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yingjoe Chen , Andy Shevchenko , Qii Wang , Wolfram Sang , Sasha Levin Subject: [PATCH 5.8 076/118] i2c: mediatek: Fix generic definitions for bus frequency Date: Mon, 21 Sep 2020 18:28:08 +0200 Message-Id: <20200921162039.861373792@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162036.324813383@linuxfoundation.org> References: <20200921162036.324813383@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Qii Wang [ Upstream commit ff6f3aff46beb3c29e0802cffcc559e1756c4814 ] The max frequency of mediatek i2c controller driver is I2C_MAX_HIGH_SPEED_MODE_FREQ, not I2C_MAX_FAST_MODE_PLUS_FREQ. Fix it. Fixes: 90224e6468e1 ("i2c: drivers: Use generic definitions for bus frequencies") Reviewed-by: Yingjoe Chen Reviewed-by: Andy Shevchenko Signed-off-by: Qii Wang Signed-off-by: Wolfram Sang Signed-off-by: Sasha Levin --- 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 deef69e569062..b099139cbb91e 100644 --- a/drivers/i2c/busses/i2c-mt65xx.c +++ b/drivers/i2c/busses/i2c-mt65xx.c @@ -658,8 +658,8 @@ static int mtk_i2c_calculate_speed(struct mtk_i2c *i2c, unsigned int clk_src, unsigned int cnt_mul; int ret = -EINVAL; - if (target_speed > I2C_MAX_FAST_MODE_PLUS_FREQ) - target_speed = I2C_MAX_FAST_MODE_PLUS_FREQ; + if (target_speed > I2C_MAX_HIGH_SPEED_MODE_FREQ) + target_speed = I2C_MAX_HIGH_SPEED_MODE_FREQ; max_step_cnt = mtk_i2c_max_step_cnt(target_speed); base_step_cnt = max_step_cnt;