diff options
author | Guenter Roeck <linux@roeck-us.net> | 2018-09-18 11:18:30 -0700 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2018-10-10 20:37:13 -0700 |
commit | b75a806389901efa93c355238f787d922ba074b3 (patch) | |
tree | ec4b4d3960138a21a51608e7f5068fb45dd8b6a1 /drivers/hwmon | |
parent | 2d99925a15b639026b67bd96419df6f9d760b212 (diff) | |
download | linux-stable-b75a806389901efa93c355238f787d922ba074b3.tar.gz linux-stable-b75a806389901efa93c355238f787d922ba074b3.tar.bz2 linux-stable-b75a806389901efa93c355238f787d922ba074b3.zip |
hwmon: (nct6775) Separate fan/pwm configuration detection for NCT6795D
Separate fan/pwm configuration detection for NCT6795D into separate
case statement to make the code easier to read.
No functional change.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/nct6775.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/drivers/hwmon/nct6775.c b/drivers/hwmon/nct6775.c index 556b4cfacbd1..d9c2b934321d 100644 --- a/drivers/hwmon/nct6775.c +++ b/drivers/hwmon/nct6775.c @@ -3542,6 +3542,19 @@ nct6775_check_fan_inputs(struct nct6775_data *data) pwm6pin |= creb & BIT(2); break; case nct6795: + fan5pin |= cr1b & BIT(5); + fan5pin |= creb & BIT(5); + + fan6pin = (cr2a & BIT(4)) && + (!dsw_en || (cred & BIT(4))); + fan6pin |= creb & BIT(3); + + pwm5pin |= cr2d & BIT(7); + pwm5pin |= (creb & BIT(4)) && !(cr2a & BIT(0)); + + pwm6pin = (cr2a & BIT(3)) && (cred & BIT(2)); + pwm6pin |= creb & BIT(2); + break; case nct6796: pwm5pin |= cr2d & BIT(7); fan5pin |= cr1b & BIT(5); @@ -3561,10 +3574,8 @@ nct6775_check_fan_inputs(struct nct6775_data *data) (!dsw_en || (cred & BIT(4))); pwm6pin |= (cr2a & BIT(3)) && (cred & BIT(2)); - if (data->kind == nct6796) { - fan7pin = !(cr2b & BIT(2)); - pwm7pin = !(cr1d & (BIT(2) | BIT(3))); - } + fan7pin = !(cr2b & BIT(2)); + pwm7pin = !(cr1d & (BIT(2) | BIT(3))); break; default: /* NCT6779D */ |