From patchwork Tue Oct 17 19:05:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Bernhard_Rosenkr=C3=A4nzer?= X-Patchwork-Id: 15504 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp4342833vqb; Tue, 17 Oct 2023 12:06:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHNlO8gM85Bu+IegyCT3fxcOqIaLHqX821z3CTHOpLZp30kKiDchA189Ns/BrOQ0wtHmngH X-Received: by 2002:a17:902:d1c2:b0:1c7:1eed:10f2 with SMTP id g2-20020a170902d1c200b001c71eed10f2mr3174339plb.2.1697569570108; Tue, 17 Oct 2023 12:06:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697569570; cv=none; d=google.com; s=arc-20160816; b=KdRZoawAaI8Ni6UA2xXb4q1IFcf5twDpPfSZggHeEKl9agGdiOkarijCYK0Ms5h542 LkVak0ym25gjYJZVZFJbLi6ionhGf3goaPeZI9/FbZf0Qv/A2tJBrBeWiZi2A9YxCxCL sjMo/TqN4QjOmQFM7BXykO2M56DfmT456jJmkPZRmMiKbPUSOfzuSy64n9EQw5/xk7aq KbRVahwiSYcyvP2U6URJXK9Z60Lbris+ah8kqFHyduH1LrumDymmoC8Ep3DgeRG//Qev FvuGZS1H9abcN8xX4t1W9U27bN07+ElmDRvLOJ03NAWu219Ps+Dbgy5BULh6AwOgsZ5U pd4g== 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=5T8pyCBsKAygZpdsiydX+RlsNqoe0a3HYugW6rTPXAk=; fh=1eEQxEbwsgrMAN0V4jvwHcoOQotbr3+hzjZUUcVMLss=; b=cVFv0UPbgH9kv0gf+fcXHj4couheV9mBtRzvbm4E7EskvvPsgloj3KxehpYHmyNPXe e5qw+pKp8qmjeUiOQNFW4MqgsMZnZgN3lTL82JDIcHm4yh16s0LLVDemZkTB+GvoWrKv e9ayyZSLqD4+FwSaiKJxqjKy7maZetM1+K5JtOcYWcFWucq45rya/PdjZu+EdFkA6gGt McUESA5EifZ2NyfBmudNvTSKojQD5RMC9xqH+Vz+j2oe+9v3SpLX3o0W+/fk89jPS07f UI/3Z8MLylB236mbENAmz5K1NRzgATWwiMCFJhEi7KAQ+nB5w8l4RkNRuaIrSlAj7NKM tOEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=xIpa2yRG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id u17-20020a170903125100b001c9c967e77esi2437515plh.207.2023.10.17.12.06.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 12:06:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=xIpa2yRG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id BC25F8029095; Tue, 17 Oct 2023 12:06:05 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344091AbjJQTFx (ORCPT + 21 others); Tue, 17 Oct 2023 15:05:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232228AbjJQTFv (ORCPT ); Tue, 17 Oct 2023 15:05:51 -0400 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B97290 for ; Tue, 17 Oct 2023 12:05:48 -0700 (PDT) Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-53ed4688b9fso4037778a12.0 for ; Tue, 17 Oct 2023 12:05:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1697569547; x=1698174347; 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=5T8pyCBsKAygZpdsiydX+RlsNqoe0a3HYugW6rTPXAk=; b=xIpa2yRGehksghAk/xwcexb+wQYmPO4IRYVTxy/ehJXOMJsgXGM+0meRv5QwolwYUw CTNDzcfHwJuOjV5JNH7ofaixDVxbdqQQ8S2xPW3YR1I73VD17bcFNuPL2d2nz6BSq2+0 PJojsfe1n0OlNJBs4IsM2DHy8/uIiSkvhK1VKxzSWCQyiJWNW/+LpAUvcxJOutNF/+5d yCayjgQQQ456+4djDU9bnoEQKqWxXCJNE9lTp00mAAu4l2fH+1MAHj40gIOm8jk4sE/e yHui/c/EilT7MmRXVV2XBiB7/uhhfh1yNYOaoDDN0/k3prlaRNwTDbN3jdPdSE1syiXK 6T3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697569547; x=1698174347; 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=5T8pyCBsKAygZpdsiydX+RlsNqoe0a3HYugW6rTPXAk=; b=wqgGb9nDHltW+SThbXk3YbqAU2aWbFjrRScIpvK+y7QMqcZEfG7uQexsDs1lug0PPL wPGVkPqFxBkIC0+UI4xzi94lZBmMNeVUSGd+bGA6En99QJ7X5IppEXTHz5MvnaAf/dJ7 Zi8MWCrqpUhGidxHW3MdWPo2Q9JeNxsBRj1uF9FqbKb/KgZxKJNOfSRngqAAa+Q8sX+T n745paUmRZ+GBEr5PuljYswa0xlV2YBrKQYWP67ZaIiJoqepo2U9YKd9rgk+SZujiXks NV62Uh43qC9KEIYSd9Wy3UI5pih2cqAxD4rGgq7e9G6tuP+pns4LxfCENSAmBuK41miO 3qaQ== X-Gm-Message-State: AOJu0Yx9k6x7PZP7B2xWUjPcSVX1/MOIHWm6Aa5QuXyDfwG+K0lozJZ2 nD2/WUiWLQwfieDmJZxIek/Z4A== X-Received: by 2002:a50:ab55:0:b0:52e:1d58:a6ff with SMTP id t21-20020a50ab55000000b0052e1d58a6ffmr2012654edc.35.1697569546785; Tue, 17 Oct 2023 12:05:46 -0700 (PDT) Received: from ryzen9.fritz.box ([2a01:2a8:8f03:b001:fe65:a70:2777:ab31]) by smtp.gmail.com with ESMTPSA id bq14-20020a056402214e00b00537963f692esm1637990edb.0.2023.10.17.12.05.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 12:05:46 -0700 (PDT) From: =?utf-8?q?Bernhard_Rosenkr=C3=A4nzer?= 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, dunlap@infradead.org, e.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, wenst@chromium.org, ames.lo@mediatek.com, rex-bc.chen@mediatek.com, nfraprado@collabora.com, abailon@baylibre.com, amergnat@baylibre.com, khilman@baylibre.com Subject: [PATCH v5 0/5] Add LVTS support for mt8192 Date: Tue, 17 Oct 2023 21:05:40 +0200 Message-ID: <20231017190545.157282-1-bero@baylibre.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.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 (pete.vger.email [0.0.0.0]); Tue, 17 Oct 2023 12:06:05 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780030709491511526 X-GMAIL-MSGID: 1780030709491511526 Add full LVTS support (MCU thermal domain + AP thermal domain) to MediaTek MT8192 SoC. Also, add Suspend and Resume support to LVTS Driver (all SoCs), and update the documentation that describes the Calibration Data Offsets. v5 changes are a lot smaller than originally assumed -- commit 185673ca71d3f7e9c7d62ee5084348e084352e56 fixed the issue I was originally planning to work around in this patchset, so what remains for v5 is noirq and cosmetics. Changelog: v5 : - Suspend/Resume in noirq stage - Reorder chipset specific functions - Rebased : base-commit: 4d5ab2376ec576af173e5eac3887ed0b51bd8566 v4 : - Shrink the lvts_ap thermal sensor I/O range to 0xc00 to make room for SVS support, pointed out by AngeloGioacchino Del Regno v3 : - Rebased : base-commit: 6a3d37b4d885129561e1cef361216f00472f7d2e - Fix issues in v2 pointed out by NĂ­colas F. R. A. Prado : Use filtered mode to make sure threshold interrupts are triggered, protocol documentation, cosmetics - I (bero@baylibre.com) will be taking care of this patchset from now on, since Balsam has left BayLibre. Thanks for getting it almost ready, Balsam! v2 : - Based on top of thermal/linux-next : base-commit: 7ac82227ee046f8234471de4c12a40b8c2d3ddcc - Squash "add thermal zones and thermal nodes" and "add temperature mitigation threshold" commits together to form "arm64: dts: mediatek: mt8192: Add thermal nodes and thermal zones" commit. - Add Suspend and Resume support to LVTS Driver. - Update Calibration Data documentation. - Fix calibration data offsets for mt8192 (Thanks to "Chen-Yu Tsai" and "NĂ­colas F. R. A. Prado"). https://lore.kernel.org/all/20230425133052.199767-1-bchihi@baylibre.com/ Tested-by: Chen-Yu Tsai v1 : - The initial series "Add LVTS support for mt8192" : "https://lore.kernel.org/all/20230307163413.143334-1-bchihi@baylibre.com/". Balsam CHIHI (5): dt-bindings: thermal: mediatek: Add LVTS thermal controller definition for mt8192 thermal/drivers/mediatek/lvts_thermal: Add suspend and resume thermal/drivers/mediatek/lvts_thermal: Add mt8192 support arm64: dts: mediatek: mt8192: Add thermal nodes and thermal zones thermal/drivers/mediatek/lvts_thermal: Update calibration data documentation arch/arm64/boot/dts/mediatek/mt8192.dtsi | 454 ++++++++++++++++++ drivers/thermal/mediatek/lvts_thermal.c | 163 ++++++- .../thermal/mediatek,lvts-thermal.h | 19 + 3 files changed, 634 insertions(+), 2 deletions(-)