Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp5248363rwi; Sun, 23 Oct 2022 02:44:11 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4RkOjkXN6mM7+qUidIFwGgPtzk2omgzoTol5QmT/3AjsDjFLB6WQH8Jzxnk4Z8N57RB6I5 X-Received: by 2002:a63:1b58:0:b0:45f:e7ba:a223 with SMTP id b24-20020a631b58000000b0045fe7baa223mr22668406pgm.548.1666518250766; Sun, 23 Oct 2022 02:44:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666518250; cv=none; d=google.com; s=arc-20160816; b=zIgaDHpFdPEo3CF5q4uHUhLzdN2M1bWroP2JJbPagBtYTGo42rmErDRPlhi/TstQ/8 SsVmFY9DZcGWJ/fKN2ptWfT9n61I6lc2gZJbtl/uAGTnatzyN5N+sdClm/JKekL62ruL scq9dmBfp8v+ULbG+/Sg5/uCOLhF/7hppAhcRJAMJQeTDdVud0lIZp4WTR6JJVBuOb4O UetsKyukna/Usa8E6FCsAqcAwte5yoF+Wju+XrVeDIUFoCOMOtCCYQsarScLmqPbolYN w6jTfmyeLO+DgYLD3NjF4N0Xo+kVi9Cm5YGA0rTtwznJ9m0xRPhCF9el8qtFeTUY9gPI 3kpQ== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f3-20020aa78b03000000b00563798cf40dsi26333874pfd.224.2022.10.23.02.43.54; Sun, 23 Oct 2022 02:44:10 -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?q?N=C3=ADcolas=20F=2E=20R=2E=20A=2E=20Prado?= 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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 --- 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 -- 2.34.1