diff options
Diffstat (limited to 'drivers/hwmon/w83627ehf.c')
-rw-r--r-- | drivers/hwmon/w83627ehf.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/hwmon/w83627ehf.c b/drivers/hwmon/w83627ehf.c index 0e0af0445222..2dfae7d7cc5b 100644 --- a/drivers/hwmon/w83627ehf.c +++ b/drivers/hwmon/w83627ehf.c | |||
@@ -1319,6 +1319,7 @@ store_pwm_mode(struct device *dev, struct device_attribute *attr, | |||
1319 | { | 1319 | { |
1320 | struct w83627ehf_data *data = dev_get_drvdata(dev); | 1320 | struct w83627ehf_data *data = dev_get_drvdata(dev); |
1321 | struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr); | 1321 | struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr); |
1322 | struct w83627ehf_sio_data *sio_data = dev->platform_data; | ||
1322 | int nr = sensor_attr->index; | 1323 | int nr = sensor_attr->index; |
1323 | unsigned long val; | 1324 | unsigned long val; |
1324 | int err; | 1325 | int err; |
@@ -1330,6 +1331,11 @@ store_pwm_mode(struct device *dev, struct device_attribute *attr, | |||
1330 | 1331 | ||
1331 | if (val > 1) | 1332 | if (val > 1) |
1332 | return -EINVAL; | 1333 | return -EINVAL; |
1334 | |||
1335 | /* On NCT67766F, DC mode is only supported for pwm1 */ | ||
1336 | if (sio_data->kind == nct6776 && nr && val != 1) | ||
1337 | return -EINVAL; | ||
1338 | |||
1333 | mutex_lock(&data->update_lock); | 1339 | mutex_lock(&data->update_lock); |
1334 | reg = w83627ehf_read_value(data, W83627EHF_REG_PWM_ENABLE[nr]); | 1340 | reg = w83627ehf_read_value(data, W83627EHF_REG_PWM_ENABLE[nr]); |
1335 | data->pwm_mode[nr] = val; | 1341 | data->pwm_mode[nr] = val; |