diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-11-17 12:17:40 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-11-17 12:17:40 -0500 |
commit | ee49a277e6daaa52e846be264246bd809d2c5fff (patch) | |
tree | 22d6ceead923e9bb8192e7fe7c1a05bdd51d2977 | |
parent | 3026a9b0515976f06ff49705d6f642b671731aac (diff) | |
parent | 84d2a314bbe440d7c2e8636a1923aa3ea1aca51b (diff) |
Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging
* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
hwmon: (adt7475) Fix sysfs file names
hwmon: (adt7475) Cache limits for 60 seconds
hwmon: (adt7475) Fix temperature fault flags
hwmon: (s3c-hwmon) Ignore invalid divider settings
-rw-r--r-- | drivers/hwmon/adt7475.c | 17 | ||||
-rw-r--r-- | drivers/hwmon/s3c-hwmon.c | 11 |
2 files changed, 17 insertions, 11 deletions
diff --git a/drivers/hwmon/adt7475.c b/drivers/hwmon/adt7475.c index d39877a7da63..b5a95193c694 100644 --- a/drivers/hwmon/adt7475.c +++ b/drivers/hwmon/adt7475.c | |||
@@ -350,8 +350,7 @@ static ssize_t show_temp(struct device *dev, struct device_attribute *attr, | |||
350 | 350 | ||
351 | case FAULT: | 351 | case FAULT: |
352 | /* Note - only for remote1 and remote2 */ | 352 | /* Note - only for remote1 and remote2 */ |
353 | out = data->alarms & (sattr->index ? 0x8000 : 0x4000); | 353 | out = !!(data->alarms & (sattr->index ? 0x8000 : 0x4000)); |
354 | out = out ? 0 : 1; | ||
355 | break; | 354 | break; |
356 | 355 | ||
357 | default: | 356 | default: |
@@ -863,7 +862,7 @@ static SENSOR_DEVICE_ATTR_2(pwm1_freq, S_IRUGO | S_IWUSR, show_pwmfreq, | |||
863 | set_pwmfreq, INPUT, 0); | 862 | set_pwmfreq, INPUT, 0); |
864 | static SENSOR_DEVICE_ATTR_2(pwm1_enable, S_IRUGO | S_IWUSR, show_pwmctrl, | 863 | static SENSOR_DEVICE_ATTR_2(pwm1_enable, S_IRUGO | S_IWUSR, show_pwmctrl, |
865 | set_pwmctrl, INPUT, 0); | 864 | set_pwmctrl, INPUT, 0); |
866 | static SENSOR_DEVICE_ATTR_2(pwm1_auto_channel_temp, S_IRUGO | S_IWUSR, | 865 | static SENSOR_DEVICE_ATTR_2(pwm1_auto_channels_temp, S_IRUGO | S_IWUSR, |
867 | show_pwmchan, set_pwmchan, INPUT, 0); | 866 | show_pwmchan, set_pwmchan, INPUT, 0); |
868 | static SENSOR_DEVICE_ATTR_2(pwm1_auto_point1_pwm, S_IRUGO | S_IWUSR, show_pwm, | 867 | static SENSOR_DEVICE_ATTR_2(pwm1_auto_point1_pwm, S_IRUGO | S_IWUSR, show_pwm, |
869 | set_pwm, MIN, 0); | 868 | set_pwm, MIN, 0); |
@@ -875,7 +874,7 @@ static SENSOR_DEVICE_ATTR_2(pwm2_freq, S_IRUGO | S_IWUSR, show_pwmfreq, | |||
875 | set_pwmfreq, INPUT, 1); | 874 | set_pwmfreq, INPUT, 1); |
876 | static SENSOR_DEVICE_ATTR_2(pwm2_enable, S_IRUGO | S_IWUSR, show_pwmctrl, | 875 | static SENSOR_DEVICE_ATTR_2(pwm2_enable, S_IRUGO | S_IWUSR, show_pwmctrl, |
877 | set_pwmctrl, INPUT, 1); | 876 | set_pwmctrl, INPUT, 1); |
878 | static SENSOR_DEVICE_ATTR_2(pwm2_auto_channel_temp, S_IRUGO | S_IWUSR, | 877 | static SENSOR_DEVICE_ATTR_2(pwm2_auto_channels_temp, S_IRUGO | S_IWUSR, |
879 | show_pwmchan, set_pwmchan, INPUT, 1); | 878 | show_pwmchan, set_pwmchan, INPUT, 1); |
880 | static SENSOR_DEVICE_ATTR_2(pwm2_auto_point1_pwm, S_IRUGO | S_IWUSR, show_pwm, | 879 | static SENSOR_DEVICE_ATTR_2(pwm2_auto_point1_pwm, S_IRUGO | S_IWUSR, show_pwm, |
881 | set_pwm, MIN, 1); | 880 | set_pwm, MIN, 1); |
@@ -887,7 +886,7 @@ static SENSOR_DEVICE_ATTR_2(pwm3_freq, S_IRUGO | S_IWUSR, show_pwmfreq, | |||
887 | set_pwmfreq, INPUT, 2); | 886 | set_pwmfreq, INPUT, 2); |
888 | static SENSOR_DEVICE_ATTR_2(pwm3_enable, S_IRUGO | S_IWUSR, show_pwmctrl, | 887 | static SENSOR_DEVICE_ATTR_2(pwm3_enable, S_IRUGO | S_IWUSR, show_pwmctrl, |
889 | set_pwmctrl, INPUT, 2); | 888 | set_pwmctrl, INPUT, 2); |
890 | static SENSOR_DEVICE_ATTR_2(pwm3_auto_channel_temp, S_IRUGO | S_IWUSR, | 889 | static SENSOR_DEVICE_ATTR_2(pwm3_auto_channels_temp, S_IRUGO | S_IWUSR, |
891 | show_pwmchan, set_pwmchan, INPUT, 2); | 890 | show_pwmchan, set_pwmchan, INPUT, 2); |
892 | static SENSOR_DEVICE_ATTR_2(pwm3_auto_point1_pwm, S_IRUGO | S_IWUSR, show_pwm, | 891 | static SENSOR_DEVICE_ATTR_2(pwm3_auto_point1_pwm, S_IRUGO | S_IWUSR, show_pwm, |
893 | set_pwm, MIN, 2); | 892 | set_pwm, MIN, 2); |
@@ -947,19 +946,19 @@ static struct attribute *adt7475_attrs[] = { | |||
947 | &sensor_dev_attr_pwm1.dev_attr.attr, | 946 | &sensor_dev_attr_pwm1.dev_attr.attr, |
948 | &sensor_dev_attr_pwm1_freq.dev_attr.attr, | 947 | &sensor_dev_attr_pwm1_freq.dev_attr.attr, |
949 | &sensor_dev_attr_pwm1_enable.dev_attr.attr, | 948 | &sensor_dev_attr_pwm1_enable.dev_attr.attr, |
950 | &sensor_dev_attr_pwm1_auto_channel_temp.dev_attr.attr, | 949 | &sensor_dev_attr_pwm1_auto_channels_temp.dev_attr.attr, |
951 | &sensor_dev_attr_pwm1_auto_point1_pwm.dev_attr.attr, | 950 | &sensor_dev_attr_pwm1_auto_point1_pwm.dev_attr.attr, |
952 | &sensor_dev_attr_pwm1_auto_point2_pwm.dev_attr.attr, | 951 | &sensor_dev_attr_pwm1_auto_point2_pwm.dev_attr.attr, |
953 | &sensor_dev_attr_pwm2.dev_attr.attr, | 952 | &sensor_dev_attr_pwm2.dev_attr.attr, |
954 | &sensor_dev_attr_pwm2_freq.dev_attr.attr, | 953 | &sensor_dev_attr_pwm2_freq.dev_attr.attr, |
955 | &sensor_dev_attr_pwm2_enable.dev_attr.attr, | 954 | &sensor_dev_attr_pwm2_enable.dev_attr.attr, |
956 | &sensor_dev_attr_pwm2_auto_channel_temp.dev_attr.attr, | 955 | &sensor_dev_attr_pwm2_auto_channels_temp.dev_attr.attr, |
957 | &sensor_dev_attr_pwm2_auto_point1_pwm.dev_attr.attr, | 956 | &sensor_dev_attr_pwm2_auto_point1_pwm.dev_attr.attr, |
958 | &sensor_dev_attr_pwm2_auto_point2_pwm.dev_attr.attr, | 957 | &sensor_dev_attr_pwm2_auto_point2_pwm.dev_attr.attr, |
959 | &sensor_dev_attr_pwm3.dev_attr.attr, | 958 | &sensor_dev_attr_pwm3.dev_attr.attr, |
960 | &sensor_dev_attr_pwm3_freq.dev_attr.attr, | 959 | &sensor_dev_attr_pwm3_freq.dev_attr.attr, |
961 | &sensor_dev_attr_pwm3_enable.dev_attr.attr, | 960 | &sensor_dev_attr_pwm3_enable.dev_attr.attr, |
962 | &sensor_dev_attr_pwm3_auto_channel_temp.dev_attr.attr, | 961 | &sensor_dev_attr_pwm3_auto_channels_temp.dev_attr.attr, |
963 | &sensor_dev_attr_pwm3_auto_point1_pwm.dev_attr.attr, | 962 | &sensor_dev_attr_pwm3_auto_point1_pwm.dev_attr.attr, |
964 | &sensor_dev_attr_pwm3_auto_point2_pwm.dev_attr.attr, | 963 | &sensor_dev_attr_pwm3_auto_point2_pwm.dev_attr.attr, |
965 | NULL, | 964 | NULL, |
@@ -1152,7 +1151,7 @@ static struct adt7475_data *adt7475_update_device(struct device *dev) | |||
1152 | } | 1151 | } |
1153 | 1152 | ||
1154 | /* Limits and settings, should never change update every 60 seconds */ | 1153 | /* Limits and settings, should never change update every 60 seconds */ |
1155 | if (time_after(jiffies, data->limits_updated + HZ * 2) || | 1154 | if (time_after(jiffies, data->limits_updated + HZ * 60) || |
1156 | !data->valid) { | 1155 | !data->valid) { |
1157 | data->config5 = adt7475_read(REG_CONFIG5); | 1156 | data->config5 = adt7475_read(REG_CONFIG5); |
1158 | 1157 | ||
diff --git a/drivers/hwmon/s3c-hwmon.c b/drivers/hwmon/s3c-hwmon.c index 3a524f2fe493..71835412529f 100644 --- a/drivers/hwmon/s3c-hwmon.c +++ b/drivers/hwmon/s3c-hwmon.c | |||
@@ -323,14 +323,21 @@ static int __devinit s3c_hwmon_probe(struct platform_device *dev) | |||
323 | } | 323 | } |
324 | 324 | ||
325 | for (i = 0; i < ARRAY_SIZE(pdata->in); i++) { | 325 | for (i = 0; i < ARRAY_SIZE(pdata->in); i++) { |
326 | if (!pdata->in[i]) | 326 | struct s3c24xx_adc_hwmon_incfg *cfg = pdata->in[i]; |
327 | |||
328 | if (!cfg) | ||
327 | continue; | 329 | continue; |
328 | 330 | ||
329 | if (pdata->in[i]->mult >= 0x10000) | 331 | if (cfg->mult >= 0x10000) |
330 | dev_warn(&dev->dev, | 332 | dev_warn(&dev->dev, |
331 | "channel %d multiplier too large\n", | 333 | "channel %d multiplier too large\n", |
332 | i); | 334 | i); |
333 | 335 | ||
336 | if (cfg->divider == 0) { | ||
337 | dev_err(&dev->dev, "channel %d divider zero\n", i); | ||
338 | continue; | ||
339 | } | ||
340 | |||
334 | ret = s3c_hwmon_create_attr(&dev->dev, pdata->in[i], | 341 | ret = s3c_hwmon_create_attr(&dev->dev, pdata->in[i], |
335 | &hwmon->attrs[i], i); | 342 | &hwmon->attrs[i], i); |
336 | if (ret) { | 343 | if (ret) { |