From patchwork Tue Sep 29 11:01:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 291044 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=-13.5 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=ham 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 EF270C4727F for ; Tue, 29 Sep 2020 11:53:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BD13B206A5 for ; Tue, 29 Sep 2020 11:53:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601380434; bh=2Ao+3uo09TXn/cGlZQBAejAX5HWSvH6VuBeV2hc5SQM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=kc5imICqYFlHWsHcqO1IifIqQhSiQt6AGI7Qzo1DUZa2Cg5McDIEWbL128tSluzjC jQyMgsbbJIo3wA3X0FbARAXRQEJasXo2d0aNFqMUC9F9g9+11Cpf2eTRyyL40Plrby 8iQWDRjnhgoDqE7vmsYUzOY8R6HA/66+IfGPFycc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731330AbgI2Lxy (ORCPT ); Tue, 29 Sep 2020 07:53:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:47386 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731020AbgI2Lqg (ORCPT ); Tue, 29 Sep 2020 07:46:36 -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 1002721D46; Tue, 29 Sep 2020 11:46:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601379991; bh=2Ao+3uo09TXn/cGlZQBAejAX5HWSvH6VuBeV2hc5SQM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NuBbCOjmMUuXTQ8d6IEUZ1kDvi9oZN6hEFZVHBHU1YnWhH6+p48u43kmyEAVv/BCX GwnyXBH9bnnQ7Yv3bHAEnGooHlUhrSirBaeYCzIPA8JDYphzNXa0/ZGFhZ/YRVgpZ8 6KYzL3ZI52n1g7gwK5jp+hIqGaCCwlGZ9wsdNikk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Qii Wang , Andy Shevchenko , Wolfram Sang , Sasha Levin Subject: [PATCH 5.8 19/99] i2c: mediatek: Send i2c master code at more than 1MHz Date: Tue, 29 Sep 2020 13:01:02 +0200 Message-Id: <20200929105930.665868752@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200929105929.719230296@linuxfoundation.org> References: <20200929105929.719230296@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 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 b099139cbb91e..f9e62c958cf69 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,