Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp3286388pxb; Tue, 20 Apr 2021 05:08:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxuHMyA4ZcvZNrvvuVP/mZTF64hv1OPcvDC4ujaA0d2Tfyu77o3nx7CambD0bsIfAHtjc3F X-Received: by 2002:a05:6a00:1a0d:b029:25f:7141:cb0 with SMTP id g13-20020a056a001a0db029025f71410cb0mr10064816pfv.44.1618920525545; Tue, 20 Apr 2021 05:08:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618920525; cv=none; d=google.com; s=arc-20160816; b=ZykFR39n6eC0rLUTOxZJ51q+iD2R0b1ZksQ5j7fKraaL7JH/diL1XEBcB+OE7aB2/h IGnzqejwN+NqsTxRLmLxcAE48plQOq0q7+/Tevpttnuw9EM6QWxyeCFF+JdXnAguBGbl zt6blupR7zGpW/u/tgfcjLONIl0vJiYnrvNgzhC+BGKROxzXiMbEjuCz1xmeR3aWVx6g xrI+DU4VJNYq7uxRgIfOV7v2e/nzFWc8ty/zxtW882gVPWk29skKVYYm4bCQY7oLGwdX cSwsb5PBS0uoB8lXazlGj1lPHTdSktbQHzIb0tf8ogzpeY8OmFOsP0jdT5vW+Fy9EpOg o3rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=fdjavbbnG38i/vDHVgTWk3tsDsi63+Qg6p2AfSLSokM=; b=JozMZUU19z+zOyH5vqa9NAyOdCUR3nmvadudm8yTIyRc/syGGmcWdjdpZydb6AQWJQ I1Xv2Xe3hPVJC7gJKjDCmuuiRQbt4j2jXYN9KlwDIbibYm4tUu8c1360Dmzlc3+XHU6i /WQz/rK8eiYzGsVNuK7W8d5q2AemcJzc6mWHaydrDi0mWa+X5H9sQzuyBkpn1pQ6TJlu cbQuKbpY2ZPn0qKib5s/oI7BcUuUPCWduttDVBcsJMBmMw7Sy3pNmWehqPp3YXGMTikl 0wwzUKt5OU4Qi9PZxExxlxPUr/yKqIuUDVQjQqcZsHGTcOdgAjWMaARY6p8GSlJpS4Rf K4aA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RWbQtV2x; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p25si23112105pli.266.2021.04.20.05.08.32; Tue, 20 Apr 2021 05:08:45 -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=@linaro.org header.s=google header.b=RWbQtV2x; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232342AbhDTMHw (ORCPT + 99 others); Tue, 20 Apr 2021 08:07:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231944AbhDTMHv (ORCPT ); Tue, 20 Apr 2021 08:07:51 -0400 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 537A9C06138A for ; Tue, 20 Apr 2021 05:07:20 -0700 (PDT) Received: by mail-wr1-x433.google.com with SMTP id c15so28404678wro.13 for ; Tue, 20 Apr 2021 05:07:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=fdjavbbnG38i/vDHVgTWk3tsDsi63+Qg6p2AfSLSokM=; b=RWbQtV2xG8MQvtq5DQkUl4ClHY7MHwzMjFdlaJqjkzqrAzQwu0/vhsDJPHDqrWrzt5 yxeN4ErznjF7lzZ7E6ugBbEg0SJpEQIk82KoadIqfB/JmGZKj67z/BO2MzI9GKu7xfSV KJkQtAf5s9TAz7ovZgbghlQKOn/zO8MjUjWXh9fG2YiGmYCYRFxclYfFKLXmB3xr4/Em XsU7bkCfjSEAX0buiKDTgIv9ChpTTY2YpHcnisji9/5nbaNkKwqzj1UPQzFExpqZBrdM Q2IgIZF1W3H4ZkQJsUhlXPG4zF7ly8p0rmCSMjkRm+gyz2ruVW8Ysz1BuNn2Uioz8mWg 0Odg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=fdjavbbnG38i/vDHVgTWk3tsDsi63+Qg6p2AfSLSokM=; b=SjcWLpEppBN23e+YhCQUNkK1u+qlfmZfonES1S851QLlYjXQUzB4NhPJbmzLIYpLJe 4ySQGp0fQBsBky+7dwzBtBLwI9Xz27CXcss3QY3uarxh5fkdykOEDlc3bJ/CBgdc2ktl E5o1IzsOakw8pZMTl1Qrvk46Q8RFxt+BMadsQw3qkZFi4vjSBF9B3sF89S9O7MX/7vj1 EmTKk2Kr1lfYtZM2YNw+OZrSGs4zSGlSmQ2OY/Fv6x+gTAsCfmRAs6Yv0dFqzZ3RX9LA 9Aez+X19ix6Mhyf4SsITrGmavr3OSxlJ9okArDPrl828a6TJpLfH1P4xcY7ikQjEC33N /INQ== X-Gm-Message-State: AOAM533GUvLKSxXJdXXbsVNsEtaGi0D7CF+vFw4Ufif/ICPjJC6xfHuC 5nJ+21TAzfqcO7gbVQSEU8NQu/atXrEzZmDw X-Received: by 2002:adf:dd51:: with SMTP id u17mr20088833wrm.32.1618920438781; Tue, 20 Apr 2021 05:07:18 -0700 (PDT) Received: from ?IPv6:2a01:e34:ed2f:f020:a079:f96:da87:2d00? ([2a01:e34:ed2f:f020:a079:f96:da87:2d00]) by smtp.googlemail.com with ESMTPSA id b12sm8989862wmj.1.2021.04.20.05.07.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 20 Apr 2021 05:07:18 -0700 (PDT) Subject: Re: [PATCH] thermal: mediatek: add sensors-support To: Frank Wunderlich , linux-mediatek@lists.infradead.org Cc: Frank Wunderlich , Zhang Rui , Amit Kucheria , Matthias Brugger , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20210320080646.49615-1-linux@fw-web.de> From: Daniel Lezcano Message-ID: Date: Tue, 20 Apr 2021 14:07:13 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20210320080646.49615-1-linux@fw-web.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 20/03/2021 09:06, Frank Wunderlich wrote: > From: Frank Wunderlich > > add HWMON-support to mediateks thermanl driver to allow lm-sensors > userspace tools read soc temperature > > Signed-off-by: Frank Wunderlich > --- > drivers/thermal/mtk_thermal.c | 22 ++++++++++++++++++++++ > 1 file changed, 22 insertions(+) > > diff --git a/drivers/thermal/mtk_thermal.c b/drivers/thermal/mtk_thermal.c > index 149c6d7fd5a0..e22d77d57458 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 > @@ -983,6 +985,13 @@ static void mtk_thermal_release_periodic_ts(struct mtk_thermal *mt, > writel((tmp & (~0x10e)), mt->thermal_base + TEMP_MSRCTL1); > } > > +static void mtk_thermal_hwmon_action(void *data) > +{ > + struct thermal_zone_device *zone = data; > + > + thermal_remove_hwmon_sysfs(zone); > +} > + > static int mtk_thermal_probe(struct platform_device *pdev) > { > int ret, i, ctrl_id; > @@ -1087,6 +1096,19 @@ static int mtk_thermal_probe(struct platform_device *pdev) > goto err_disable_clk_peri_therm; > } > > +#ifdef CONFIG_THERMAL_HWMON No #ifdef in C file. > + tzdev->tzp->no_hwmon = false; > + ret = thermal_add_hwmon_sysfs(tzdev); > + if (ret) > + dev_err(&pdev->dev, "error in thermal_add_hwmon_sysfs"); > + > + ret = devm_add_action(&pdev->dev, mtk_thermal_hwmon_action, tzdev); devm_thermal_add_hwmon_sysfs() ? > + if (ret) { > + dev_err(&pdev->dev, "error in devm_add_action"); > + mtk_thermal_hwmon_action(tzdev); > + } > +#endif > + > return 0; > > err_disable_clk_peri_therm: > -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog