Linux Hardware Monitor development
 help / color / mirror / Atom feed
From: "Václav Kubernát" <kubernat@cesnet.cz>
To: unlisted-recipients:; (no To-header on input)
Cc: "Václav Kubernát" <kubernat@cesnet.cz>,
	"Jean Delvare" <jdelvare@suse.com>,
	"Guenter Roeck" <linux@roeck-us.net>,
	"Jonathan Corbet" <corbet@lwn.net>,
	linux-hwmon@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 5/7] hwmon: (max31790) Refactor HWMON_CHANNEL_INFO
Date: Thu,  4 Mar 2021 11:58:28 +0100	[thread overview]
Message-ID: <20210304105830.507176-5-kubernat@cesnet.cz> (raw)
In-Reply-To: <20210304105830.507176-1-kubernat@cesnet.cz>

The line was starting to get a little long.

Signed-off-by: Václav Kubernát <kubernat@cesnet.cz>
---
 drivers/hwmon/max31790.c | 37 +++++++++++++++++++++++++------------
 1 file changed, 25 insertions(+), 12 deletions(-)

diff --git a/drivers/hwmon/max31790.c b/drivers/hwmon/max31790.c
index fde08c95d942..d4f259dd4e19 100644
--- a/drivers/hwmon/max31790.c
+++ b/drivers/hwmon/max31790.c
@@ -56,6 +56,19 @@
 #define U16_MSB(num)			(((num) & 0xFF00) >> 8)
 #define U16_LSB(num)			((num) & 0x00FF)
 
+#define FAN_INFO_1_TO_6 \
+	(HWMON_F_PULSES | \
+	HWMON_F_ENABLE | \
+	HWMON_F_INPUT | \
+	HWMON_F_TARGET | \
+	HWMON_F_FAULT)
+
+#define FAN_INFO_7_TO_12 \
+	(HWMON_F_PULSES | \
+	HWMON_F_ENABLE | \
+	HWMON_F_INPUT | \
+	HWMON_F_FAULT)
+
 static const struct regmap_range max31790_ro_range = {
 	.range_min = MAX31790_REG_TACH_COUNT(0),
 	.range_max = MAX31790_REG_PWMOUT(0) - 1,
@@ -513,18 +526,18 @@ static umode_t max31790_is_visible(const void *data,
 
 static const struct hwmon_channel_info *max31790_info[] = {
 	HWMON_CHANNEL_INFO(fan,
-		HWMON_F_PULSES | HWMON_F_ENABLE | HWMON_F_INPUT | HWMON_F_TARGET | HWMON_F_FAULT,
-		HWMON_F_PULSES | HWMON_F_ENABLE | HWMON_F_INPUT | HWMON_F_TARGET | HWMON_F_FAULT,
-		HWMON_F_PULSES | HWMON_F_ENABLE | HWMON_F_INPUT | HWMON_F_TARGET | HWMON_F_FAULT,
-		HWMON_F_PULSES | HWMON_F_ENABLE | HWMON_F_INPUT | HWMON_F_TARGET | HWMON_F_FAULT,
-		HWMON_F_PULSES | HWMON_F_ENABLE | HWMON_F_INPUT | HWMON_F_TARGET | HWMON_F_FAULT,
-		HWMON_F_PULSES | HWMON_F_ENABLE | HWMON_F_INPUT | HWMON_F_TARGET | HWMON_F_FAULT,
-		HWMON_F_PULSES | HWMON_F_ENABLE | HWMON_F_INPUT | HWMON_F_FAULT,
-		HWMON_F_PULSES | HWMON_F_ENABLE | HWMON_F_INPUT | HWMON_F_FAULT,
-		HWMON_F_PULSES | HWMON_F_ENABLE | HWMON_F_INPUT | HWMON_F_FAULT,
-		HWMON_F_PULSES | HWMON_F_ENABLE | HWMON_F_INPUT | HWMON_F_FAULT,
-		HWMON_F_PULSES | HWMON_F_ENABLE | HWMON_F_INPUT | HWMON_F_FAULT,
-		HWMON_F_PULSES | HWMON_F_ENABLE | HWMON_F_INPUT | HWMON_F_FAULT),
+		FAN_INFO_1_TO_6,
+		FAN_INFO_1_TO_6,
+		FAN_INFO_1_TO_6,
+		FAN_INFO_1_TO_6,
+		FAN_INFO_1_TO_6,
+		FAN_INFO_1_TO_6,
+		FAN_INFO_7_TO_12,
+		FAN_INFO_7_TO_12,
+		FAN_INFO_7_TO_12,
+		FAN_INFO_7_TO_12,
+		FAN_INFO_7_TO_12,
+		FAN_INFO_7_TO_12),
 	HWMON_CHANNEL_INFO(pwm,
 		HWMON_PWM_INPUT | HWMON_PWM_ENABLE,
 		HWMON_PWM_INPUT | HWMON_PWM_ENABLE,
-- 
2.30.1


  parent reply	other threads:[~2021-03-04 11:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-04 10:58 [PATCH 1/7] hwmon: (max31790) Rework to use regmap Václav Kubernát
2021-03-04 10:58 ` [PATCH 2/7] hwmon: (max31790) Fix and split pwm*_enable Václav Kubernát
2021-03-04 10:58 ` [PATCH 3/7] hwmon: (max31790) Allow setting pulses Václav Kubernát
2021-03-05 12:08   ` Jan Kundrát
2021-03-08  9:31     ` Václav Kubernát
2021-03-04 10:58 ` [PATCH 4/7] hwmon: (max31790) Show 0 RPM/fault when input disabled Václav Kubernát
2021-03-04 10:58 ` Václav Kubernát [this message]
2021-03-04 10:58 ` [PATCH 6/7] hwmon: (max31790) Allow setting fan*_div Václav Kubernát
2021-03-04 10:58 ` [PATCH 7/7] hwmon: (max31790) Update documentation Václav Kubernát

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=20210304105830.507176-5-kubernat@cesnet.cz \
    --to=kubernat@cesnet.cz \
    --cc=corbet@lwn.net \
    --cc=jdelvare@suse.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    /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