From nobody Fri Sep 20 20:38:06 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB6A1C77B70 for ; Mon, 10 Apr 2023 16:19:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230258AbjDJQTc (ORCPT ); Mon, 10 Apr 2023 12:19:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229692AbjDJQT3 (ORCPT ); Mon, 10 Apr 2023 12:19:29 -0400 Received: from fudo.makrotopia.org (fudo.makrotopia.org [IPv6:2a07:2ec0:3002::71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2748131; Mon, 10 Apr 2023 09:19:28 -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 1pluEp-0004vO-0N; Mon, 10 Apr 2023 18:19:27 +0200 Date: Mon, 10 Apr 2023 17:19:21 +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 1/2] dt-bindings: i2c: i2c-mt65xx: add MediaTek MT7981 SoC Message-ID: <4ad55cb4248db60111c20d833631a65854fa1d02.1680857025.git.daniel@makrotopia.org> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add compatible string for the I2C controllers found in the MediaTek MT7981 SoC. Signed-off-by: Daniel Golle Acked-by: Krzysztof Kozlowski Reviewed-by: AngeloGioacchino Del Regno --- Documentation/devicetree/bindings/i2c/i2c-mt65xx.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/i2c/i2c-mt65xx.yaml b/Docume= ntation/devicetree/bindings/i2c/i2c-mt65xx.yaml index 685da4df688d6..fda0467cdd954 100644 --- a/Documentation/devicetree/bindings/i2c/i2c-mt65xx.yaml +++ b/Documentation/devicetree/bindings/i2c/i2c-mt65xx.yaml @@ -23,6 +23,7 @@ properties: - const: mediatek,mt6577-i2c - const: mediatek,mt6589-i2c - const: mediatek,mt7622-i2c + - const: mediatek,mt7981-i2c - const: mediatek,mt7986-i2c - const: mediatek,mt8168-i2c - const: mediatek,mt8173-i2c --=20 2.40.0 From nobody Fri Sep 20 20:38:06 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0B6BC77B73 for ; Mon, 10 Apr 2023 16:19:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230259AbjDJQT4 (ORCPT ); Mon, 10 Apr 2023 12:19:56 -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: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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: Alexandre Mergnat Reviewed-by: AngeloGioacchino Del Regno --- 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-mt65x= x.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 = =3D { .max_dma_support =3D 33, }; =20 +static const struct mtk_i2c_compatible mt7981_compat =3D { + .regs =3D mt_i2c_regs_v3, + .pmic_i2c =3D 0, + .dcm =3D 0, + .auto_restart =3D 1, + .aux_len_reg =3D 1, + .timing_adjust =3D 1, + .dma_sync =3D 1, + .ltiming_adjust =3D 1, + .max_dma_support =3D 33 +}; + static const struct mtk_i2c_compatible mt7986_compat =3D { .quirks =3D &mt7622_i2c_quirks, .regs =3D mt_i2c_regs_v1, @@ -516,6 +528,7 @@ static const struct of_device_id mtk_i2c_of_match[] =3D= { { .compatible =3D "mediatek,mt6577-i2c", .data =3D &mt6577_compat }, { .compatible =3D "mediatek,mt6589-i2c", .data =3D &mt6589_compat }, { .compatible =3D "mediatek,mt7622-i2c", .data =3D &mt7622_compat }, + { .compatible =3D "mediatek,mt7981-i2c", .data =3D &mt7981_compat }, { .compatible =3D "mediatek,mt7986-i2c", .data =3D &mt7986_compat }, { .compatible =3D "mediatek,mt8168-i2c", .data =3D &mt8168_compat }, { .compatible =3D "mediatek,mt8173-i2c", .data =3D &mt8173_compat }, --=20 2.40.0