From patchwork Sun Oct 23 09:12:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 7962 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1537650wrr; Sun, 23 Oct 2022 02:15:38 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6PEatkMsH24FFtepWFRkdCNAPLxU70ODZMdWzLHHbTNacMOJ6ZKVRG8bbYeqLyy3YgLLMa X-Received: by 2002:a65:6bc4:0:b0:439:8ff8:e2e1 with SMTP id e4-20020a656bc4000000b004398ff8e2e1mr23672316pgw.91.1666516538133; Sun, 23 Oct 2022 02:15:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666516538; cv=none; d=google.com; s=arc-20160816; b=nUGBsFXo1Holh2yzl0L7+Jzn8r3Wr6MyI2ZODDjg8k1mL3FAZu9P3two8WEJ7lxMwQ 44Io/7I+4Tyy41tQ93S/PO7IGc6MSiA5yOJfrImkUa/keRbeTMcbuYXHUkgYVImfApw9 /SZdirF4h+9zpFrvEUW7PQxVVmLWJ94tk1KmAuX3T0BtCucNFAFvRBec0GWkm6wY6chN hb3hnxEMquLKJf7+wqNn8d2foGN7/86dnySfF/hxrpY0ikjutKrYWxhCIaeH1/F6L53a QsvYj9BQvglqnC3qn1klPTaw2F7DxUHqKKFsBCh85CAJEdSJnDepznTaZ47hFMyqRyC6 QIdw== 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=4VritE+ybpU07rveA4R3SYkkmaTESv58T7iG6/ydmr8=; b=P0ROu9YHuc/HFmK3qNFVqouLYMBL0XWEpbqBPB9dBQJYSSo7pTFfTBbrZGVfd7BlME qnzI/7zn2HAH6M8rrznN2JFrhDkRE/8cxcphBC3LpaBQpyyJ6+xD9NoIDKXOJH78aj8W h6V5NESIoygofuBQ4VNyRSPRu2jgkrszG1u9X91xUYxwkTjEiQ/+53Z8Sj3kzwE5J7CM z7tLCgl1lDrRN0PoNaujzzmqV1jLWGqBptgAIrP/RPhj2RHa+l+7gXTqV9R7uDSYGuUG wbmW/2K4v9Ao9dsBQiIYeTgqRvi2myLRPEaUiwJ3zGBp8YGHroPEcjdt62bw+KczTSIS B0Cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mailerdienst.de header.s=20200217 header.b=SNSTWeYb; 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 e14-20020a63ee0e000000b004393f624553si32699106pgi.864.2022.10.23.02.15.25; Sun, 23 Oct 2022 02:15:38 -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=SNSTWeYb; 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 S230089AbiJWJNc (ORCPT + 99 others); Sun, 23 Oct 2022 05:13:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230035AbiJWJNP (ORCPT ); Sun, 23 Oct 2022 05:13:15 -0400 Received: from mxout3.routing.net (mxout3.routing.net [IPv6:2a03:2900:1:a::8]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4362172B75; Sun, 23 Oct 2022 02:13:12 -0700 (PDT) Received: from mxbox2.masterlogin.de (unknown [192.168.10.89]) by mxout3.routing.net (Postfix) with ESMTP id A3A2F60553; Sun, 23 Oct 2022 09:13:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerdienst.de; s=20200217; t=1666516390; 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=4VritE+ybpU07rveA4R3SYkkmaTESv58T7iG6/ydmr8=; b=SNSTWeYb/eV/JIYBlg57eIomzZIwVjBbkbeWKybl4nyzT6YzkpbWdM+s3ztyJGU7j4+oSQ Qfd6J4+4ZMVqDkUdloaGc/C/MMCMUQ2LVEWUTCXgY+pTkhssjLXeU38gpD2S9ouLxtRm4R PLVs5K7M55g36aSahPJmr9S9vm1/z/w= Received: from frank-G5.. (fttx-pool-80.245.79.234.bambit.de [80.245.79.234]) by mxbox2.masterlogin.de (Postfix) with ESMTPSA id D267310009F; Sun, 23 Oct 2022 09:13:09 +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, =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= Subject: [PATCH v3 2/7] dt-bindings: mmc: mtk-sd: Set clocks based on compatible Date: Sun, 23 Oct 2022 11:12:42 +0200 Message-Id: <20221023091247.70586-3-linux@fw-web.de> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221023091247.70586-1-linux@fw-web.de> References: <20221023091247.70586-1-linux@fw-web.de> MIME-Version: 1.0 X-Mail-ID: 26f9b6cb-7d41-488e-9bd4-dd6e7e6caf6b 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 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?1747469245587141911?= X-GMAIL-MSGID: =?utf-8?q?1747469245587141911?= 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 --- .../devicetree/bindings/mmc/mtk-sd.yaml | 113 +++++++++++++----- 1 file changed, 83 insertions(+), 30 deletions(-) diff --git a/Documentation/devicetree/bindings/mmc/mtk-sd.yaml b/Documentation/devicetree/bindings/mmc/mtk-sd.yaml index 3cbf0208f1b4..31bb6dc329d2 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: @@ -49,27 +46,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: @@ -191,15 +172,87 @@ 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,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