From patchwork Tue May 24 15:25:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Bailon X-Patchwork-Id: 12860293 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5465DC433F5 for ; Tue, 24 May 2022 15:29:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=RrF6waysaN0KIOsewGwq8zE3bSRRGqchwVddYVjvzJk=; b=1J/zRxNMqBUhIF 5uyjs2btYebo4tnClV4EIVFdtlmaz7wqu+5j1yZn4GWRbRMdTsCKYPAudZ3xzjzMQP39NdaDXeFfr cCLC11W/rMXqe8h/k7dH+0I5q2OyU1CIauOgtXBG1SBtT7s5StHQ97fSn7oMXd0tJxQS9W/KzJl6U A4E4k8uwXG5fYQD0kUxXAuHCozsF5q0xOPEXk0rhoX3NBjg/NBHdN/bD2ngXiQCo8AddtQc2gmQhu uHTTUDb+K4TmnNcN67DgFMk9JG8P9JSEmHBUTj+qaK8KxOEp+n1eT40hUSklHwDYEnIqiRyyXc4qU kKcU2+mld1F2fpRYHAaw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ntWRy-008RcE-H0; Tue, 24 May 2022 15:27:58 +0000 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ntWRs-008Ra4-EZ for linux-arm-kernel@lists.infradead.org; Tue, 24 May 2022 15:27:55 +0000 Received: by mail-wm1-x32d.google.com with SMTP id i20-20020a05600c355400b0039456976dcaso1283061wmq.1 for ; Tue, 24 May 2022 08:27:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=R2w5tfWVkkqH5erhNFYiJNGO89mooqJ/f3WebpkD9pw=; b=5py3jx843dbBAQDoG6BUKJpJcOTFw+CyMGMpuJgnlNrBcWlZpHxJmmJUtvHPr945ky hsj8JuSMUygANtZlpSXU764z9bPAqKG0Qc1CL4jTKg8by7rHxuyS67Iqa0+wLLGIQf72 UqghYJAbnGs/86iKbUQmqk5ICY7XsrMsSh/kRZZCCbCyMJezX0iVzuMr80ARgNWnF4OU nW4bUb8s9cLnE8R43AD6oCbXTuxpnL29o3aOEsVZ8VgAulULWmYIOcXBjLDPIixTIu6r IRtZU3fjqT9P8yv3Hj88apg5bPUTs+Z1corNyK40MhCbqe3UxoIhMaEcWjN5k0Ufo7Nd owzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=R2w5tfWVkkqH5erhNFYiJNGO89mooqJ/f3WebpkD9pw=; b=dM8k98pG1rG7PwMPX0xUx9u54aLTdwlV9HQ5A5ZiNDF3u+RBD9A0zi1FlmJVyYSUhr YLsNGZK1ayoaYoret1ztH3LIubK8/tanjSJTQwjV+j3HiXbnI2DYlQBAFtX925fMqH/G PeLy1WhNfnB943JYc7fayBnyZ/DC/Fm7Z4LhsFeZZ9DHg+QNJNyU0bTFv3OUpqT8/uNR 7OXlksokBpk+NlNu/bVRuJGPdUGcVIAhz/GLBLLUG8LFI50qo66j0rdd3x8RZ0oLbufb DXe6L0s08lJ/iqCm3PMdheCY5K9w1YCCZVmOWhgfV/lqUZRCItqWVCWiAHUwcH2nx5WJ RlJg== X-Gm-Message-State: AOAM532U+67euGPbIM3LLo0rvIoxsd2l/0H9PP0Tsfa05QPicKHJiiaI VxAlkrz/9JrJRsYBKhcuyDKIqg== X-Google-Smtp-Source: ABdhPJzJi0LPjrECz8V5+Pr2ftapF3zqFkYd3LMw0KNtjeDJ6jhgUU1AjknD4REIAnLLUcgUcLIG0w== X-Received: by 2002:a05:600c:4e94:b0:397:62ab:f88f with SMTP id f20-20020a05600c4e9400b0039762abf88fmr2049905wmq.63.1653406068135; Tue, 24 May 2022 08:27:48 -0700 (PDT) Received: from xps-9300.baylibre (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.gmail.com with ESMTPSA id k24-20020a05600c1c9800b003974027722csm2703693wms.47.2022.05.24.08.27.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 May 2022 08:27:47 -0700 (PDT) From: Alexandre Bailon To: rafael@kernel.org, rui.zhang@intel.com, daniel.lezcano@linaro.org, amitk@kernel.org Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, khilman@baylibre.com, mka@chromium.org, robh+dt@kernel.org, krzk+dt@kernel.org, matthias.bgg@gmail.com, p.zabel@pengutronix.de, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, james.lo@mediatek.com, fan.chen@mediatek.com, louis.yu@mediatek.com, rex-bc.chen@mediatek.com, Alexandre Bailon Subject: [PATCH v7 0/6] Add LVTS architecture thermal Date: Tue, 24 May 2022 17:25:46 +0200 Message-Id: <20220524152552.246193-1-abailon@baylibre.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220524_082752_754037_819BEF03 X-CRM114-Status: GOOD ( 17.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This patch move thermal files related to Mediatek to the mediatek folder. And introduce the new architecture LVTS (low pressure thermal sensor) driver to report the highest temperature in the SoC and record the highest temperature sensor, each sensor as a hot zone. The LVTS body is divided into two parts, the LVTS controller and the LVTS device. The LVTS controller can connect up to 4 LVTS devices, and each LVTS device can connect up to 7 TSMCUs. The architecture will be the first to be used on mt6873 and mt8192. Change in v7: - Fix coding style issues - Rewrite dt bindings - was not accurate - Use mt8195 for example (instead of mt8192) - Rename mt6873 to mt8192 - Remove clock name - Rebased on top of to series: - https://patchwork.kernel.org/project/linux-mediatek/list/?series=637849 - https://patchwork.kernel.org/project/linux-pm/list/?series=639386 Change in v6: - Remove temperature aggregation (it will be added in another series) - Update the way to read the temperature (read one sensor instead of all) - Add support of mt8195 Change in v5: - Use 'git mv' for the relocated file. Change in v4: - Rebase to kernel-v5.13-rc1 - Resend Change in v3: - [2/3] - change the expression in the lvts_temp_to_raw to dev_s64. Change in v2: - Rebase to kernel-5.11-rc1. - [2/3] - sort headers - remove initial value 0 of msr_raw in the lvts_temp_to_raw. - disconstruct the api of lvts_read_tc_msr_raw. - add the initial value max_temp = 0 and compare e.q. in the lvts_read_all_tc_temperature. - add the return with invalid number in the lvts_init. This patch depends on [1], [2] and [3]. [1]https://patchwork.kernel.org/project/linux-mediatek/patch/20210524122053.17155-7-chun-jie.chen@mediatek.com/ [2]https://patchwork.kernel.org/project/linux-mediatek/list/?series=637849 [3]https://patchwork.kernel.org/project/linux-pm/list/?series=639386 Alexandre Bailon (2): dt-bindings: thermal: Add binding document for LVTS thermal controllers arm64: dts: mt8195: Add efuse node to mt8195 Michael Kao (3): thermal: mediatek: Relocate driver to mediatek folder thermal: mediatek: Add LVTS drivers for SoC theraml zones thermal: mediatek: Add thermal zone settings for mt8195 Tinghan Shen (1): arm64: dts: mt8195: Add thermal zone .../thermal/mediatek,mt8192-lvts.yaml | 81 + arch/arm64/boot/dts/mediatek/mt8195.dtsi | 121 ++ drivers/thermal/Kconfig | 14 +- drivers/thermal/Makefile | 2 +- drivers/thermal/mediatek/Kconfig | 33 + drivers/thermal/mediatek/Makefile | 2 + .../{mtk_thermal.c => mediatek/soc_temp.c} | 2 +- drivers/thermal/mediatek/soc_temp_lvts.c | 1434 +++++++++++++++++ drivers/thermal/mediatek/soc_temp_lvts.h | 304 ++++ 9 files changed, 1981 insertions(+), 12 deletions(-) create mode 100644 Documentation/devicetree/bindings/thermal/mediatek,mt8192-lvts.yaml create mode 100644 drivers/thermal/mediatek/Kconfig create mode 100644 drivers/thermal/mediatek/Makefile rename drivers/thermal/{mtk_thermal.c => mediatek/soc_temp.c} (99%) create mode 100644 drivers/thermal/mediatek/soc_temp_lvts.c create mode 100644 drivers/thermal/mediatek/soc_temp_lvts.h