From patchwork Tue Apr 20 17:23:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 12214819 X-Patchwork-Delegate: daniel.lezcano@linaro.org 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 40EDBC433B4 for ; Tue, 20 Apr 2021 17:23:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EF2E561076 for ; Tue, 20 Apr 2021 17:23:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231549AbhDTRXq (ORCPT ); Tue, 20 Apr 2021 13:23:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233305AbhDTRXp (ORCPT ); Tue, 20 Apr 2021 13:23:45 -0400 Received: from mxout2.routing.net (mxout2.routing.net [IPv6:2a03:2900:1:a::b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D574C06174A; Tue, 20 Apr 2021 10:23:12 -0700 (PDT) Received: from mxbox4.masterlogin.de (unknown [192.168.10.79]) by mxout2.routing.net (Postfix) with ESMTP id 036CC5FCE7; Tue, 20 Apr 2021 17:23:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerdienst.de; s=20200217; t=1618939391; 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=u2UmPgWhv8jDff+sft2q0VUDxc4XXaa5vanqClNiNS8=; b=ehOsyo0UfwFQR70tYVkEiUXuxZe7CvvTgYS3JansE8oYt6/7S5/87gexXfYc2bdTA7uvlj i1oDX0EzuvktTIJzIhT/NkdNMgnGZAkiBEKDiL728YufmOlZVHYw5RuifdO6JJXy3nCqrM qrkzrBRLKk3InmL6axymeQWgFSYIAXc= Received: from localhost.localdomain (fttx-pool-80.245.77.151.bambit.de [80.245.77.151]) by mxbox4.masterlogin.de (Postfix) with ESMTPSA id 1F0148064D; Tue, 20 Apr 2021 17:23:10 +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:23:08 +0200 Message-Id: <20210420172308.134685-1-linux@fw-web.de> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Mail-ID: 10d04dc0-d980-42d8-8607-1dad480fb628 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 - now really, sorry 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 149c6d7fd5a0..85964988684b 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_err(&pdev->dev, "error in thermal_add_hwmon_sysfs"); + return 0; err_disable_clk_peri_therm: