From patchwork Tue Apr 7 17:49:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Pietrasiewicz X-Patchwork-Id: 11478531 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 BFD3F913 for ; Tue, 7 Apr 2020 17:50:46 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 9A7A42075E for ; Tue, 7 Apr 2020 17:50:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="noyjiOBH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9A7A42075E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=n8Cd0UbZnClA83Dj2HA2Zd5Qcv0A3rZLMT3mGRIaoJU=; b=noyjiOBHK/lIJBUw+lSvN4HowN wP85sQcUWpmhcaUK/1aXFPWOHaZSJ8CcAYdcIJNCEdoPh8Z9qqJZOYLzfiz5v1ewONPTTe2Zikc6V Klt1sxWVli5PTuC1e0Mzr0OmuJAvLYETjBvlxK4si4y9ZxVtauOlHPEY6w6hmqetuD85r4sg5twua ebtT4H1+73Co/q2i3zl/5FrznBov/wf6dVnQKEi0KDVWqOMcDB2Hff1a8/JG8YTh8iO8AdbKbDosl iKHtq0izOsJH2wYhvMoZIldRcoU4/Mm0wkdLXc9gTLSHmF/9K4yAvVuqr2wnMx8M2c7B64IHvoXjo niKJKSDg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jLsN1-0002XX-7S; Tue, 07 Apr 2020 17:50:43 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jLsM6-0007at-Io for linux-arm-kernel@lists.infradead.org; Tue, 07 Apr 2020 17:49:48 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: andrzej.p) with ESMTPSA id 53C822972A7 From: Andrzej Pietrasiewicz To: linux-pm@vger.kernel.org Subject: [RFC 4/8] thermal: core: Introduce THERMAL_DEVICE_INITIAL Date: Tue, 7 Apr 2020 19:49:22 +0200 Message-Id: <20200407174926.23971-5-andrzej.p@collabora.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200407174926.23971-1-andrzej.p@collabora.com> References: <20200407174926.23971-1-andrzej.p@collabora.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200407_104946_779220_D2D92D72 X-CRM114-Status: UNSURE ( 9.61 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [46.235.227.227 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Rafael J . Wysocki" , platform-driver-x86@vger.kernel.org, kernel@collabora.com, Fabio Estevam , Amit Kucheria , Daniel Lezcano , linux-acpi@vger.kernel.org, NXP Linux Team , Darren Hart , Zhang Rui , Gayatri Kammela , Len Brown , Sascha Hauer , Ido Schimmel , Jiri Pirko , Thomas Gleixner , Allison Randal , linux-arm-kernel@lists.infradead.org, Support Opensource , Shawn Guo , Peter Kaestle , Andrzej Pietrasiewicz , Pengutronix Kernel Team , netdev@vger.kernel.org, Enrico Weigelt , "David S . Miller" , Andy Shevchenko MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add a new mode: THERMAL_DEVICE_INITIAL. It is dedicated to handle devices which must be initially DISABLED, but which are polled at startup nonetheless. THERMAL_DEVICE_INITIAL shall be reported as "enabled" in sysfs to keep the userspace interface intact. Signed-off-by: Andrzej Pietrasiewicz --- drivers/thermal/thermal_sysfs.c | 4 ++-- include/linux/thermal.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/thermal/thermal_sysfs.c b/drivers/thermal/thermal_sysfs.c index aa99edb4dff7..6bfef21abce4 100644 --- a/drivers/thermal/thermal_sysfs.c +++ b/drivers/thermal/thermal_sysfs.c @@ -59,8 +59,8 @@ mode_show(struct device *dev, struct device_attribute *attr, char *buf) if (result) return result; - return sprintf(buf, "%s\n", mode == THERMAL_DEVICE_ENABLED ? "enabled" - : "disabled"); + return sprintf(buf, "%s\n", mode == THERMAL_DEVICE_DISABLED ? "disabled" + : "enabled"); } static ssize_t diff --git a/include/linux/thermal.h b/include/linux/thermal.h index 126913c6a53b..1bc6b7998093 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -48,8 +48,9 @@ struct thermal_cooling_device; struct thermal_instance; enum thermal_device_mode { - THERMAL_DEVICE_DISABLED = 0, + THERMAL_DEVICE_INITIAL = 0, THERMAL_DEVICE_ENABLED, + THERMAL_DEVICE_DISABLED, }; enum thermal_trip_type {