From patchwork Tue Jan 31 14:04:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balsam CHIHI X-Patchwork-Id: 50881 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2770647wrn; Tue, 31 Jan 2023 06:09:40 -0800 (PST) X-Google-Smtp-Source: AK7set/9dLzRRVGnD8mpffRqi9TVKidcqJSU9uYzAbLkttvCv8Iwoo9Lig9pIKSTq5CpBp53TYOD X-Received: by 2002:a17:902:cf50:b0:196:77fd:ac00 with SMTP id e16-20020a170902cf5000b0019677fdac00mr7314668plg.22.1675174180132; Tue, 31 Jan 2023 06:09:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675174180; cv=none; d=google.com; s=arc-20160816; b=a5AU/1P45HqqADaYuwt0dzEx/ey5A8ucgu7h3HsY2zS+1uUaGsJAX/tosMmr+A5tyP gPXPGrm2XA0zyrheCRc8e9vjKl9B5dGBEFVSayoRpCiYnzWIoueJ+2zclZFLeN6mHN2a D0VfVHKfRgtF9RazKwJZBfiu6+D3Z3cyRqHfzJO28c9NAYc930AT19eQkCStuPmI5Gwm VUqS01i2G1rIfFtk5ON1Wh8xE2OE7neA1Yr2YNTsMN7XIY7R04rvV7TksOl4tGHI8TiF JT0McuRLbS+aKgD76wBDV17tkac1uiwbmbEetMUkd8tt4cI9NMAZh2Vkwi+PB6YBrIe9 3Yww== 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=22OuGl1Rl5k/omloIRKBcTeCPAl/PTnUyUtJ/lKNdiM=; b=aeFIW+lgTHB1+87PbHH4u/aiADKV8VxXaE9XGfBVXOviZIu48JnuLJaFCpbahoz/Xj 9iAzc+wyV+Lof4Jjfn+oXtet3bM4LKXzYBHNfUoR+KYX43UVuOpDKxm736SVoiEMO9Bc z9S6NZB1i5Al7P8ryos9/xoCttYuVtgwOQB+zbJBu7xnyXRiTFJS7zthJaIhApdvJaF+ DG+u9bARh5ME+X2QpNM47k36YF+cPk+f3ceaSzDH3n0O5h+cDxgwbZN+VymyauKb0qcT fZoWAaHLeZbC/leu6NEiIpsb06iHTVr1n8UEPzELm4CUqhOtU8NPr4UzNhD/anpn3BWF hpag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b="if/PCWHw"; 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 w23-20020a639357000000b004771126e2f7si16094719pgm.142.2023.01.31.06.09.19; Tue, 31 Jan 2023 06:09:40 -0800 (PST) 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=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b="if/PCWHw"; 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 S232446AbjAaOEx (ORCPT + 99 others); Tue, 31 Jan 2023 09:04:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230213AbjAaOEo (ORCPT ); Tue, 31 Jan 2023 09:04:44 -0500 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77C0A61BD for ; Tue, 31 Jan 2023 06:04:43 -0800 (PST) Received: by mail-wr1-x42e.google.com with SMTP id r2so14294817wrv.7 for ; Tue, 31 Jan 2023 06:04:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=22OuGl1Rl5k/omloIRKBcTeCPAl/PTnUyUtJ/lKNdiM=; b=if/PCWHwByy4LBuPHrr9Kzs1K4sedSNOpWUedCcfI3eoKRddTZm7EWjEuc5LqcmjBn lvCsVQvpr6idngYZ0gqKrzcWPPrv/DzbYKkUqgDpWR8cSXCYTA34CfZInXIoGI3TaV9s ShwAOkL30yfCyIUp/LcSq0yK7r/mSlsX/4wotibK9TgekBfqEHcQY6VHb9V6wTC9btbl AU4Q13gbVmsj4NIYBjxVDFWXQ+TqJu1q6Eaj2CuBgj1GNyHfIyiHqvzR0f1jLm53RzCU BSmvRxdOOPBnRX2N60lq8g46hvLR7qzkNZmxuZgXERjDMiIfxM7+4owadOWJWHoeBFfV 7WWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=22OuGl1Rl5k/omloIRKBcTeCPAl/PTnUyUtJ/lKNdiM=; b=h4J/EuBghe8cn4ku54vjMS5tYN2tMqYLk4hK1fltYYw6XqOBb+0kE6dSvRjOmouqxy jmfhkWF7zwmerxyM34KDQe9nHwfb0oqNGSM5lFe+IIJNB3JQP4LeuqxP7+CF7qeDL73s Vv4UAU6jxyHWzxnFjdf8OVinaxGG6KLdbRMFvvbnx3AerQ8CkqJtuXXNnlpBQndqMZnu blGha7pGPpl27AsJTIJ0paad1hIlOLTZ8cr/5YzTU7AjzmYTGGwslw0VZsF8NumkVs/a YOx3tZb++GJ2flgNYBXw8bQopkpnrlQyfyt6D7L06jSe/4sn6Niz4ZsV8eykvqKn93dD o2ow== X-Gm-Message-State: AO0yUKVKTkz07uunsbz2eHW136KuDWeIReHc4S6FIW5BSkDdPBipVviu 4PSMo8F793CEPJGmFP9p2/PTbg== X-Received: by 2002:a5d:658d:0:b0:2bf:ae43:108d with SMTP id q13-20020a5d658d000000b002bfae43108dmr25647204wru.28.1675173881683; Tue, 31 Jan 2023 06:04:41 -0800 (PST) Received: from localhost.localdomain (laubervilliers-657-1-248-155.w90-24.abo.wanadoo.fr. [90.24.137.155]) by smtp.gmail.com with ESMTPSA id l15-20020a5d6d8f000000b002bfb37497a8sm15760650wrs.31.2023.01.31.06.04.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Jan 2023 06:04:41 -0800 (PST) From: bchihi@baylibre.com To: daniel.lezcano@linaro.org, angelogioacchino.delregno@collabora.com, rafael@kernel.org, amitk@kernel.org, rui.zhang@intel.com, matthias.bgg@gmail.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, rdunlap@infradead.org, ye.xingchen@zte.com.cn, p.zabel@pengutronix.de Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, khilman@baylibre.com, james.lo@mediatek.com, rex-bc.chen@mediatek.com Subject: [PATCH v3] dt-bindings: thermal: mediatek: Add LVTS thermal controllers Date: Tue, 31 Jan 2023 15:04:39 +0100 Message-Id: <20230131140439.600164-1-bchihi@baylibre.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230126161048.94089-1-bchihi@baylibre.com> References: <20230126161048.94089-1-bchihi@baylibre.com> MIME-Version: 1.0 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?1756547441273475742?= X-GMAIL-MSGID: =?utf-8?q?1756547441273475742?= From: Balsam CHIHI Add LVTS thermal controllers dt-binding definition for mt8195. Signed-off-by: Balsam CHIHI --- Changelog: v3: - Fixed subject prefix - Fixed licenses GPL-2.0-only OR BSD-2-Clause to GPL-2.0 OR MIT (to match DT) - Fixed matching dt-binding file names v2: - Fixed subject prefix - Fixed licenses GPL-2.0+ to GPL-2.0 - Added dual licenses --- --- .../thermal/mediatek,lvts-thermal.yaml | 107 ++++++++++++++++++ .../thermal/mediatek,lvts-thermal.h | 19 ++++ 2 files changed, 126 insertions(+) create mode 100644 Documentation/devicetree/bindings/thermal/mediatek,lvts-thermal.yaml create mode 100644 include/dt-bindings/thermal/mediatek,lvts-thermal.h diff --git a/Documentation/devicetree/bindings/thermal/mediatek,lvts-thermal.yaml b/Documentation/devicetree/bindings/thermal/mediatek,lvts-thermal.yaml new file mode 100644 index 000000000000..5fa5c7a1a417 --- /dev/null +++ b/Documentation/devicetree/bindings/thermal/mediatek,lvts-thermal.yaml @@ -0,0 +1,107 @@ +# SPDX-License-Identifier: (GPL-2.0 OR MIT) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/thermal/mediatek,lvts-thermal.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: MediaTek SoC Low Voltage Thermal Sensor (LVTS) + +maintainers: + - Balsam CHIHI + +description: | + LVTS is a thermal management architecture composed of three subsystems, + a Sensing device - Thermal Sensing Micro Circuit Unit (TSMCU), + a Converter - Low Voltage Thermal Sensor converter (LVTS), and + a Digital controller (LVTS_CTRL). + +properties: + compatible: + enum: + - mediatek,mt8195-lvts-ap + - mediatek,mt8195-lvts-mcu + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + maxItems: 1 + + resets: + maxItems: 1 + description: LVTS reset for clearing temporary data on AP/MCU. + + nvmem-cells: + minItems: 1 + items: + - description: Calibration eFuse data 1 for LVTS + - description: Calibration eFuse data 2 for LVTS + + nvmem-cell-names: + minItems: 1 + items: + - const: lvts-calib-data-1 + - const: lvts-calib-data-2 + + "#thermal-sensor-cells": + const: 1 + +required: + - compatible + - reg + - interrupts + - clocks + - resets + - nvmem-cells + - nvmem-cell-names + - "#thermal-sensor-cells" + +additionalProperties: false + +examples: + - | + #include + #include + #include + #include + + soc { + #address-cells = <2>; + #size-cells = <2>; + + lvts_mcu: thermal-sensor@11278000 { + compatible = "mediatek,mt8195-lvts-mcu"; + reg = <0 0x11278000 0 0x1000>; + interrupts = ; + clocks = <&infracfg_ao CLK_INFRA_AO_THERM>; + resets = <&infracfg_ao MT8195_INFRA_RST4_THERM_CTRL_MCU_SWRST>; + nvmem-cells = <&lvts_efuse_data1 &lvts_efuse_data2>; + nvmem-cell-names = "lvts-calib-data-1", "lvts-calib-data-2"; + #thermal-sensor-cells = <1>; + }; + }; + + thermal_zones: thermal-zones { + cpu0-thermal { + polling-delay = <1000>; + polling-delay-passive = <250>; + thermal-sensors = <&lvts_mcu MT8195_MCU_LITTLE_CPU0>; + + trips { + cpu0_alert: trip-alert { + temperature = <85000>; + hysteresis = <2000>; + type = "passive"; + }; + + cpu0_crit: trip-crit { + temperature = <100000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + }; + }; diff --git a/include/dt-bindings/thermal/mediatek,lvts-thermal.h b/include/dt-bindings/thermal/mediatek,lvts-thermal.h new file mode 100644 index 000000000000..ca1ef29a8fee --- /dev/null +++ b/include/dt-bindings/thermal/mediatek,lvts-thermal.h @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: (GPL-2.0 OR MIT) */ +/* + * Copyright (c) 2023 MediaTek Inc. + * Author: Balsam CHIHI + */ + +#ifndef __MEDIATEK_LVTS_DT_H +#define __MEDIATEK_LVTS_DT_H + +#define MT8195_MCU_BIG_CPU0 0 +#define MT8195_MCU_BIG_CPU1 1 +#define MT8195_MCU_BIG_CPU2 2 +#define MT8195_MCU_BIG_CPU3 3 +#define MT8195_MCU_LITTLE_CPU0 4 +#define MT8195_MCU_LITTLE_CPU1 5 +#define MT8195_MCU_LITTLE_CPU2 6 +#define MT8195_MCU_LITTLE_CPU3 7 + +#endif /* __MEDIATEK_LVTS_DT_H */