From patchwork Tue Oct 25 07:42:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 10570 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp863177wru; Tue, 25 Oct 2022 00:43:29 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6mjWzDUMCblKP8ikbTRH6n6dMiJzQwR6lq2uSWo37F11mL/fkEKG0NPbD2uOiEaO/olH+y X-Received: by 2002:a05:6a00:2289:b0:56b:b912:4800 with SMTP id f9-20020a056a00228900b0056bb9124800mr11305035pfe.62.1666683809373; Tue, 25 Oct 2022 00:43:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666683809; cv=none; d=google.com; s=arc-20160816; b=CrB1tzzsU23Taj+uaXj0KkC4SwaQcLG5WSCpzGNtVDTrbsEsLEnb3z3dGXD1IAX6xY SRR3NSk/62h81KB+3RPHKGK8ojUHb43VpdhwAqpetAkaPsdVz8Zdo2Jw7rQocdhzkP/h zku+A/DRUlPrYmB4diG4gXXMaxRiIXs2wzTR7m/5WZYUHbb4CcCgToxdajKmDPxjA6lA WXPNyhDcAmdRR3Wnu4jQQdWEy7l9FY/1skOi/Wylpv0oqqqy3+edEmM7Bfg7RLdGYEI4 K44pO2E+KsMg0CvDSvIFC97w5vcG6k9LrqIeN3ie96FRWHyE2gX0dR+F1Hplwrzd72oS lkQA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=t6qFQWHmKSFyBCgF8VJRGuHsK4Ei7rkne6tsfke6P0E=; b=Jf3ario052PJb7hfFTPtYFmyUkt2CxCWnXA+vxItfMTQvyggYw5fwVPDaOK+ao8T3l oM7RnRtf+YmFVKnMoYc/TAXoxLnYJtzNGfPfd9PY/Y5Ly+3WPfP6emsgiwD9DQ+92/6s OmWqm7CA1A+2KnWEnJ9rggYMZqlS5WsxueiX7h9eHvY7d5FuJEb0j+cJTFQILbG/ib4K nVn5hUiXQyUvzxHN7cJCKO1P5aETM1a1uVKBbzRBIYB2OMnJpxZcV+G9tmO8p9C0sMNB URqBWaqwvHnEgTEGZvPQWaWeGjeqAbqElbh2ayywhch5QR0L2z/ftAEhjx35pmrjloP4 8uVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mailerdienst.de header.s=20200217 header.b=hvp3OaNL; 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 bk13-20020a056a02028d00b0043954dec8c1si2072035pgb.615.2022.10.25.00.43.16; Tue, 25 Oct 2022 00:43: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; dkim=pass header.i=@mailerdienst.de header.s=20200217 header.b=hvp3OaNL; 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 S231991AbiJYHmz (ORCPT + 99 others); Tue, 25 Oct 2022 03:42:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231953AbiJYHmr (ORCPT ); Tue, 25 Oct 2022 03:42:47 -0400 Received: from mxout1.routing.net (mxout1.routing.net [IPv6:2a03:2900:1:a::a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C47B515A94C; Tue, 25 Oct 2022 00:42:45 -0700 (PDT) Received: from mxbox3.masterlogin.de (unknown [192.168.10.78]) by mxout1.routing.net (Postfix) with ESMTP id A2A4241A41; Tue, 25 Oct 2022 07:42:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerdienst.de; s=20200217; t=1666683763; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=t6qFQWHmKSFyBCgF8VJRGuHsK4Ei7rkne6tsfke6P0E=; b=hvp3OaNLPnEHPkvGEL6eRRA9k8zTbF/FAYyKsOIh60ozxvTYJ0LwF+VPhCs8fE3IJcVpud vrrdMxch6mdP/czn3jY8VMGqsyB804SyyA42hmrIMJtrxF9i/au67HLGBIxTdqT07ZREGI fDE9khkSOwxBlAYGvB7tPpOOE1PbEY4= Received: from frank-G5.. (fttx-pool-217.61.152.57.bambit.de [217.61.152.57]) by mxbox3.masterlogin.de (Postfix) with ESMTPSA id 654A4360953; Tue, 25 Oct 2022 07:42:42 +0000 (UTC) From: Frank Wunderlich To: linux-mediatek@lists.infradead.org Cc: Frank Wunderlich , Chaotian Jing , Ulf Hansson , Rob Herring , Krzysztof Kozlowski , Matthias Brugger , Wenbin Mei , linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Sam Shih , =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= , Krzysztof Kozlowski Subject: [PATCH v4 1/6] dt-bindings: mmc: mtk-sd: Set clocks based on compatible Date: Tue, 25 Oct 2022 09:42:33 +0200 Message-Id: <20221025074238.18136-2-linux@fw-web.de> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221025074238.18136-1-linux@fw-web.de> References: <20221025074238.18136-1-linux@fw-web.de> MIME-Version: 1.0 X-Mail-ID: cd1a738d-76ed-44e9-8321-d6fe3baf420a X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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?1747644642031520717?= X-GMAIL-MSGID: =?utf-8?q?1747644642031520717?= From: Nícolas F. R. A. Prado The binding was describing a single clock list for all platforms, but that's not really suitable: Most platforms using at least 2 clocks (source, hclk), some of them a third "source_cg". Mt2712 requires an extra 'bus_clk' on some of its controllers, while mt8192 requires 8 clocks. Move the clock definitions inside if blocks that match on the compatibles. I used Patch from Nícolas F. R. A. Prado and modified it to not using "not" statement. Fixes: 59a23395d8aa ("dt-bindings: mmc: Add support for MT8192 SoC") Signed-off-by: Nícolas F. R. A. Prado Signed-off-by: Frank Wunderlich Reviewed-by: Krzysztof Kozlowski --- v2: - add this patch v3: - add blank lines and change "not" to matchlist - reorder entries - make generic first then order alphanumeric - rewrite commit description - drop soc-specific mt8183 - constraints were also set for it above v4: - re-add mt8183 reg-minitems --- .../devicetree/bindings/mmc/mtk-sd.yaml | 123 +++++++++++++----- 1 file changed, 93 insertions(+), 30 deletions(-) diff --git a/Documentation/devicetree/bindings/mmc/mtk-sd.yaml b/Documentation/devicetree/bindings/mmc/mtk-sd.yaml index d8e1e2e9adf2..0cedeb12892d 100644 --- a/Documentation/devicetree/bindings/mmc/mtk-sd.yaml +++ b/Documentation/devicetree/bindings/mmc/mtk-sd.yaml @@ -10,9 +10,6 @@ maintainers: - Chaotian Jing - Wenbin Mei -allOf: - - $ref: mmc-controller.yaml# - properties: compatible: oneOf: @@ -48,27 +45,11 @@ properties: description: Should contain phandle for the clock feeding the MMC controller. minItems: 2 - items: - - description: source clock (required). - - description: HCLK which used for host (required). - - description: independent source clock gate (required for MT2712). - - description: bus clock used for internal register access (required for MT2712 MSDC0/3). - - description: msdc subsys clock gate (required for MT8192). - - description: peripheral bus clock gate (required for MT8192). - - description: AXI bus clock gate (required for MT8192). - - description: AHB bus clock gate (required for MT8192). + maxItems: 7 clock-names: minItems: 2 - items: - - const: source - - const: hclk - - const: source_cg - - const: bus_clk - - const: sys_cg - - const: pclk_cg - - const: axi_cg - - const: ahb_cg + maxItems: 7 interrupts: description: @@ -190,15 +171,97 @@ required: - vmmc-supply - vqmmc-supply -if: - properties: - compatible: - contains: - const: mediatek,mt8183-mmc -then: - properties: - reg: - minItems: 2 +allOf: + - $ref: mmc-controller.yaml# + - if: + properties: + compatible: + enum: + - mediatek,mt2701-mmc + - mediatek,mt6779-mmc + - mediatek,mt6795-mmc + - mediatek,mt7620-mmc + - mediatek,mt7622-mmc + - mediatek,mt7623-mmc + - mediatek,mt8135-mmc + - mediatek,mt8173-mmc + - mediatek,mt8183-mmc + - mediatek,mt8186-mmc + - mediatek,mt8188-mmc + - mediatek,mt8195-mmc + - mediatek,mt8516-mmc + then: + properties: + clocks: + minItems: 2 + items: + - description: source clock + - description: HCLK which used for host + - description: independent source clock gate + clock-names: + minItems: 2 + items: + - const: source + - const: hclk + - const: source_cg + + - if: + properties: + compatible: + contains: + const: mediatek,mt2712-mmc + then: + properties: + clocks: + minItems: 3 + items: + - description: source clock + - description: HCLK which used for host + - description: independent source clock gate + - description: bus clock used for internal register access (required for MSDC0/3). + clock-names: + minItems: 3 + items: + - const: source + - const: hclk + - const: source_cg + - const: bus_clk + + - if: + properties: + compatible: + contains: + const: mediatek,mt8183-mmc + then: + properties: + reg: + minItems: 2 + + - if: + properties: + compatible: + contains: + const: mediatek,mt8192-mmc + then: + properties: + clocks: + items: + - description: source clock + - description: HCLK which used for host + - description: independent source clock gate + - description: msdc subsys clock gate + - description: peripheral bus clock gate + - description: AXI bus clock gate + - description: AHB bus clock gate + clock-names: + items: + - const: source + - const: hclk + - const: source_cg + - const: sys_cg + - const: pclk_cg + - const: axi_cg + - const: ahb_cg unevaluatedProperties: false