From patchwork Tue Jan 10 15:17:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 641582 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2D81C678D5 for ; Tue, 10 Jan 2023 15:18:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232845AbjAJPSC (ORCPT ); Tue, 10 Jan 2023 10:18:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233867AbjAJPR6 (ORCPT ); Tue, 10 Jan 2023 10:17:58 -0500 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 837BB5BA2F for ; Tue, 10 Jan 2023 07:17:54 -0800 (PST) Received: by mail-wm1-x32a.google.com with SMTP id l26so9049652wme.5 for ; Tue, 10 Jan 2023 07:17:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=uzboIXLTJPA/CndXjJQee1fr50X0HrhF4nPYCfs1XU0=; b=s2M+4R5+xJ7IBwXCD+r7bYx/xe4B+X65TcB6MadC7llHk9qljXzXPWxb0IzcEGnRm8 +PmCX6alj6KZ9Px81+SFMDjlwRnPFD5UOTT82D9NxHeOSFYs7LgL/c19kGR54PWvrfi8 iCwA6O3RPmy7YPmlW0l7WWG+EFFJ507m6LCDopm9/UmZl+Z/A52fHxf2HpnHIrdFCbeB RCd/znrtNCLNn3++UYSDZBYvIzEBrn0R4UXq0sSRLU32cqntJgdudfflCXHlAfC7pG+n ILpyx1G3j6DCxpGchxQOU0RVQU/LenMoSkKbpTNhneM7U4FMSlK10qT2O1gYhbY2pVYD 9jxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=uzboIXLTJPA/CndXjJQee1fr50X0HrhF4nPYCfs1XU0=; b=cFrT13mxwjIiGg5eRrNFKuCBeXQr420mz8sS9kcGgIxcDz6KNmYfORv0iwsD+xnD8Q a3w5W09szRk2YCLta2pwg6WSKuj+BHJqTgoiEJSlubVAUYyBrIG9Nsul8OC7DZeBLtu3 Qn1yCkj1PXPfCL47gB57pJB0co2rcDscL6oQDplVLJGQWAPcF7kdjVlKfCttnjk+lah8 cNrg4+SvvwuIB+pLOcVIR9/nT7lS1pFYxUN94WKOe87qIFUxYc+PCe6n+q+cSZrAr7F2 Ielww5MbTDzBlBcsORx61zL8uxZnyTppmNEItdEjeDlrZLvB6Mko+iE85ISbZcTRgwRk owDQ== X-Gm-Message-State: AFqh2krTJRZlTyRMQn32qtp9nt/YCe3avL8yvDqoc3ZZ1gjRNaGyAG4J obMbv49GUuMjFksCePHlxdyuKw== X-Google-Smtp-Source: AMrXdXu7O7gUKOxIlAJTx93hk0V+z8hFTJLZE8lDRHKCw9LYY61tcYom+IpefqFPQjV/fkBqrTumEg== X-Received: by 2002:a05:600c:3844:b0:3cf:7dc1:f424 with SMTP id s4-20020a05600c384400b003cf7dc1f424mr49054728wmr.3.1673363872999; Tue, 10 Jan 2023 07:17:52 -0800 (PST) Received: from mai.. (146725694.box.freepro.com. [130.180.211.218]) by smtp.gmail.com with ESMTPSA id p21-20020a7bcc95000000b003c65c9a36dfsm14857281wma.48.2023.01.10.07.17.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 07:17:52 -0800 (PST) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rafael@kernel.org Cc: srinivas.pandruvada@linux.intel.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, rui.zhang@intel.com, christophe.jaillet@wanadoo.fr Subject: [PATCH v4 0/3] Thermal ACPI APIs for generic trip points Date: Tue, 10 Jan 2023 16:17:42 +0100 Message-Id: <20230110151745.2546131-1-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Recently sent as a RFC, the thermal ACPI for generic trip points is a set of functions to fill the generic trip points structure which will become the standard structure for the thermal framework and its users. Different Intel drivers and the ACPI thermal driver are using the ACPI tables to get the thermal zone information. As those are getting the same information, providing this set of ACPI function with the generic trip points will consolidate the code. Also, the Intel PCH and the Intel 34xx drivers are converted to use the generic trip points relying on the ACPI generic trip point parsing functions. These changes have been tested on a Thinkpad Lenovo x280 with the PCH and INT34xx drivers. No regression have been observed, the trip points remain the same for what is described on this system. Changelog: - V4: - Fixed Kconfig option dependency, select THERMAL_ACPI if ACPI is set only for the PCH driver - V3: - Took into account Rafael's comments - Used a silence option THERMAL_ACPI in order to stay consistent with THERMAL_OF. It is up to the API user to select the option. - V2: - Fix the thermal ACPI patch where the thermal_acpi.c was not included in the series - Provide a couple of users of this API which could have been tested on a real system Daniel Lezcano (3): thermal/acpi: Add ACPI trip point routines thermal/drivers/intel: Use generic trip points for intel_pch thermal/drivers/intel: Use generic trip points int340x drivers/thermal/Kconfig | 4 + drivers/thermal/Makefile | 1 + drivers/thermal/intel/Kconfig | 1 + drivers/thermal/intel/int340x_thermal/Kconfig | 1 + .../int340x_thermal/int340x_thermal_zone.c | 177 ++++----------- .../int340x_thermal/int340x_thermal_zone.h | 10 +- drivers/thermal/intel/intel_pch_thermal.c | 88 ++------ drivers/thermal/thermal_acpi.c | 211 ++++++++++++++++++ include/linux/thermal.h | 8 + 9 files changed, 287 insertions(+), 214 deletions(-) create mode 100644 drivers/thermal/thermal_acpi.c