From patchwork Mon Dec 12 20:58:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 2888 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2463028wrr; Mon, 12 Dec 2022 13:01:58 -0800 (PST) X-Google-Smtp-Source: AA0mqf7lYaVL4EyuT8IsfUEI2FoYo3lGgoLZKzL0mPS+QXntTfzPYuG95kw02THfV9bz9pvVLoBr X-Received: by 2002:a17:906:4ccc:b0:7aa:7598:128c with SMTP id q12-20020a1709064ccc00b007aa7598128cmr13548486ejt.37.1670878917939; Mon, 12 Dec 2022 13:01:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670878917; cv=none; d=google.com; s=arc-20160816; b=s6SwJJ2do6K3xkScoiFCAYzVRVx+IrIdxn+CGjj1iJMJCYeQ5CyamIdp+cfY876bn9 Pqcj/F3GNC0sCz4/n9ctkiWc+Pm4fdeBQbAgCQwrwdH0ZUTCoRtQ9Dj1Ku01tz8mMObw h7w7WRbWTFBTDdhNgqnNbAQM61DnbwophUHCuOUQM2TxZyV9eQznBDdskTOVAGCXctnj N9Fr8kA45QLXmMjBzgBjvgKatw4YyG0bOfYWYWaM4fhutK91q7+5IFIoVBZ4eF9WePOd dXlya3awSV4bFKH9dS/GcS211Zs6+3JgHda9BYItDq2eqMVKSXDk191RGll294EuTuzD g6yQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=a+MGbDKBj7Xl7l5uM094vkfbwnyYsqUfMcbA7UwcKv8=; b=dF8Sh5SB1/8v0/kgi95fAwSklsN3N5rwlfg6zVD9tll5wOXGRv5qlF8hD81RwZvJ+Z 8EG5ZH1kwOnQxlxPLycKYvErPHqkM6B03l14MTeZIGuSfX6S6bImaW3r00lhE4rdeDqL 9jrloyeH+FCtXUjBXGUp6wp41BfN+9LdIgmkvXRlKfuwyOXscr/8qFYWJw3LenltzhjK OkjnFBshAm707vZbLAI4+VTv/HnzWhHD19xwhRBr/Y4CyCgbTFYC4sGV7T2pn3T9+saY R/gc3A34WlifXeqhV3Gp0rPDduzaFdAhvCfU95TW1FkSw7FOXgZY8YJmtczjPcaJJWhs RPcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SjzaM+2b; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mb6-20020a170906eb0600b007ad8480304dsi5898839ejb.350.2022.12.12.13.01.34; Mon, 12 Dec 2022 13:01:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SjzaM+2b; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232318AbiLLU7H (ORCPT + 99 others); Mon, 12 Dec 2022 15:59:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233333AbiLLU7A (ORCPT ); Mon, 12 Dec 2022 15:59:00 -0500 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D575183B0 for ; Mon, 12 Dec 2022 12:58:59 -0800 (PST) Received: by mail-wm1-x333.google.com with SMTP id f13-20020a1cc90d000000b003d08c4cf679so6391712wmb.5 for ; Mon, 12 Dec 2022 12:58:59 -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=a+MGbDKBj7Xl7l5uM094vkfbwnyYsqUfMcbA7UwcKv8=; b=SjzaM+2btuSfkz8AWjTFtJVlZybj7rrPB8boF2vBrq6CoOeSDTJM2TanyGG3gHUPxM 9xKuUgrxCd5hNCIlt54LCR4iyRuyIRrD8PhjqHKSgrmXxfphQ9MNAHy9Wa7SJGjtqIiF RioGfFSNNXP62D/EHsrdMwMoQgW0LON+6zbwYdE+BZMQ1asjMT1hfPXh/r3e599EM2OE YxxYWKDtS1bhoIL0zJfnfpQviqh/G8xmsPh6B4kzLOVejq6E3/HV6t1+VG9nSpsgYfRt 6YUWQKH5msz7cZA/c/exg2tTfgHS53yy2XQctjaaH34iLI2qzsHWGAvcZuqj+pBwR2pE 7lCg== 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=a+MGbDKBj7Xl7l5uM094vkfbwnyYsqUfMcbA7UwcKv8=; b=X+7iwpyBmg/UGQE6GbcCeiCSH+XI4kV2zOL/BP185QJGRQ+SzuV9MzVNou0bsBrTVY v//taj2wNPFaJ/A92QGbgtXStgwdiL60AXckffFM3kaiuum6SrlsWbzsOcjvfUQQLGKg Ry3YD34bLcpXtg5K7vEB60buIt/HgC+JUP10QQMSOPk4v5sKxhmwT73DRwAnsQ//bQjO nSqKT1r11JmVNgrjfOz0nOLBuGTKG/Ypz/x1a+RkKP9g/xM0I3Sf0013WpFQkBEBK5/z MBVP3Tcb9zLf6RNYukxXB1AwA7Fmlw5JUkl4VizjKG7Ed+nQzrxtynNNbUit9jrDOANZ QMlw== X-Gm-Message-State: ANoB5plAXCdyYSk9OXGop4JnB+1i+F+hErfV+Vq4XqJvlMHEUBkXeG9Q 0JGqXK/R2nGeDNcLZJntn4LMJw== X-Received: by 2002:a1c:f216:0:b0:3cf:87c6:890e with SMTP id s22-20020a1cf216000000b003cf87c6890emr14161784wmc.27.1670878737858; Mon, 12 Dec 2022 12:58:57 -0800 (PST) Received: from mai.. (146725694.box.freepro.com. [130.180.211.218]) by smtp.gmail.com with ESMTPSA id t123-20020a1c4681000000b003a3170a7af9sm10537201wma.4.2022.12.12.12.58.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Dec 2022 12:58:57 -0800 (PST) From: Daniel Lezcano X-Google-Original-From: Daniel Lezcano To: rafael@kernel.org, srinivas.pandruvada@linux.intel.com Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/5] Add ACPI trip points parser helpers Date: Mon, 12 Dec 2022 21:58:38 +0100 Message-Id: <20221212205843.3119407-1-daniel.lezcano@kernel.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752043532427386470?= X-GMAIL-MSGID: =?utf-8?q?1752043532427386470?= Regarding thermal, the ACPI code parsing the trip points is duplicated inside different Intel drivers. The generic ACPI thermal driver also duplicates this code. Those ACPI parsing actions are used to define trip points and these ones are defined by, and specific to, the backend driver. The different get_trip_* ops, also very similar between each other, are using the specific trip point structure to return the requested trip point information. From there, there is nothing new, all this can be converted to the generic trip point. The first patch provides the functions to parse trip point description from the ACPI table but based on the generic trip point structure. The other patches convert the different Intel driver to use the ACPI functions along with a migration to the generic trip point. Daniel Lezcano (5): 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 thermal/drivers/intel: Use generic trip points for quark_dts thermal/drivers/intel: Use generic trip points for processor_thermal_device_pci drivers/thermal/Kconfig | 13 + drivers/thermal/Makefile | 1 + .../int340x_thermal/int340x_thermal_zone.c | 175 +++--------- .../int340x_thermal/int340x_thermal_zone.h | 10 +- .../processor_thermal_device_pci.c | 53 ++-- drivers/thermal/intel/intel_pch_thermal.c | 88 ++----- .../thermal/intel/intel_quark_dts_thermal.c | 45 ++-- drivers/thermal/thermal_acpi.c | 249 ++++++++++++++++++ include/linux/thermal.h | 15 ++ 9 files changed, 377 insertions(+), 272 deletions(-) create mode 100644 drivers/thermal/thermal_acpi.c