From patchwork Thu Nov 16 13:13:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 165800 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp3200624vqg; Thu, 16 Nov 2023 05:14:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IHPyRtt4u5FG7ITHMTQeQz8QdNhVO/uX2WBEo/Ro90mTfXEzKipsEGLGZvJnkI7cZoL23b5 X-Received: by 2002:a05:6a20:c901:b0:186:5a25:a3f1 with SMTP id gx1-20020a056a20c90100b001865a25a3f1mr12745111pzb.37.1700140454985; Thu, 16 Nov 2023 05:14:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700140454; cv=none; d=google.com; s=arc-20160816; b=q2c70WxFtgN82kxC8rablXBkMoOelAF5GT/IwbKDZ1XFVw4ny3chBas9P+xcz5im50 qZC5ks3menZGAr0kLgwpyXunemXx8CkJXAjAQd5b7B9HggFV7OV6xz6hs2mjQohzM25G KsXX4kLwxmGkFhKBj1IpnliYi8JI0hc4s4+ypaKYXATNNIwcjNugLX7WOTwDPT17MBn4 b1L/jh13Vsboc6DEczoJC4y2mLzlaV1qJsQDaFfotE22eCy34iU1SeZELRfwYNHo/ZBP rdA+iE0+w/yDKttPFh02RykLVyKuBir/g0Q4Vsj5fGpzftV5f0s55YEUGc7GtLUgrc2k K7rQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=Fnxhr1dk/vfohyQfMfgOpH3tTQBBu2nuppfYXXpJ6wA=; fh=ap8eLx6BQJtDE026JG5LL8SKerXNL3ekeXb9sFidSqs=; b=VbdH7/w03GJ6OZx+N1QoQr/gWE1L88VTueIqrMJP8pzfBGCsBQPJMGrfAGYKQHqVUJ uYLee+7ZjIfkjsdMm/AYCFrxJD60R9UlR7UJE0F76pifnFMIVglCB7lChhACkqN1EmF/ 4ctuddWSpXZbcwQwu4KHS8TR9hBMMQz5VscaCEscshPqBaKlJXLgj1er/9cSx4PNo5E/ 7UnT8cuRCC+b6TwmwwvciQbcarm4jVtvWJ72ECKd/AQYxjdGBSnCwpKIEut2bUteWKTI ULm0n5RcbG54q3nhTmnAcxIYdAM55AP8eeI1G9E/MN28skGdIrTKLk5URE8AJV4s9X1L BPzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=H1oUfAE+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id h11-20020a65404b000000b005b88dfa676esi409014pgp.158.2023.11.16.05.14.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 05:14:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=H1oUfAE+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 5685180FCE6E; Thu, 16 Nov 2023 05:14:12 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230492AbjKPNNm (ORCPT + 29 others); Thu, 16 Nov 2023 08:13:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235695AbjKPNNg (ORCPT ); Thu, 16 Nov 2023 08:13:36 -0500 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A85610D5; Thu, 16 Nov 2023 05:13:25 -0800 (PST) Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-9c603e2354fso152904866b.1; Thu, 16 Nov 2023 05:13:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700140404; x=1700745204; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Fnxhr1dk/vfohyQfMfgOpH3tTQBBu2nuppfYXXpJ6wA=; b=H1oUfAE+1QrnehJZkBuHjvmsPK0HCTA4vu6rQn5VTwUWdD1PpFiQ94xyv04e6glrG5 YgV0QkyPvjI8fC45JIR959oN5lP3t49Jn450YXF67UOHpIHlYwK3zfN82UtsKHAA2zrG NEcKVmjpVG8yMqpOtSGV81qwcNvptg8p6Ym8pGTeTNESS8ih96vF4On/izYsmGQde4a+ f8boRsbt3eASmZJQXUipad7jekHe7ZIgplQ3Z9h623JVwfNVAqw6Dv2DP9PNgVt8VGFL Ub9lCgqPrDCbzVC0/d0At8Jj8GBzsE2nPuhPQwrtHDuOPzudPE8gnZ1dijBn7pYpdrFw iTsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700140404; x=1700745204; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Fnxhr1dk/vfohyQfMfgOpH3tTQBBu2nuppfYXXpJ6wA=; b=ZIbfSl+NEZiNWxeAXSKY+dO8FhzP4mjvtA52NKCrX2W+duKXeMasxxc+LsZKZtqA6G Z8BC9SRTEpDXMm+UNmYSAXzbNS84gd5OBl0sXdtWrcPFPOX9IX8wCGIW+tRDgk67hu/i Xr+B6gfK0DUI4cFmw9FTW24iHRGBtOdpjPjfXHJZnzPtDAHVYCFQs2Cn9bKv4YmDP8vS w7RHaqVf8D5YFRjqwpV3xPTtcqDXWkjpmDJf8+zT2/uj1kZfZ9Mogta6J5jcXdUL+atq ZDeYyS0mDCfeT3Y3KTJqp0yiuTktdV9EdIZWpG5khmiZzY8MnRT5YLdelfCKnol5TNzb YjYg== X-Gm-Message-State: AOJu0Yx6Th+dAYXJVCpRTl0khh0HSNJrlaxrxMVd5lwInXNE2YUQf4B6 ff0TNtvcK7/f5N6YKx/bmMs= X-Received: by 2002:a17:907:75d7:b0:9b2:be5e:3674 with SMTP id jl23-20020a17090775d700b009b2be5e3674mr1401307ejc.36.1700140403737; Thu, 16 Nov 2023 05:13:23 -0800 (PST) Received: from localhost.lan (031011218106.poznan.vectranet.pl. [31.11.218.106]) by smtp.gmail.com with ESMTPSA id u10-20020a170906408a00b009e5d30422ebsm8412710ejj.101.2023.11.16.05.13.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 05:13:23 -0800 (PST) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno Cc: "Rafael J . Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Sascha Hauer , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH V2] dt-bindings: thermal: convert Mediatek Thermal to the json-schema Date: Thu, 16 Nov 2023 14:13:16 +0100 Message-Id: <20231116131316.5897-1-zajec5@gmail.com> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 16 Nov 2023 05:14:12 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782721999301504579 X-GMAIL-MSGID: 1782726477965040372 From: Rafał Miłecki This helps validating DTS files. Signed-off-by: Rafał Miłecki --- V2: Add "maintainers" .../bindings/thermal/mediatek-thermal.txt | 52 --------- .../bindings/thermal/mediatek-thermal.yaml | 101 ++++++++++++++++++ 2 files changed, 101 insertions(+), 52 deletions(-) delete mode 100644 Documentation/devicetree/bindings/thermal/mediatek-thermal.txt create mode 100644 Documentation/devicetree/bindings/thermal/mediatek-thermal.yaml diff --git a/Documentation/devicetree/bindings/thermal/mediatek-thermal.txt b/Documentation/devicetree/bindings/thermal/mediatek-thermal.txt deleted file mode 100644 index ac39c7156fde..000000000000 --- a/Documentation/devicetree/bindings/thermal/mediatek-thermal.txt +++ /dev/null @@ -1,52 +0,0 @@ -* Mediatek Thermal - -This describes the device tree binding for the Mediatek thermal controller -which measures the on-SoC temperatures. This device does not have its own ADC, -instead it directly controls the AUXADC via AHB bus accesses. For this reason -this device needs phandles to the AUXADC. Also it controls a mux in the -apmixedsys register space via AHB bus accesses, so a phandle to the APMIXEDSYS -is also needed. - -Required properties: -- compatible: - - "mediatek,mt8173-thermal" : For MT8173 family of SoCs - - "mediatek,mt2701-thermal" : For MT2701 family of SoCs - - "mediatek,mt2712-thermal" : For MT2712 family of SoCs - - "mediatek,mt7622-thermal" : For MT7622 SoC - - "mediatek,mt7981-thermal", "mediatek,mt7986-thermal" : For MT7981 SoC - - "mediatek,mt7986-thermal" : For MT7986 SoC - - "mediatek,mt8183-thermal" : For MT8183 family of SoCs - - "mediatek,mt8365-thermal" : For MT8365 family of SoCs - - "mediatek,mt8516-thermal", "mediatek,mt2701-thermal : For MT8516 family of SoCs -- reg: Address range of the thermal controller -- interrupts: IRQ for the thermal controller -- clocks, clock-names: Clocks needed for the thermal controller. required - clocks are: - "therm": Main clock needed for register access - "auxadc": The AUXADC clock -- mediatek,auxadc: A phandle to the AUXADC which the thermal controller uses -- mediatek,apmixedsys: A phandle to the APMIXEDSYS controller. -- #thermal-sensor-cells : Should be 0. See Documentation/devicetree/bindings/thermal/thermal-sensor.yaml for a description. - -Optional properties: -- resets: Reference to the reset controller controlling the thermal controller. -- nvmem-cells: A phandle to the calibration data provided by a nvmem device. If - unspecified default values shall be used. -- nvmem-cell-names: Should be "calibration-data" - -Example: - - thermal: thermal@1100b000 { - #thermal-sensor-cells = <1>; - compatible = "mediatek,mt8173-thermal"; - reg = <0 0x1100b000 0 0x1000>; - interrupts = <0 70 IRQ_TYPE_LEVEL_LOW>; - clocks = <&pericfg CLK_PERI_THERM>, <&pericfg CLK_PERI_AUXADC>; - clock-names = "therm", "auxadc"; - resets = <&pericfg MT8173_PERI_THERM_SW_RST>; - reset-names = "therm"; - mediatek,auxadc = <&auxadc>; - mediatek,apmixedsys = <&apmixedsys>; - nvmem-cells = <&thermal_calibration_data>; - nvmem-cell-names = "calibration-data"; - }; diff --git a/Documentation/devicetree/bindings/thermal/mediatek-thermal.yaml b/Documentation/devicetree/bindings/thermal/mediatek-thermal.yaml new file mode 100644 index 000000000000..faeb4d6c6dd4 --- /dev/null +++ b/Documentation/devicetree/bindings/thermal/mediatek-thermal.yaml @@ -0,0 +1,101 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/thermal/mediatek-thermal.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Mediatek Thermal + +maintainers: + - Sascha Hauer + +description: > + This describes the device tree binding for the Mediatek thermal controller + which measures the on-SoC temperatures. This device does not have its own ADC, + instead it directly controls the AUXADC via AHB bus accesses. For this reason + this device needs phandles to the AUXADC. Also it controls a mux in the + apmixedsys register space via AHB bus accesses, so a phandle to the APMIXEDSYS + is also needed. + +allOf: + - $ref: thermal-sensor.yaml# + +properties: + compatible: + enum: + - mediatek,mt2701-thermal + - mediatek,mt2712-thermal + - mediatek,mt7622-thermal + - mediatek,mt7981-thermal + - mediatek,mt7986-thermal + - mediatek,mt8173-thermal + - mediatek,mt8183-thermal + - mediatek,mt8365-thermal + - mediatek,mt8516-thermal + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + items: + - description: Main clock needed for register access + - description: The AUXADC clock + + clock-names: + items: + - const: therm + - const: auxadc + + mediatek,auxadc: + $ref: /schemas/types.yaml#/definitions/phandle + description: A phandle to the AUXADC which the thermal controller uses + + mediatek,apmixedsys: + $ref: /schemas/types.yaml#/definitions/phandle + description: A phandle to the APMIXEDSYS controller + + resets: Reference to the reset controller controlling the thermal controller. + + nvmem-cells: + items: + - description: > + NVMEM cell with EEPROMA phandle to the calibration data provided by an + NVMEM device. If unspecified default values shall be used. + + nvmem-cell-names: + items: + - const: calibration-data + +unevaluatedProperties: false + +required: + - reg + - interrupts + - clocks + - clock-names + - mediatek,auxadc + - mediatek,apmixedsys + +examples: + - | + #include + #include + #include + + thermal@1100b000 { + compatible = "mediatek,mt8173-thermal"; + reg = <0x1100b000 0x1000>; + interrupts = <0 70 IRQ_TYPE_LEVEL_LOW>; + clocks = <&pericfg CLK_PERI_THERM>, <&pericfg CLK_PERI_AUXADC>; + clock-names = "therm", "auxadc"; + resets = <&pericfg MT8173_PERI_THERM_SW_RST>; + reset-names = "therm"; + mediatek,auxadc = <&auxadc>; + mediatek,apmixedsys = <&apmixedsys>; + nvmem-cells = <&thermal_calibration_data>; + nvmem-cell-names = "calibration-data"; + #thermal-sensor-cells = <1>; + };