From patchwork Thu Jun 3 08:18:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ben.Tseng" X-Patchwork-Id: 12296599 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 76317C47082 for ; Thu, 3 Jun 2021 08:18:47 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 4161C613E6 for ; Thu, 3 Jun 2021 08:18:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4161C613E6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org 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=s6An/pH1UT/nsvMQ9RrQ4sOUH2MasKgrF2eHaXhhe1o=; b=Gq+WNciScO9Ksy 3XWn9q4NiPvMnsxJqaNmBz/NVVnvuybXqnzAKMVdgdIy3GEGA1KG0RA9pLMRfCPd5b/6aFuaBeeqX Bb0C6aaDnfCM/Noo61MrtfGdaeWJp9NAMcDQPmVL8sTW/tDvQNipTnfA96he18gOQiAPu6YCwF1S7 QZh/ZETYWk+loLWGAUtWuUZEC7jMUCv4j1ar3wdXGniLT3TGrHDl98D5IKDLzNwrUjccoywvmA6K1 i7h2EeWIBMGobvZZC2JHNPmfFPoXi0shLdTefISAEV9EmU0ldexyWh7BYwZyrmyCXrHeKJ2E1ZhNp Hcrxg8HJ61CeiDB63Lcg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1loiYj-007dSB-K4; Thu, 03 Jun 2021 08:18:33 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1loiYV-007dMV-86; Thu, 03 Jun 2021 08:18:20 +0000 X-UUID: e916c1f6e58743f0978984073e1b3bec-20210603 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=kqzMNmufU8rtsN0LXnhgppQ9ojRTCj7WGpNsiJEwS/I=; b=cmGW+WMozb3ZOgdBquauInUFyqBUz7gzfxX2up0r/w6IXiYeCOQRTOmMVJxQASpzXzw++AJHWRdnJys1DD76CzqkiywrLyNbOvqdHpOTSW/5R3MsC+aoUf3KLvJZS67l6Mim4GSy05Or868F+qOuPBOgZgR/SDTi5MmJu+yukCY=; X-UUID: e916c1f6e58743f0978984073e1b3bec-20210603 Received: from mtkcas68.mediatek.inc [(172.29.94.19)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 593008400; Thu, 03 Jun 2021 01:18:11 -0700 Received: from mtkmbs07n1.mediatek.inc (172.21.101.16) by MTKMBS62N1.mediatek.inc (172.29.193.41) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 3 Jun 2021 01:18:09 -0700 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 3 Jun 2021 16:18:08 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 3 Jun 2021 16:18:07 +0800 From: Ben Tseng To: Fan Chen , Zhang Rui , "Daniel Lezcano" , , CC: Eduardo Valentin , Rob Herring , Mark Rutland , Matthias Brugger , , , , , , , Ben Tseng Subject: [PATCH v4 0/3] thermal: mediatek: Add LVTS architecture thermal controller Date: Thu, 3 Jun 2021 16:18:03 +0800 Message-ID: <20210603081806.21154-1-ben.tseng@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210603_011819_313679_276C5BB4 X-CRM114-Status: GOOD ( 15.61 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=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 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]. [1]https://patchwork.kernel.org/project/linux-mediatek/patch/20210524122053.17155-7-chun-jie.chen@mediatek.com/ Michael Kao (3): thermal: mediatek: Relocate driver to mediatek folder thermal: mediatek: Add LVTS drivers for SoC theraml zones dt-bindings: thermal: Add binding document for mt6873 thermal controller .../bindings/thermal/mediatek-thermal-lvts.yaml | 81 ++ drivers/thermal/Kconfig | 14 +- drivers/thermal/Makefile | 2 +- drivers/thermal/mediatek/Kconfig | 33 + drivers/thermal/mediatek/Makefile | 2 + drivers/thermal/mediatek/soc_temp.c | 1127 +++++++++++++++++ drivers/thermal/mediatek/soc_temp_lvts.c | 1287 ++++++++++++++++++++ drivers/thermal/mediatek/soc_temp_lvts.h | 312 +++++ drivers/thermal/mtk_thermal.c | 1127 ----------------- 9 files changed, 2847 insertions(+), 1138 deletions(-) create mode 100644 Documentation/devicetree/bindings/thermal/mediatek-thermal-lvts.yaml create mode 100644 drivers/thermal/mediatek/Kconfig create mode 100644 drivers/thermal/mediatek/Makefile create mode 100644 drivers/thermal/mediatek/soc_temp.c create mode 100644 drivers/thermal/mediatek/soc_temp_lvts.c create mode 100644 drivers/thermal/mediatek/soc_temp_lvts.h delete mode 100644 drivers/thermal/mtk_thermal.c