Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4216272pxj; Tue, 8 Jun 2021 09:04:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzD/fp1s5oiRey0O9WzpkMxe629lI2gNQ0GGis+B0zFUZoflO0TSx6RyBw4UJBvA+SjudS6 X-Received: by 2002:a17:907:779a:: with SMTP id ky26mr24028525ejc.293.1623168298090; Tue, 08 Jun 2021 09:04:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623168298; cv=none; d=google.com; s=arc-20160816; b=MDNb9IcFmAg5XurvDvRf+MKQ/cWLNdsyneyGXsv70RrSmZC+0qj9h1DWTX13QbIIAC DC+HJyt4PfgcivTVQSklaSiwamXVThh388uJeXmxCNKT15z8pwC//CRKclylo2aF6jp3 4a6kNbnXsnCklRgmO+4OReMw2e6i/vsqbOyLSB+S0w3/wF73NNyxi5P/f3kbRBbk+hAL RYyjcMliI6Ywa/m+ZKOIdwALg86JzNoJ4uiMu/eZjbqEgsQCBlOcInP+OEoaXHhR7Wo7 yVazGlJYgyuelSoVQ+kfPbK31G06SIHuhvIJPCpptUIDWcP8vntR9zjjzBIuQG+COA22 3oZw== 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=98Qit1hMtPHZc/TS5dL5TLvDSnXeL0iSq1KTlz2Fj4Y=; b=KPjpOp15liJptBRr5aj3ueg2oeMqzRNzqsZvcRJsRQvCFybm3WeiPyZqpc/ShU+VD8 81wKVG+t9NpzD3U+l9Sj3C9mI950dY2u6/G1gf9eRAu+qTq32WHNVoQEKjwmy8RjJy7+ 6f2VpY5E9Fp2GoPo5N8/8Sq0FqfzxjRpGtAN/SSiVoQO/1UAVnRGsHfwXUZn7/PaW8kZ VC+ediEaMXyBDK12fjitrAgMSmh2mAEC9KLWzYFAUJSu+h+XQHZNa9S9gnMzu4snkfzx 7Bm86N2dQuG0VfrHk+hVY5xFct7A0NicyJjZGD7Ke5G2PMoXHfPiMLA0tgtf6mvUfHoR wyRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mailerdienst.de header.s=20200217 header.b="Iuhw/LqB"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cr15si100809ejc.258.2021.06.08.09.04.32; Tue, 08 Jun 2021 09:04:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mailerdienst.de header.s=20200217 header.b="Iuhw/LqB"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233660AbhFHQCL (ORCPT + 99 others); Tue, 8 Jun 2021 12:02:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233318AbhFHQB4 (ORCPT ); Tue, 8 Jun 2021 12:01:56 -0400 X-Greylist: delayed 600 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Tue, 08 Jun 2021 09:00:03 PDT Received: from mxwww.masterlogin.de (mxwww.masterlogin.de [IPv6:2a03:2900:1:1::a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F4EEC061574; Tue, 8 Jun 2021 09:00:03 -0700 (PDT) Received: from mxout4.routing.net (unknown [192.168.10.112]) by backup.mxwww.masterlogin.de (Postfix) with ESMTPS id 37DED2C52D; Tue, 8 Jun 2021 15:45:55 +0000 (UTC) Received: from mxbox4.masterlogin.de (unknown [192.168.10.79]) by mxout4.routing.net (Postfix) with ESMTP id 619DA10081F; Tue, 8 Jun 2021 15:45:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerdienst.de; s=20200217; t=1623167148; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=98Qit1hMtPHZc/TS5dL5TLvDSnXeL0iSq1KTlz2Fj4Y=; b=Iuhw/LqB8uiWEGDmraAJxW1QmzpUpi9yQ86fUmAiLQUYrSGgN4y3cP6HCt6VbhsVuZriB4 JmcWW72XI53HVnl+QAB2sqy9KFdUuPMx5Whv0Mu+fyuAq3mVQQPjx+oKgHgcYmnQF6r7Dd fuq4cYG7k3Z18G1o0qLI1U7pTEGpmEo= Received: from localhost.localdomain (fttx-pool-217.61.145.142.bambit.de [217.61.145.142]) by mxbox4.masterlogin.de (Postfix) with ESMTPSA id AA073804E7; Tue, 8 Jun 2021 15:45:47 +0000 (UTC) From: Frank Wunderlich To: linux-mediatek@lists.infradead.org Cc: Frank Wunderlich , Daniel Lezcano , Amit Kucheria , Matthias Brugger , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v4] thermal: mediatek: add sensors-support Date: Tue, 8 Jun 2021 17:45:30 +0200 Message-Id: <20210608154530.70074-1-linux@fw-web.de> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mail-ID: 8400b1d9-070e-406d-af5d-86a2ada1c8ff Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Frank Wunderlich add HWMON-support to mediateks thermal driver to allow lm-sensors userspace tools read soc temperature Signed-off-by: Frank Wunderlich --- v4: change message to dev_warn as suggested by matthias v3: drop no_hwmon v2: drop ifdef and used devm_thermal_add_hwmon_sysfs --- drivers/thermal/mtk_thermal.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/thermal/mtk_thermal.c b/drivers/thermal/mtk_thermal.c index 97e8678ccf0e..ede94eadddda 100644 --- a/drivers/thermal/mtk_thermal.c +++ b/drivers/thermal/mtk_thermal.c @@ -23,6 +23,8 @@ #include #include +#include "thermal_hwmon.h" + /* AUXADC Registers */ #define AUXADC_CON1_SET_V 0x008 #define AUXADC_CON1_CLR_V 0x00c @@ -1087,6 +1089,10 @@ static int mtk_thermal_probe(struct platform_device *pdev) goto err_disable_clk_peri_therm; } + ret = devm_thermal_add_hwmon_sysfs(tzdev); + if (ret) + dev_warn(&pdev->dev, "error in thermal_add_hwmon_sysfs"); + return 0; err_disable_clk_peri_therm: -- 2.25.1