Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp5845193rwb; Tue, 17 Jan 2023 20:13:29 -0800 (PST) X-Google-Smtp-Source: AMrXdXvv1VBCqV2+8lJbxwWvOaotoRlRZ/C4FCR8uFf0ZSN4Rorimf/ScLn+NFmZFAJ9ZRsQ+GXS X-Received: by 2002:a17:902:9b97:b0:194:7b3a:e93e with SMTP id y23-20020a1709029b9700b001947b3ae93emr5572007plp.53.1674015209735; Tue, 17 Jan 2023 20:13:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674015209; cv=none; d=google.com; s=arc-20160816; b=amvQzIFJknJM+iZ6cF1pe3IuuSz4GQgMO5L0os8x+8/Hsqb7LdVjJkgkeq6RJDC75U XR/gPvg3iDBzW8HW8L9JaGRrIsTDW+HNgb9geKbz/LVHQ3CRzg7rV4eq1WST9w5lNQJ9 oWuXmG/m0mkwNKN3xEeuZ5xB5nbMD2FeOxI++9XYXg/XKNUY87KB2P1zLVCyPtAtfxt3 QoJ961AAwp1ZS8Lm+9WMUy40vy0DCcAMBxmeVo0Lo9gvDZQpjaYWnzhaTxI8nOg71elJ Y27Q2+9bcMp8thoqbKX/VoewbPn56V9kXxuGuueRfnaoQg+VAcEPc81utCYtwbl21Nrk ATsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date; bh=fKlQYrbwarGXd8BnoNbYMw4HckYIZ31+uLtyC9LYpHI=; b=ep43kdIIMTDPpI7V1UkubI9e+LlPFj+VJ68A7Y8VU+VQUUoB0eN+J+/AuGt3gxKO4e e6RBUSpxyMivi/TVxXHXJCE4HBrXeoTfs75qJn+iE/D+MB1GRd5MENmPK8A3NU7l1n94 M5p7DeaqJU8RtdEXJvn/SLRGO/NeyKpjYx1a8aGzEqc2bmy7rj91iJKAygXg8sG8Yzft pIGoCcV3sqWjL71mecR3gVtRmgEf5mwFm5qwcewcIe2UKxgBkYlB0HWZWb5iPcz1ARgq 2/0MiPYHtSDpi63B94FPG3ljtf8y7dAvbv/P5zMj0qUz89oke4a6ZIyK20li/Ve5TIvR c3qw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r17-20020a632b11000000b004ce425ce691si6418046pgr.791.2023.01.17.20.13.24; Tue, 17 Jan 2023 20:13:29 -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; 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 S229670AbjARDz1 (ORCPT + 46 others); Tue, 17 Jan 2023 22:55:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229689AbjARDzX (ORCPT ); Tue, 17 Jan 2023 22:55:23 -0500 Received: from fudo.makrotopia.org (fudo.makrotopia.org [IPv6:2a07:2ec0:3002::71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE34453FA2; Tue, 17 Jan 2023 19:55:18 -0800 (PST) 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 Cc: Steven Liu , Henry Yen , Chad Monroe , John Crispin , Frank Wunderlich 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-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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 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