Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1614932pxb; Mon, 11 Oct 2021 09:31:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzwNe+n0zvlHXYl3H2qtsk7EXVWLCPymJ6uNgiIVJNi+Jxu96gS6hlxIkaVscKB98EDG+cn X-Received: by 2002:a63:40f:: with SMTP id 15mr18968460pge.328.1633969904375; Mon, 11 Oct 2021 09:31:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633969904; cv=none; d=google.com; s=arc-20160816; b=FPaIbspUU0yqIPf+BHzy7zyurMX7V397gFcpsT+/9va+gGbJdhu4ydBnG42k4q7DZD 2vjLV5tfMZFe1jL84kxtK6gkEpG6zJzp9z1kjmCBQtDwaUbetOq4iHKXqnzLwu3K/XAD jH2NFAMiUhbtv6P95w+hNcuCAbe9K0XMdFkBMIsI/ksUXHiUagmRlFJXWlpmwiQxHN1n g3tW66QVSzeT1pBdEMPPg9hrPNoa0iGTk0zy+OUqwFNlUz8oi+JGQEUP4sp4rZ5Z/91z RP6wlFXHPf0ZKw6e6F8Z0JWcRyvZDNHNOv0fl+NaNF1PzMvgovpONC7CwecpQ6IKScxG tpuQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=oKlblmtqjXIxT8IS95FwwSMP31xgIVeZkABlTSYglhM=; b=bwnsPesBOe3VZy/C4ZWo1sisCszhDGsXW8UsTWusDONhEGYgLoCnCjvswF70cxtkhN +6VmecN/M0hqKNTOa06vJfoyqTHlReqAVWJyPvEL2/HxgS5QOeQGxGGN0rjPMeHBgQ0p RR67aZNRSj5vYY6mVOxv+x9VincrCdnxqRpjk7td1Ug/q/mtJB1ZcbduazU3uHSmBTf9 4xoIv0gSUHo0j/5Axy+ehXILi5jMwGVIkgl5a7fZVBgfgYePaYKII/XFih44ANimcIy8 UlglDZ3xd5wHr6z2Y+V0Jfno04XGLedQCBcWtOrG561D3i0O3Wl0+I4ori0VGPFaGF/p 3GTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=b4dRgXu3; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l193si10800936pge.180.2021.10.11.09.31.31; Mon, 11 Oct 2021 09:31:44 -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=@linuxfoundation.org header.s=korg header.b=b4dRgXu3; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238177AbhJKOAK (ORCPT + 99 others); Mon, 11 Oct 2021 10:00:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:50218 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238263AbhJKN6Y (ORCPT ); Mon, 11 Oct 2021 09:58:24 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D4BB8611C1; Mon, 11 Oct 2021 13:54:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1633960498; bh=fBCpmBLAszMiYeE7CgB4uvdR7PnatagguRCxsHigV1E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b4dRgXu3RNldep4sg2f8PED6/axuJlSvwPMz5LPehkNF7UU6ih68o2zOS/jHsS+AE zMuGg/ElhTo88HFA28ttZwWqWZ0Ylk6xUxgovqjXKSL9Getjcd39uifBXdAf0afjFN IRx05NI/NTCYg6g8bVvqxN5wv1fLNG9gzNL9QxjY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kewei Xu , Qii Wang , Wolfram Sang , Sasha Levin Subject: [PATCH 5.10 69/83] i2c: mediatek: Add OFFSET_EXT_CONF setting back Date: Mon, 11 Oct 2021 15:46:29 +0200 Message-Id: <20211011134510.768882746@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211011134508.362906295@linuxfoundation.org> References: <20211011134508.362906295@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kewei Xu [ Upstream commit 3bce7703c7ba648bd9e174dc1413f422b7998833 ] In the commit be5ce0e97cc7 ("i2c: mediatek: Add i2c ac-timing adjust support"), we miss setting OFFSET_EXT_CONF register if i2c->dev_comp->timing_adjust is false, now add it back. Fixes: be5ce0e97cc7 ("i2c: mediatek: Add i2c ac-timing adjust support") Signed-off-by: Kewei Xu Reviewed-by: Qii Wang Signed-off-by: Wolfram Sang Signed-off-by: Sasha Levin --- drivers/i2c/busses/i2c-mt65xx.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-mt65xx.c b/drivers/i2c/busses/i2c-mt65xx.c index 1a5f1ccd1d2f..0af2784cbd0d 100644 --- a/drivers/i2c/busses/i2c-mt65xx.c +++ b/drivers/i2c/busses/i2c-mt65xx.c @@ -41,6 +41,8 @@ #define I2C_HANDSHAKE_RST 0x0020 #define I2C_FIFO_ADDR_CLR 0x0001 #define I2C_DELAY_LEN 0x0002 +#define I2C_ST_START_CON 0x8001 +#define I2C_FS_START_CON 0x1800 #define I2C_TIME_CLR_VALUE 0x0000 #define I2C_TIME_DEFAULT_VALUE 0x0003 #define I2C_WRRD_TRANAC_VALUE 0x0002 @@ -479,6 +481,7 @@ static void mtk_i2c_init_hw(struct mtk_i2c *i2c) { u16 control_reg; u16 intr_stat_reg; + u16 ext_conf_val; mtk_i2c_writew(i2c, I2C_CHN_CLR_FLAG, OFFSET_START); intr_stat_reg = mtk_i2c_readw(i2c, OFFSET_INTR_STAT); @@ -517,8 +520,13 @@ static void mtk_i2c_init_hw(struct mtk_i2c *i2c) if (i2c->dev_comp->ltiming_adjust) mtk_i2c_writew(i2c, i2c->ltiming_reg, OFFSET_LTIMING); + if (i2c->speed_hz <= I2C_MAX_STANDARD_MODE_FREQ) + ext_conf_val = I2C_ST_START_CON; + else + ext_conf_val = I2C_FS_START_CON; + if (i2c->dev_comp->timing_adjust) { - mtk_i2c_writew(i2c, i2c->ac_timing.ext, OFFSET_EXT_CONF); + ext_conf_val = i2c->ac_timing.ext; mtk_i2c_writew(i2c, i2c->ac_timing.inter_clk_div, OFFSET_CLOCK_DIV); mtk_i2c_writew(i2c, I2C_SCL_MIS_COMP_VALUE, @@ -543,6 +551,7 @@ static void mtk_i2c_init_hw(struct mtk_i2c *i2c) OFFSET_HS_STA_STO_AC_TIMING); } } + mtk_i2c_writew(i2c, ext_conf_val, OFFSET_EXT_CONF); /* If use i2c pin from PMIC mt6397 side, need set PATH_DIR first */ if (i2c->have_pmic) -- 2.33.0