From patchwork Tue Apr 20 17:16:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 12214801 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=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham 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 1695DC433B4 for ; Tue, 20 Apr 2021 17:16:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C57CB613C2 for ; Tue, 20 Apr 2021 17:16:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233417AbhDTRRI (ORCPT ); Tue, 20 Apr 2021 13:17:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233294AbhDTRRI (ORCPT ); Tue, 20 Apr 2021 13:17:08 -0400 X-Greylist: delayed 4936 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Tue, 20 Apr 2021 10:16:36 PDT Received: from mxout1.routing.net (mxout1.routing.net [IPv6:2a03:2900:1:a::a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F345C06174A; Tue, 20 Apr 2021 10:16:36 -0700 (PDT) Received: from mxbox2.masterlogin.de (unknown [192.168.10.89]) by mxout1.routing.net (Postfix) with ESMTP id 6B5283FE33; Tue, 20 Apr 2021 17:16:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerdienst.de; s=20200217; t=1618938994; 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=of1hyRAmkUxYfFb6DiwQtokusN7zzKLSP6s9xK0+XcU=; b=H6MS+7gvc0xflGa2AqdWz1BNuOeChc7asm4MShGgd+vd35WW2Tt+g0vKdA5oGR+Qmyrasd Cbz730AcNaLngxSx7fk9Hhlxm/v2JsVaGFuCzp9NBhHkBdu7mmJ9biC/HyimEHWlCPUDM8 TPsQHUjJTaf4LKF0/vADfyFUlfMIDK0= Received: from localhost.localdomain (fttx-pool-80.245.77.151.bambit.de [80.245.77.151]) by mxbox2.masterlogin.de (Postfix) with ESMTPSA id 815F3100396; Tue, 20 Apr 2021 17:16:33 +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 v3] thermal: mediatek: add sensors-support Date: Tue, 20 Apr 2021 19:16:25 +0200 Message-Id: <20210420171625.133860-1-linux@fw-web.de> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Mail-ID: dd281ef3-14fe-49a8-a0ae-7fed3d2a241c Precedence: bulk List-ID: X-Mailing-List: linux-pm@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 --- v3: drop no_hwmon v2: drop ifdef and used devm_thermal_add_hwmon_sysfs --- drivers/thermal/mtk_thermal.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/thermal/mtk_thermal.c b/drivers/thermal/mtk_thermal.c index 149c6d7fd5a0..32be8a715c7d 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,11 @@ static int mtk_thermal_probe(struct platform_device *pdev) goto err_disable_clk_peri_therm; } + tzdev->tzp->no_hwmon = false; + ret = devm_thermal_add_hwmon_sysfs(tzdev); + if (ret) + dev_err(&pdev->dev, "error in thermal_add_hwmon_sysfs"); + return 0; err_disable_clk_peri_therm: