[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240608-cros_ec-hwmon-pwm-v1-4-d29dfc26fbc3@weissschuh.net>
Date: Sat, 08 Jun 2024 10:12:46 +0200
From: Thomas Weißschuh <linux@...ssschuh.net>
To: Benson Leung <bleung@...omium.org>, Tzung-Bi Shih <tzungbi@...nel.org>,
Guenter Roeck <groeck@...omium.org>,
Thomas Weißschuh <thomas@...ssschuh.net>,
Jean Delvare <jdelvare@...e.com>, Guenter Roeck <linux@...ck-us.net>
Cc: Dustin Howett <dustin@...ett.net>,
Mario Limonciello <mario.limonciello@....com>,
Stephen Horvath <s.horvath@...look.com.au>, chrome-platform@...ts.linux.dev,
linux-kernel@...r.kernel.org, linux-hwmon@...r.kernel.org,
Thomas Weißschuh <linux@...ssschuh.net>
Subject: [PATCH 4/5] hwmon: (cros_ec) Split temperature channel params
An upcoming change will add more channel parameters.
This leads to a lot of churn and very long lines.
Use a macro to encapsulate all of the shared values.
Signed-off-by: Thomas Weißschuh <linux@...ssschuh.net>
---
drivers/hwmon/cros_ec_hwmon.c | 50 ++++++++++++++++++++++---------------------
1 file changed, 26 insertions(+), 24 deletions(-)
diff --git a/drivers/hwmon/cros_ec_hwmon.c b/drivers/hwmon/cros_ec_hwmon.c
index 48b7073a4991..5cddf78cfe0e 100644
--- a/drivers/hwmon/cros_ec_hwmon.c
+++ b/drivers/hwmon/cros_ec_hwmon.c
@@ -277,31 +277,33 @@ static const struct hwmon_channel_info * const cros_ec_hwmon_info[] = {
HWMON_PWM_INPUT | HWMON_PWM_ENABLE,
HWMON_PWM_INPUT | HWMON_PWM_ENABLE,
HWMON_PWM_INPUT | HWMON_PWM_ENABLE),
+
+#define CROS_EC_HWMON_TEMP_PARAMS (HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_LABEL)
HWMON_CHANNEL_INFO(temp,
- HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_LABEL,
- HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_LABEL,
- HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_LABEL,
- HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_LABEL,
- HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_LABEL,
- HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_LABEL,
- HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_LABEL,
- HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_LABEL,
- HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_LABEL,
- HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_LABEL,
- HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_LABEL,
- HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_LABEL,
- HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_LABEL,
- HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_LABEL,
- HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_LABEL,
- HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_LABEL,
- HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_LABEL,
- HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_LABEL,
- HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_LABEL,
- HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_LABEL,
- HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_LABEL,
- HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_LABEL,
- HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_LABEL,
- HWMON_T_INPUT | HWMON_T_FAULT | HWMON_T_LABEL),
+ CROS_EC_HWMON_TEMP_PARAMS,
+ CROS_EC_HWMON_TEMP_PARAMS,
+ CROS_EC_HWMON_TEMP_PARAMS,
+ CROS_EC_HWMON_TEMP_PARAMS,
+ CROS_EC_HWMON_TEMP_PARAMS,
+ CROS_EC_HWMON_TEMP_PARAMS,
+ CROS_EC_HWMON_TEMP_PARAMS,
+ CROS_EC_HWMON_TEMP_PARAMS,
+ CROS_EC_HWMON_TEMP_PARAMS,
+ CROS_EC_HWMON_TEMP_PARAMS,
+ CROS_EC_HWMON_TEMP_PARAMS,
+ CROS_EC_HWMON_TEMP_PARAMS,
+ CROS_EC_HWMON_TEMP_PARAMS,
+ CROS_EC_HWMON_TEMP_PARAMS,
+ CROS_EC_HWMON_TEMP_PARAMS,
+ CROS_EC_HWMON_TEMP_PARAMS,
+ CROS_EC_HWMON_TEMP_PARAMS,
+ CROS_EC_HWMON_TEMP_PARAMS,
+ CROS_EC_HWMON_TEMP_PARAMS,
+ CROS_EC_HWMON_TEMP_PARAMS,
+ CROS_EC_HWMON_TEMP_PARAMS,
+ CROS_EC_HWMON_TEMP_PARAMS,
+ CROS_EC_HWMON_TEMP_PARAMS,
+ CROS_EC_HWMON_TEMP_PARAMS),
NULL
};
--
2.45.2
Powered by blists - more mailing lists