From patchwork Wed Nov 25 16:24:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dongjin Kim X-Patchwork-Id: 11931451 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 231E115E6 for ; Wed, 25 Nov 2020 16:24:34 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 D2393207BC for ; Wed, 25 Nov 2020 16:24:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="nVEa8NbK"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YavSxQY4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D2393207BC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe :List-Id:MIME-Version:Message-ID:Subject:To:From:Date:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Owner; bh=39fbVXzGcRKL9i1d+XhgUEtN2uR7xXXlnvxDjFaVlmc=; b=nVEa8NbKXJPjA3ACHNGfaF5gLW ICKDUBO3HEJ9otuzQeRFJ1DGMOdFUu8ABIwszvdfaSjUXiLhtXZLmEjb4NqBIvo7n4UXBiG6bFwsC Gqzi5gMS1cuFl8TIOXu5+PcilOKkI7a0J4GNv0UGNT6/4qTtp8QK+4ZRairVVTYQwxzf/yx9NL0HY ciAyx2kEAwkOijsqUO0iXcGwXrQ/bUbboZ/3L7r6Do5aMm6R48knrPjh7wnaQN8vepUFQybIECZTZ zRIabJqUXuuxpIKXJvXNVMyHw3Sf/KOByr1dZbgBG2isBoXKR8VOHSarvv/9bRwcELv9r5Hk3E0Lm falhSwmg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1khxac-0000yK-4X; Wed, 25 Nov 2020 16:24:18 +0000 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1khxaZ-0000wJ-W4 for linux-amlogic@lists.infradead.org; Wed, 25 Nov 2020 16:24:16 +0000 Received: by mail-pg1-x543.google.com with SMTP id k11so193867pgq.2 for ; Wed, 25 Nov 2020 08:24:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version:content-disposition; bh=3+3gfHD91/328qfooN+OsmJ9PHiYPgpjIR8tzOiYBHo=; b=YavSxQY4iVhrdX0h9CXAQtfQY3M/lSfjiujDt3l6QkRWufd91bgIX9sSzVy/CJPQrq O5CBFNRz30U5BB2MtV0PC7AlA7DIr1/WCYNY6O5N3bDGVQzIb2auyr/opkOZ/7bHa9CW LQ4zKVgVpfc30Ou7esFAYnagn3CYfwnMQKlvKuJ+QFnmEaluVp/REQeVECsmrJnWeaYC iKC4so2wF9PdUkTGZrRwc7unrzLxFU3jCjfaiaHM0J99PfhqD/vuk5pUuRTxtySIVsMI cPUwyixg1xr3OpqZ8pW6FqcXtNq3aKrjc6ySOfwHdPX7pwyikvv8a7p1OwmraJD0fF0a 8frQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition; bh=3+3gfHD91/328qfooN+OsmJ9PHiYPgpjIR8tzOiYBHo=; b=sV0IAdBM9KFLXl0rdySa2SVOfhy+8QWc47ciOgKbxGgsqBZO2oWhHcdqG6DWGp+9Ux 5IY5m4/8cZpbvKhuXpC4a3gDbb6A/17+0lj1sFSGfK2YuNOMk84yn44h7CTcTBA+bEgm IhMTqUcFflB8gHM9DvEaDoLOvmxkuc1WVhRE56VB7ajxZ7P+B2S3A1NAR/Gd/WSR+TUK VZBeGnQgw0OAlLTpVivyPNSBQT2TZQ0G3Y2sy1sWD7gRJAc4GMIwIe9PV7fxdSvvNWSk k+ewoWZJn2bsKQy4bkMXvA2upOHFRlAMMlp5Kfu8p8ICqjjjntdORT/He84tt6m4AyfT NvVA== X-Gm-Message-State: AOAM532euq5txxbU0PK/HX5tk4DaMusSsXE/21ZQ68/j/xuubZ4tTwKu mwNYeCeV/lv+c6jMrv/Gt0Y= X-Google-Smtp-Source: ABdhPJxClJOLijc/qN4Y2TsUHFrwBBO/dNGfLQT1DiaRCkxu34lVJljgWO/JNiNtq4Nwes8TWw/gNw== X-Received: by 2002:a62:61c2:0:b029:197:f5ee:6ffa with SMTP id v185-20020a6261c20000b0290197f5ee6ffamr3134826pfb.18.1606321451401; Wed, 25 Nov 2020 08:24:11 -0800 (PST) Received: from paju ([116.124.119.85]) by smtp.gmail.com with ESMTPSA id e4sm2613862pfh.90.2020.11.25.08.24.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Nov 2020 08:24:10 -0800 (PST) Date: Thu, 26 Nov 2020 01:24:05 +0900 From: Dongjin Kim To: Guillaume La Roque , Zhang Rui , Daniel Lezcano , Amit Kucheria , linux-pm@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] thermal: amlogic_thermal: Add hwmon support Message-ID: <20201125162405.GA1263100@paju> MIME-Version: 1.0 Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201125_112416_062650_F7E86CBB X-CRM114-Status: GOOD ( 11.63 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:543 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [tobetter[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org Expose Amlogic thermal as HWMON devices. $ sensors cpu_thermal-virtual-0 Adapter: Virtual device temp1: +32.2 C (crit = +110.0 C) ddr_thermal-virtual-0 Adapter: Virtual device temp1: +33.4 C (crit = +110.0 C) Signed-off-by: Dongjin Kim --- drivers/thermal/amlogic_thermal.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/thermal/amlogic_thermal.c b/drivers/thermal/amlogic_thermal.c index ccb1fe18e993..2fce96c32586 100644 --- a/drivers/thermal/amlogic_thermal.c +++ b/drivers/thermal/amlogic_thermal.c @@ -29,6 +29,7 @@ #include #include "thermal_core.h" +#include "thermal_hwmon.h" #define TSENSOR_CFG_REG1 0x4 #define TSENSOR_CFG_REG1_RSET_VBG BIT(12) @@ -291,6 +292,9 @@ static int amlogic_thermal_probe(struct platform_device *pdev) if (ret) return ret; + if (devm_thermal_add_hwmon_sysfs(pdata->tzd)) + dev_warn(&pdev->dev, "failed to add hwmon sysfs attributes\n"); + ret = amlogic_thermal_enable(pdata); return ret;