From patchwork Thu Apr 6 21:41:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Golle X-Patchwork-Id: 80543 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1317507vqo; Thu, 6 Apr 2023 14:42:29 -0700 (PDT) X-Google-Smtp-Source: AKy350YGhZssvBkVvPVrtjWnKosW1AGGVza0IWpJS7Pn+D6/gsiZACrbijFRTH41hOJq12HTB/oF X-Received: by 2002:a17:903:230b:b0:1a1:cc91:c43c with SMTP id d11-20020a170903230b00b001a1cc91c43cmr515456plh.45.1680817349255; Thu, 06 Apr 2023 14:42:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680817349; cv=none; d=google.com; s=arc-20160816; b=uj3hkbQqXPhgf+GVxOoze4cIiOx9GsEJL+Za0i7v+vSzE4dsKMbSUwsBt0nAqweSAL wvBgpInzQmxr2ud4keQrOLyCv6MShXPv+UzivUHo02xNuL6CsSCV9YtxHZviXLfRIkNP DTD+LiVMmZ9uSFM0kIWo/+NmWwOCzVS0qcrNV1qEtf0DsQ0PGTm9v5iNc9EXus58lsea Panj2FLEolE0h72p/b2YX8NyKHtcI4eni1wlN1u557l0wM3OtBz21ZTlkEofHrKbd66v TGigYGWdo+ZcdXSsLwerU2di7aCtQ1ImTT7x2Jg7vkepXHl85O8vpCjXcSgvrQaGLa8N xn6g== 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=iJqk1QR5S/H9J1N1BhEfhNoy6FVgb2pwGfBeAfbpZjE7ZdWr5tZOj78SxmLH3VLf4L SoqWQ70zGn05meyK9MsnXO2NIgOkWG0lVeKJXsu/o7YnwjkZvJGf5sjOWJFSvyw8cEdQ wzQJ7jWP9kT2fTdi6yYSUQ6T7xCjE4pkuGP24Lau3dRl1XL563gN6GzKI12lpmWSQxNv 6RywtClU/Hz1BDBT8XtgMhA5houiCu//6g0gc4Nbgtdcm8ClbBngMmxmeHXwWwhipjXR Z1ivnoZDZ2T4PDVvDENgYeRuaiJcDobHeCbE6N7OZM5/N8ua6oTiwaTTcPzmTsTVXFdU 5CDA== 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 v63-20020a638942000000b00513ac9473casi2128215pgd.893.2023.04.06.14.42.15; Thu, 06 Apr 2023 14:42:29 -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 S237929AbjDFVlp (ORCPT + 99 others); Thu, 6 Apr 2023 17:41:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237881AbjDFVlm (ORCPT ); Thu, 6 Apr 2023 17:41:42 -0400 Received: from fudo.makrotopia.org (fudo.makrotopia.org [IPv6:2a07:2ec0:3002::71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64FD19749; Thu, 6 Apr 2023 14:41:41 -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 1pkXMR-0004rW-27; Thu, 06 Apr 2023 23:41:39 +0200 Date: Thu, 6 Apr 2023 22:41:34 +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, Qii Wang , AngeloGioacchino Del Regno , Matthias Brugger , Sam Shih Subject: [PATCH 1/2] i2c: mediatek: add support for MT7981 SoC Message-ID: <5f611059ba664f912c4c5c6cc859acb9b5121e2e.1680817105.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?1762464733165797753?= X-GMAIL-MSGID: =?utf-8?q?1762464733165797753?= 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 --- 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 },