Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp3538217pxb; Tue, 20 Apr 2021 10:24:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5u6Qn+A34NI3MubpNmQ1xUVW60YkZ47gUZvJ2V/I9AgjRkjk+VZI0g+o+uYc1s7WBmtPg X-Received: by 2002:a05:6402:51d0:: with SMTP id r16mr30243066edd.52.1618939472704; Tue, 20 Apr 2021 10:24:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618939472; cv=none; d=google.com; s=arc-20160816; b=rj+7VRCw+aFPSAEeqghAVg8RWbhKoXiFZ7xzd1JMWjBwAiL3e7G/qOsQVZ89wh69T8 V9NvqpAv46q7YsTdv1HCyK6Tzc4JDMgiY3wpiQ441piBwwEtdmjLKvpKMaVWTly1Qcgb v9CfCZf9QXQWlnLz/mJAv4KfyzQSSk/NxHgkFkoc7cnXVGlNHD1rEYXhvqlbBWhDMopi irscvTRq8si+aPWH8RjzPNSxT0XuzVp609fiti9njKiiD1H5Ish72nFOTcAiCGy3FsCo sL+7NLvre2BDj9bJGkYkYlO4EpAmMFqLrSqUbpoAsCNmfF7jUmdNFpm96KMhViCnBMro 1rFw== 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=u2UmPgWhv8jDff+sft2q0VUDxc4XXaa5vanqClNiNS8=; b=Fc4ui0PAXY0qdsW7eY2c5MZZafRtx+Zy+gV9jdRzVti80OukP7xuUhmocTcknid599 ERvCsiwc10qN89i4U8sHsEnpTSuPI6Fb2WzOd1OpIoz+Xn6rcZrbwKYGtrAQc4ylEWbm GjqhciTo3o7cwUvcbVduYJCGEZ8cJZKkm5yz4EBJK0jCbzka0deogQ7Sgu115dw3h3XZ 9sl4DuNFPmdL8KP3T36wcPwfp/4Dom4Wy3Ab1RIdKkeJhLvTexiFPUMo0CBxINZCaAfO IIowi+PWfcChIUWoswRPOMlnhLPkjPTkPEnnbGchIBeV1D2U/vkIn5jTrTRDy8MATarX aIkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mailerdienst.de header.s=20200217 header.b=ehOsyo0U; 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 bi22si16201093edb.191.2021.04.20.10.24.07; Tue, 20 Apr 2021 10:24:32 -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=ehOsyo0U; 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 S233362AbhDTRXq (ORCPT + 99 others); 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 Content-Transfer-Encoding: 8bit X-Mail-ID: 10d04dc0-d980-42d8-8607-1dad480fb628 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 --- 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: -- 2.25.1