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: 11931469 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=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 227E7C56201 for ; Wed, 25 Nov 2020 16:24:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BA6DD2087C for ; Wed, 25 Nov 2020 16:24:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YavSxQY4" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730809AbgKYQYM (ORCPT ); Wed, 25 Nov 2020 11:24:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730747AbgKYQYL (ORCPT ); Wed, 25 Nov 2020 11:24:11 -0500 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDE55C0613D4; Wed, 25 Nov 2020 08:24:11 -0800 (PST) Received: by mail-pf1-x444.google.com with SMTP id x24so2805177pfn.6; Wed, 25 Nov 2020 08:24:11 -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=X294hHSYw+JW2o2oKavxnMqe6lfRAjGrwJIfFpPuUoH7FdR+bnGCOq/QMuVsc3FEXZ wJbl0eZvo8FylYm37g7K17T4SRNy+F86EZAfXpu5ACSvlk21mixgsupu4AFHOB6sk76o hp9cW4XdSar6GB+BHed8Z7jmtXjn4E99/GQydwe2MwTrb4O311KT0iedTfp/52wvO49J NgkubN9s/zJoNUiSCCZ+5UDJhGhz5VF3+6I7aP4/wIV2powN3jR4LpGMuOAj0nH4j+mX VhZPtD4ctfVbAjL04ofTlb4II0620ECFAUWOFMbb02bn/zW0GRwFYklqBDg4fW54foNh HPwQ== X-Gm-Message-State: AOAM531QkS1+D6I9g8rnTQrZvGXFQsBKLaEfDgmTD7yRZOz4Ps0ixIIO AMBv6cypowGdCYZ37YK0Z3U= 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 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.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;