From patchwork Mon Apr 10 16:19:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Golle X-Patchwork-Id: 81568 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2014440vqo; Mon, 10 Apr 2023 09:39:45 -0700 (PDT) X-Google-Smtp-Source: AKy350YJnL/exbujTxSxkRcedx2IUYlFauYK5ZiXxGfYXs1BrT0HqqyNqNpNBsaFhEIVSmBLY8R6 X-Received: by 2002:a17:906:b0d:b0:94d:7e31:e338 with SMTP id u13-20020a1709060b0d00b0094d7e31e338mr1235309ejg.52.1681144785220; Mon, 10 Apr 2023 09:39:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681144785; cv=none; d=google.com; s=arc-20160816; b=BMphlXIZkHHZTIT8aGtBYaNctOxaItT8KqPHsXz8bqjeh4Prh7hEY9bLAtrVrseE/m y5FhakwJaXdXpmT2kWoHP7GyVIAd9rLCz5bsoeEYMEmgAfxuE9rb6CaiLFyeZFWlgfYw +ocWs9HuO2QUMKiFgboSq8OUCxcohimQSFpuYCy2uDJIewX7Fh/+GF78s/POPieH2V3f 6ZBJ1u+1/JkamtC6kqBIEBwOBu7aQgU0GUOTe4+tbDFqY/jk52OHclZhAEtjOkjt+IZ2 fbke7chgnXRaQ+0BZ6VQq6slpnO6B4/wsV1SzFqru77m2j3xcvvSg3VJbP+BPyOQ7FNN U6+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:to:from:date; bh=MNo3VUeVBCvTr93etMC8xb2Qm5HnTquhpskeDbfLiFg=; b=RL/kmjykIGFix6HMqjrFO2cVa8btbWj+DoaDEUxR34DMTkCaLVjmecqD2ybZR0mR7Y GF4sd6tBd43gdOCbLkpwvENmMugMJhAzeZyc8NqcIF8dfAX1r19ZmtI+b3/YJqYfKM1X tCmam/iVBtFi9L2R0qRtM2X1k4D87Udbg+TExyEOcHWAABRMJ06O2keAmrNGzWWLF1Kt s07/U6n667v4Z5o358SPhMr+NYnl7lTpPxC0nc4gpX4bZaQNRdTO6Mm8kqZIHDdUPm75 daMo8zvp/qIWwPoaqBE4C7A0/6ydZLbSzDcc3P8SSzaQACcAJ++n9uFv94HlIvIqkxgz kgfQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u5-20020a170906408500b00932bed49028si6140363ejj.809.2023.04.10.09.39.20; Mon, 10 Apr 2023 09:39:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230233AbjDJQTz (ORCPT + 99 others); Mon, 10 Apr 2023 12:19:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229692AbjDJQTy (ORCPT ); Mon, 10 Apr 2023 12:19:54 -0400 Received: from fudo.makrotopia.org (fudo.makrotopia.org [IPv6:2a07:2ec0:3002::71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1244E26AC; Mon, 10 Apr 2023 09:19:45 -0700 (PDT) Received: from local by fudo.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.96) (envelope-from ) id 1pluF6-0004w1-0T; Mon, 10 Apr 2023 18:19:44 +0200 Date: Mon, 10 Apr 2023 17:19:38 +0100 From: Daniel Golle To: linux-i2c@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Qii Wang , Rob Herring , Krzysztof Kozlowski , AngeloGioacchino Del Regno , Matthias Brugger , Sam Shih Subject: [PATCH v3 2/2] i2c: mediatek: add support for MT7981 SoC Message-ID: <7b5c6ba8da51ea6145fb71815a2f65a9e1d341c1.1680857025.git.daniel@makrotopia.org> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762808074489749344?= X-GMAIL-MSGID: =?utf-8?q?1762808074489749344?= Add support for the I2C units found in the MediaTek MT7981 and MT7988 SoCs. Just like other recent MediaTek I2C units that also uses v3 register offsets (which differ from v2 only by OFFSET_SLAVE_ADDR being 0x94 instead of 0x4). Signed-off-by: Daniel Golle Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Alexandre Mergnat --- drivers/i2c/busses/i2c-mt65xx.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/i2c/busses/i2c-mt65xx.c b/drivers/i2c/busses/i2c-mt65xx.c index 59eaefe999b11..a43c4d77739ab 100644 --- a/drivers/i2c/busses/i2c-mt65xx.c +++ b/drivers/i2c/busses/i2c-mt65xx.c @@ -431,6 +431,18 @@ static const struct mtk_i2c_compatible mt8168_compat = { .max_dma_support = 33, }; +static const struct mtk_i2c_compatible mt7981_compat = { + .regs = mt_i2c_regs_v3, + .pmic_i2c = 0, + .dcm = 0, + .auto_restart = 1, + .aux_len_reg = 1, + .timing_adjust = 1, + .dma_sync = 1, + .ltiming_adjust = 1, + .max_dma_support = 33 +}; + static const struct mtk_i2c_compatible mt7986_compat = { .quirks = &mt7622_i2c_quirks, .regs = mt_i2c_regs_v1, @@ -516,6 +528,7 @@ static const struct of_device_id mtk_i2c_of_match[] = { { .compatible = "mediatek,mt6577-i2c", .data = &mt6577_compat }, { .compatible = "mediatek,mt6589-i2c", .data = &mt6589_compat }, { .compatible = "mediatek,mt7622-i2c", .data = &mt7622_compat }, + { .compatible = "mediatek,mt7981-i2c", .data = &mt7981_compat }, { .compatible = "mediatek,mt7986-i2c", .data = &mt7986_compat }, { .compatible = "mediatek,mt8168-i2c", .data = &mt8168_compat }, { .compatible = "mediatek,mt8173-i2c", .data = &mt8173_compat },