Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5612426ybl; Tue, 10 Dec 2019 08:43:32 -0800 (PST) X-Google-Smtp-Source: APXvYqwOc1Cj40JfF+0lbYFBiDu2COe639g6IKQjgSqiZmcJMyDzpu8GLyOcOplz2MP/u0TCRuSB X-Received: by 2002:a05:6808:1c5:: with SMTP id x5mr4931255oic.57.1575996212153; Tue, 10 Dec 2019 08:43:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575996212; cv=none; d=google.com; s=arc-20160816; b=ZiQinhaeO0Rff0uRqpiFT0amWBNQtqKckhGv8sJgeqQlqw3Hb6fK6Q31sAGzkA3N/6 58N5AelwFMx2IchpXYhkHU7TFy2alDgAm7RPct5XJE2qQYxXJteFwxgtE/aG21digNo2 o+cVAL15OZbhDBiTZR9jjjAc8iXdgKu59urW2YNC8UhP3CgNRhRZgpeVPg7YRYOdYm0E SuswEOaeIs2T6XozoNWSQiVTyZnve26JK17R87HXJfq6U+aGMRGdao+UQb94uWX54DPv SXBoovv4VBqexxE8VGX9SkmMzsijGReBgn0MCbjP906gVrhA2rOdOkbmyDPI+DlPoDIx E+gQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=U90+xxPa/n6CEWdGb92kTN2mRHFkhOKFhP+vKnVn8pU=; b=X4Tm9YubNja6SAEXFA++3xiPbta5VLMm+pMjjAVD6Xp7WTK17D7e4dVtQD57re5GWu 5NdoK4DdjLDIAzoE+1Deeaf+/C+IvatA6s+iCTrIaEdODAcgnncVlKpD9K6HxHb9qXNL vc2UI+KtRb7h7/o4rlOmc9rCrL03wfsvDmqtxZzQgPgypTlLwOKGocd1H4/9Opgalj/4 n8uQPjNK7uqL8i6WRpG00+QsVl6O7smaNP1wMdHjBM1TpY5HiYCt5F+VsVntLeV6g4Oz 21Au6XcdhOyD58c0sKnwxrQeZl9w8CBnQiI2rw3TARwwqqoHpEeWdUKuRZufl5KQpOiy DYPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ga+8gM7y; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y8si2223295otg.309.2019.12.10.08.43.19; Tue, 10 Dec 2019 08:43:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ga+8gM7y; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727866AbfLJQma (ORCPT + 99 others); Tue, 10 Dec 2019 11:42:30 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:35274 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727831AbfLJQm2 (ORCPT ); Tue, 10 Dec 2019 11:42:28 -0500 Received: by mail-pf1-f194.google.com with SMTP id b19so126731pfo.2; Tue, 10 Dec 2019 08:42:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=U90+xxPa/n6CEWdGb92kTN2mRHFkhOKFhP+vKnVn8pU=; b=ga+8gM7y0/a7dq8h7Be7uego7Viw+xRA4OAMvc8ASgW2a/Ugh5/sGxd2g+uaSYRNmq fqYAUgo5R3hQWYC8S6daWKT4SJZrDKv9CRhN8o7rne8oSWovy6DIxNaheBvFJWerApSU 6Mzg8h+BoufdPRY4Dl0aRCqlaTI7YA99ndFzTNU9DPmT5eK4OWGz/7oj4FPLdO70a1i7 W6awMxhNGDcTjeUq+xY6cniGqZqsFIbidlJq7NntjMV0RU9/E0q52KndT2C8mCz3Lh3Q k5VX8/aVTT1Fi1ZdneHBVhaNX8z3Djz+jNH1J6SHVWRjex4QXBRnxVnotR6kp6ASw8T/ D+IA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=U90+xxPa/n6CEWdGb92kTN2mRHFkhOKFhP+vKnVn8pU=; b=gXlqgDy80gld2MVfrRyUBfOTZ9rQcrUpjQLhJyXJ54lFVcp48dCazn82FhkNxZ197x eIg+Rvd0sjYGNDMOD9KeRzhEJKd/DhKe/VWJS2Kjs2Z5MtNOp+2H9L+OYVSB727L3tn7 prAyB+T5abb/vNvKnSodJE+7Bu24HPc66pDGF3lUo8pW0DjucTUhuXLoZdH7lxbg7aF/ m80OvavBRiJe8p/NNy00i3ZM6K/9HtMKdIFCsiQSDI5+/ABs9QMktsF+LlUyUaWYv/TP 1e6p611YvqA8suhqQOzHt9Wlb1Ayuc4l0N1/ek01Rm/3SogeP9qHzHdPNCleMfcMe/Uk W9HA== X-Gm-Message-State: APjAAAWU6M8wajj0M2K6FXV7r2KSYugWQGirexc4V1mjn86V7CyxpztM 6nOno3M4MA+0F9muw15V3LA= X-Received: by 2002:a63:4f64:: with SMTP id p36mr26649705pgl.271.1575996148068; Tue, 10 Dec 2019 08:42:28 -0800 (PST) Received: from localhost.localdomain (c-67-165-113-11.hsd1.wa.comcast.net. [67.165.113.11]) by smtp.gmail.com with ESMTPSA id j38sm4034634pgj.27.2019.12.10.08.42.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2019 08:42:26 -0800 (PST) From: Andrey Smirnov To: Daniel Lezcano Cc: Andrey Smirnov , Lucas Stach , Chris Healy , Eduardo Valentin , Angus Ainslie , linux-imx@nxp.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v8 12/12] thermal: qoriq: Add hwmon support Date: Tue, 10 Dec 2019 08:41:53 -0800 Message-Id: <20191210164153.10463-13-andrew.smirnov@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191210164153.10463-1-andrew.smirnov@gmail.com> References: <20191210164153.10463-1-andrew.smirnov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Expose thermal readings as a HWMON device, so that it could be accessed using lm-sensors. Signed-off-by: Andrey Smirnov Reviewed-by: Daniel Lezcano Tested-by: Lucas Stach Cc: Chris Healy Cc: Lucas Stach Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: Angus Ainslie (Purism) Cc: linux-imx@nxp.com Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/thermal/qoriq_thermal.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/thermal/qoriq_thermal.c b/drivers/thermal/qoriq_thermal.c index b684d3ceda69..b75d34e07da5 100644 --- a/drivers/thermal/qoriq_thermal.c +++ b/drivers/thermal/qoriq_thermal.c @@ -13,6 +13,7 @@ #include #include "thermal_core.h" +#include "thermal_hwmon.h" #define SITES_MAX 16 #define TMR_DISABLE 0x0 @@ -139,6 +140,11 @@ static int qoriq_tmu_register_tmu_zone(struct device *dev, regmap_write(qdata->regmap, REGS_TMR, TMR_DISABLE); return ret; } + + if (devm_thermal_add_hwmon_sysfs(tzd)) + dev_warn(dev, + "Failed to add hwmon sysfs attributes\n"); + } return 0; -- 2.21.0