From patchwork Tue Apr 20 15:54:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 12214571 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 B8AF0C433ED for ; Tue, 20 Apr 2021 16:00:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7E1E9613C8 for ; Tue, 20 Apr 2021 16:00:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232504AbhDTQAi (ORCPT ); Tue, 20 Apr 2021 12:00:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232303AbhDTQAh (ORCPT ); Tue, 20 Apr 2021 12:00:37 -0400 Received: from mxwww.masterlogin.de (mxwww.masterlogin.de [IPv6:2a03:2900:1:1::a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA79BC06174A; Tue, 20 Apr 2021 09:00:05 -0700 (PDT) Received: from mxout1.routing.net (unknown [192.168.10.81]) by backup.mxwww.masterlogin.de (Postfix) with ESMTPS id 34AC32C4D4; Tue, 20 Apr 2021 15:54:22 +0000 (UTC) Received: from mxbox2.masterlogin.de (unknown [192.168.10.89]) by mxout1.routing.net (Postfix) with ESMTP id 7B6583FE0A; Tue, 20 Apr 2021 15:54:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerdienst.de; s=20200217; t=1618934057; 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=kQYv4OtNr6e//YkMopHLbwWlrJMzWOHnE8M1UCzYfGU=; b=NFmpEG8uJGS8FmvRAXIb9Ilqih45UNHL7PMvflMewmrdAAN+fveZC0qe0TIkbKNKjHreuX uySf7rYOuumh3KADGmogaJ1lkRutiRxOE8XN8e3xbgWhNvGayANhpv1Hg/TpczHP778rGR mqS+7i9INHrirEqcbbZOCS7aNyB/FKE= Received: from localhost.localdomain (fttx-pool-80.245.77.151.bambit.de [80.245.77.151]) by mxbox2.masterlogin.de (Postfix) with ESMTPSA id 88927100396; Tue, 20 Apr 2021 15:54:16 +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 v2] thermal: mediatek: add sensors-support Date: Tue, 20 Apr 2021 17:54:10 +0200 Message-Id: <20210420155410.132141-1-linux@fw-web.de> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Mail-ID: a26884df-a290-43e7-8bcd-1a1379261d7e 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 --- 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: