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: 12214809 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,DKIMWL_WL_HIGH, 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 B1F91C433ED for ; Tue, 20 Apr 2021 17:19:02 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 50D26613AF for ; Tue, 20 Apr 2021 17:19:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 50D26613AF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=fw-web.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=MCeLN6F4LgVHnMfLrE9WoKW0WRxBFRYzPB4i0VH8DVg=; b=COl7wqVfq/VddHXOXsPpKNFzup aJFgSbz+UcXZVN3ucNRC5GaxUeOoUccWMrmGBdhKdS/JrrmBd0JkYsv4yENSgI751TaI4VKBbGFz3 rNEOhcG7Ng7Ni1Jji+ab/XNIbRh4mWtCaFUXC/Se0sXdIcjIv3gC8VHlaW3zjLjZEBhM4WTB6If82 EGE4tcvcVuTKI9Jmwqm7bruJMeDBomp+fCklULJ2uZTxD0nch+s91k3OXaVzkByfKyvMLh+vK4wk6 w/KH8pXoNvoxABz7wAkExQj//kfSKu7n6gHjOS/kiQFNgdhNKQsnRw9QNTyGwFloA0yrNn2Cdls6u y0tFIZKQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lYtzS-00Ch1B-N4; Tue, 20 Apr 2021 17:16:46 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lYtzP-00Ch0t-HD; Tue, 20 Apr 2021 17:16:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=of1hyRAmkUxYfFb6DiwQtokusN7zzKLSP6s9xK0+XcU=; b=uPzSEWk/oxGKhOH/Qe7k02dsSN Oi9C9euJpjQEvhpVpEpeiYHd8vaLyBYLG4PS7ORXRO4a5Y30k3ny6V1+MM6OJ04wM2TINKJ11qxhb AL0sPIg64buDG+J3o30GTi8i9J5biJnk5Lpk9qnoOaieFHG0sC54NwBrhRwp7W0/oaBTtexHwogTB qRGIPs9En5ImtTJJyUNe0nWoKlkb9a1iX3OwfTR0UmPZzpVaghGQxaVbU1nXzYtDG1YKgcYvuuFFF YHetTlhUHgKeuZOxCzu2GmfTncQlAF4Kxso96L3ehLJXM3nBrAnNJxbQamE411yEj0VSSvGBEZa1K nsob2+mA==; Received: from mxout1.routing.net ([2a03:2900:1:a::a]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lYtzK-00CJ0x-87; Tue, 20 Apr 2021 17:16:42 +0000 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210420_101638_452529_5DBD6442 X-CRM114-Status: UNSURE ( 9.78 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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: