From mboxrd@z Thu Jan 1 00:00:00 1970 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 C1F23C38159 for ; Wed, 18 Jan 2023 03:55:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: MIME-Version:Message-ID:Subject:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=fKlQYrbwarGXd8BnoNbYMw4HckYIZ31+uLtyC9LYpHI=; b=Kka u/hdUVlcqtdGtdFM0xPVXI++JnCWCih5xlM1j5p575tUvqPXEXo3CDOffZDlLpP2EJACvCBw/mZ3A e9o34ot8NSrKOfJeWrkItFVQlse6qk9q+IBElUyftKTyNBSqq9tTp/O97a9zein7o44TblSvspCqM oKHZvre1yBnMQ2TY5ywWAydkCQTqiD61fFznFKF6oIA8ayAXdYsVD5+MENI5cpuDLEiF7W8dDJVGZ v2A7SUBliZt8HFC/TuooFeqtrVyh49jFn1Qean2BFFoCHyjc2Uh3OV7LT+OjNzh5AxuMlrbh3w0eU O28bROwbBTIjZro06mTScVVC9LE0Eyw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pHzXy-00GoQf-JT; Wed, 18 Jan 2023 03:55:34 +0000 Received: from fudo.makrotopia.org ([2a07:2ec0:3002::71]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pHzXn-00GoOT-IX; Wed, 18 Jan 2023 03:55:25 +0000 Received: from local by fudo.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.96) (envelope-from ) id 1pHzXZ-00032D-0e; Wed, 18 Jan 2023 04:55:09 +0100 Date: Wed, 18 Jan 2023 03:55:01 +0000 From: Daniel Golle To: AngeloGioacchino Del Regno , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, "Rafael J. Wysocki" , Daniel Lezcano , Amit Kucheria , Zhang Rui , Matthias Brugger , Rob Herring Subject: [PATCH v4 0/2] thermal: mediatek: add support for MT7986 and MT7981 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230117_195523_632700_5BA2EFC3 X-CRM114-Status: GOOD ( 12.59 ) 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: , Cc: John Crispin , Steven Liu , Chad Monroe , Henry Yen Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org As requested in a previous review, first convert the if-else selection of the raw_to_mcelsius_* function to instead use a function pointer added to struct mtk_thermal. Then add thermal support for the MT7986 SoC which can also be used on MT7981. Device Tree bindings have already been merged[1]. When submitting v3, it looked like the patch series submitted by Amjad Ouled-Ameur ("thermal: mediatek: Add support for MT8365 SoC"[2]) which also adds this function pointer would be merged first. However, this a re-spin of this series addressing the comments it has received has not yet been submitted. The change introducing the raw_to_mcelsius function pointer is hence being applied independently. Changes since v2: Rebase on top of pending patch introducing raw_to_mcelsius function pointer. Drop left-over macro extracting the unused adc_oe field. Use switch (...) instead of if-else-if-else-... statements. For now, return -EINVAL as default in case of unknown version. Imho this should be BUG(), as this version is only defined within this driver. Changes since v1: Drop use of adc_oe field in efuse, Henry Yen confirmed its use has been dropped intentionally in MTK SDK as well. [1]: https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git//071e99848ccc1fbe238c4c9c7cfffd83f1dfe156 [2]: https://lore.kernel.org/linux-arm-kernel/4121bb6b-30db-7a23-f4c8-40afdda7a0b5@linaro.org/T/ Daniel Golle (2): thermal/drivers/mtk: use function pointer for raw_to_mcelsius thermal: mediatek: add support for MT7986 and MT7981 drivers/thermal/mtk_thermal.c | 150 +++++++++++++++++++++++++++++++--- 1 file changed, 140 insertions(+), 10 deletions(-) -- 2.39.1