From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: rjw@rjwysocki.net
Cc: daniel.lezcano@linaro.org, linux-acpi@vger.kernel.org,
linux-pm@vger.kernel.org, "Rafael J. Wysocki" <rafael@kernel.org>,
Zhang Rui <rui.zhang@intel.com>, Len Brown <lenb@kernel.org>,
linux-kernel@vger.kernel.org (open list)
Subject: [PATCH v2 02/11] thermal/acpi: Change to a common acpi_thermal_trip structure
Date: Fri, 3 Feb 2023 18:44:20 +0100 [thread overview]
Message-ID: <20230203174429.3375691-3-daniel.lezcano@linaro.org> (raw)
In-Reply-To: <20230203174429.3375691-1-daniel.lezcano@linaro.org>
The acpi trip point definition are very similar whatever their
types. Instead of creating a different structure for each trip type,
let's define and use a common one.
With this change we move a step forward to the generic trip point.
No functional changes.
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
drivers/acpi/thermal.c | 35 ++++++-----------------------------
1 file changed, 6 insertions(+), 29 deletions(-)
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index 0dbce190cacc..e27b0b71fcf8 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -119,36 +119,13 @@ struct acpi_thermal_state_flags {
u8 reserved:6;
};
-struct acpi_thermal_critical {
- struct acpi_thermal_state_flags flags;
- unsigned long temperature;
-};
-
-struct acpi_thermal_hot {
- struct acpi_thermal_state_flags flags;
- unsigned long temperature;
-};
-
-struct acpi_thermal_passive {
+struct acpi_thermal_trip {
struct acpi_thermal_state_flags flags;
+ struct acpi_handle_list devices;
unsigned long temperature;
unsigned long tc1;
unsigned long tc2;
unsigned long tsp;
- struct acpi_handle_list devices;
-};
-
-struct acpi_thermal_active {
- struct acpi_thermal_state_flags flags;
- unsigned long temperature;
- struct acpi_handle_list devices;
-};
-
-struct acpi_thermal_trips {
- struct acpi_thermal_critical critical;
- struct acpi_thermal_hot hot;
- struct acpi_thermal_passive passive;
- struct acpi_thermal_active active[ACPI_THERMAL_MAX_ACTIVE];
};
struct acpi_thermal_flags {
@@ -166,10 +143,10 @@ struct acpi_thermal {
volatile u8 zombie;
struct acpi_thermal_flags flags;
struct acpi_thermal_state state;
- struct acpi_thermal_critical critical;
- struct acpi_thermal_hot hot;
- struct acpi_thermal_passive passive;
- struct acpi_thermal_active active[ACPI_THERMAL_MAX_ACTIVE];
+ struct acpi_thermal_trip critical;
+ struct acpi_thermal_trip hot;
+ struct acpi_thermal_trip passive;
+ struct acpi_thermal_trip active[ACPI_THERMAL_MAX_ACTIVE];
struct acpi_handle_list devices;
struct thermal_zone_device *thermal_zone;
int kelvin_offset; /* in millidegrees */
--
2.34.1
next prev parent reply other threads:[~2023-02-03 17:44 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20230203174429.3375691-1-daniel.lezcano@linaro.org>
2023-02-03 17:44 ` [PATCH v2 01/11] thermal/acpi: Remove the intermediate " Daniel Lezcano
2023-02-03 17:44 ` Daniel Lezcano [this message]
2023-02-03 17:44 ` [PATCH v2 03/11] thermal/acpi: Convert the acpi thermal trips to an array Daniel Lezcano
2023-02-03 17:44 ` [PATCH v2 04/11] thermal/acpi: Move the active trip points to the same array Daniel Lezcano
2023-02-03 17:44 ` [PATCH v2 05/11] thermal/acpi: Optimize get_trip_points() Daniel Lezcano
2023-02-03 17:44 ` [PATCH v2 06/11] thermal/acpi: Encapsulate in functions the trip initialization Daniel Lezcano
2023-02-03 17:44 ` [PATCH v2 07/11] thermal/acpi: Simplifify the condition check Daniel Lezcano
2023-02-03 17:44 ` [PATCH v2 08/11] thermal/acpi: Remove active and enabled flags Daniel Lezcano
2023-02-03 17:44 ` [PATCH v2 09/11] thermal/acpi: Convert the units to milli Celsuis Daniel Lezcano
2023-02-03 17:44 ` [PATCH v2 10/11] thermal/acpi: Rewrite the trip point intialization to use the generic thermal trip Daniel Lezcano
2023-02-03 17:44 ` [PATCH v2 11/11] thermal/acpi: Use the thermal framework ACPI API Daniel Lezcano
2023-02-04 5:10 ` kernel test robot
2023-02-04 7:54 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230203174429.3375691-3-daniel.lezcano@linaro.org \
--to=daniel.lezcano@linaro.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=rjw@rjwysocki.net \
--cc=rui.zhang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®