summaryrefslogtreecommitdiff
path: root/drivers/hwmon/it87.c
diff options
context:
space:
mode:
authorFrank Crawford <frank@crawford.emu.id.au>2023-04-29 14:52:04 +0300
committerGuenter Roeck <linux@roeck-us.net>2023-06-08 16:41:17 +0300
commit39a6dcf640a5fc0aa880a8cf8871755fdbd42a5e (patch)
tree526e46654f467fa636ba8cd14490ea98a82ff821 /drivers/hwmon/it87.c
parent5a4417bc67cd2cb24667f226667dba66d284de8b (diff)
downloadlinux-39a6dcf640a5fc0aa880a8cf8871755fdbd42a5e.tar.xz
hwmon: (it87) Add controls for chips with only 4 PWMs
Add feature and support for chips with only 4 PWMs. Signed-off-by: Frank Crawford <frank@crawford.emu.id.au> Link: https://lore.kernel.org/r/20230429115205.1547251-3-frank@crawford.emu.id.au Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/it87.c')
-rw-r--r--drivers/hwmon/it87.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c
index bd9a24942e70..d5482c6ed18f 100644
--- a/drivers/hwmon/it87.c
+++ b/drivers/hwmon/it87.c
@@ -318,6 +318,7 @@ struct it87_devices {
*/
#define FEAT_CONF_NOEXIT BIT(19) /* Chip should not exit conf mode */
#define FEAT_FOUR_FANS BIT(20) /* Supports four fans */
+#define FEAT_FOUR_PWM BIT(21) /* Supports four fan controls */
static const struct it87_devices it87_devices[] = {
[it87] = {
@@ -518,8 +519,11 @@ static const struct it87_devices it87_devices[] = {
#define has_vid(data) ((data)->features & FEAT_VID)
#define has_in7_internal(data) ((data)->features & FEAT_IN7_INTERNAL)
#define has_avcc3(data) ((data)->features & FEAT_AVCC3)
-#define has_five_pwm(data) ((data)->features & (FEAT_FIVE_PWM \
- | FEAT_SIX_PWM))
+#define has_four_pwm(data) ((data)->features & (FEAT_FOUR_PWM | \
+ FEAT_FIVE_PWM | \
+ FEAT_SIX_PWM))
+#define has_five_pwm(data) ((data)->features & (FEAT_FIVE_PWM | \
+ FEAT_SIX_PWM))
#define has_six_pwm(data) ((data)->features & FEAT_SIX_PWM)
#define has_pwm_freq2(data) ((data)->features & FEAT_PWM_FREQ2)
#define has_six_temp(data) ((data)->features & FEAT_SIX_TEMP)
@@ -2734,8 +2738,10 @@ static int __init it87_find(int sioaddr, unsigned short *address,
else
sio_data->skip_in |= BIT(9);
- if (!has_five_pwm(config))
+ if (!has_four_pwm(config))
sio_data->skip_pwm |= BIT(3) | BIT(4) | BIT(5);
+ else if (!has_five_pwm(config))
+ sio_data->skip_pwm |= BIT(4) | BIT(5);
else if (!has_six_pwm(config))
sio_data->skip_pwm |= BIT(5);