mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 19:56:18 +00:00
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
This commit is contained in:
commit
ee49a277e6
2 changed files with 17 additions and 11 deletions
|
@ -350,8 +350,7 @@ static ssize_t show_temp(struct device *dev, struct device_attribute *attr,
|
|||
|
||||
case FAULT:
|
||||
/* Note - only for remote1 and remote2 */
|
||||
out = data->alarms & (sattr->index ? 0x8000 : 0x4000);
|
||||
out = out ? 0 : 1;
|
||||
out = !!(data->alarms & (sattr->index ? 0x8000 : 0x4000));
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -863,7 +862,7 @@ static SENSOR_DEVICE_ATTR_2(pwm1_freq, S_IRUGO | S_IWUSR, show_pwmfreq,
|
|||
set_pwmfreq, INPUT, 0);
|
||||
static SENSOR_DEVICE_ATTR_2(pwm1_enable, S_IRUGO | S_IWUSR, show_pwmctrl,
|
||||
set_pwmctrl, INPUT, 0);
|
||||
static SENSOR_DEVICE_ATTR_2(pwm1_auto_channel_temp, S_IRUGO | S_IWUSR,
|
||||
static SENSOR_DEVICE_ATTR_2(pwm1_auto_channels_temp, S_IRUGO | S_IWUSR,
|
||||
show_pwmchan, set_pwmchan, INPUT, 0);
|
||||
static SENSOR_DEVICE_ATTR_2(pwm1_auto_point1_pwm, S_IRUGO | S_IWUSR, show_pwm,
|
||||
set_pwm, MIN, 0);
|
||||
|
@ -875,7 +874,7 @@ static SENSOR_DEVICE_ATTR_2(pwm2_freq, S_IRUGO | S_IWUSR, show_pwmfreq,
|
|||
set_pwmfreq, INPUT, 1);
|
||||
static SENSOR_DEVICE_ATTR_2(pwm2_enable, S_IRUGO | S_IWUSR, show_pwmctrl,
|
||||
set_pwmctrl, INPUT, 1);
|
||||
static SENSOR_DEVICE_ATTR_2(pwm2_auto_channel_temp, S_IRUGO | S_IWUSR,
|
||||
static SENSOR_DEVICE_ATTR_2(pwm2_auto_channels_temp, S_IRUGO | S_IWUSR,
|
||||
show_pwmchan, set_pwmchan, INPUT, 1);
|
||||
static SENSOR_DEVICE_ATTR_2(pwm2_auto_point1_pwm, S_IRUGO | S_IWUSR, show_pwm,
|
||||
set_pwm, MIN, 1);
|
||||
|
@ -887,7 +886,7 @@ static SENSOR_DEVICE_ATTR_2(pwm3_freq, S_IRUGO | S_IWUSR, show_pwmfreq,
|
|||
set_pwmfreq, INPUT, 2);
|
||||
static SENSOR_DEVICE_ATTR_2(pwm3_enable, S_IRUGO | S_IWUSR, show_pwmctrl,
|
||||
set_pwmctrl, INPUT, 2);
|
||||
static SENSOR_DEVICE_ATTR_2(pwm3_auto_channel_temp, S_IRUGO | S_IWUSR,
|
||||
static SENSOR_DEVICE_ATTR_2(pwm3_auto_channels_temp, S_IRUGO | S_IWUSR,
|
||||
show_pwmchan, set_pwmchan, INPUT, 2);
|
||||
static SENSOR_DEVICE_ATTR_2(pwm3_auto_point1_pwm, S_IRUGO | S_IWUSR, show_pwm,
|
||||
set_pwm, MIN, 2);
|
||||
|
@ -947,19 +946,19 @@ static struct attribute *adt7475_attrs[] = {
|
|||
&sensor_dev_attr_pwm1.dev_attr.attr,
|
||||
&sensor_dev_attr_pwm1_freq.dev_attr.attr,
|
||||
&sensor_dev_attr_pwm1_enable.dev_attr.attr,
|
||||
&sensor_dev_attr_pwm1_auto_channel_temp.dev_attr.attr,
|
||||
&sensor_dev_attr_pwm1_auto_channels_temp.dev_attr.attr,
|
||||
&sensor_dev_attr_pwm1_auto_point1_pwm.dev_attr.attr,
|
||||
&sensor_dev_attr_pwm1_auto_point2_pwm.dev_attr.attr,
|
||||
&sensor_dev_attr_pwm2.dev_attr.attr,
|
||||
&sensor_dev_attr_pwm2_freq.dev_attr.attr,
|
||||
&sensor_dev_attr_pwm2_enable.dev_attr.attr,
|
||||
&sensor_dev_attr_pwm2_auto_channel_temp.dev_attr.attr,
|
||||
&sensor_dev_attr_pwm2_auto_channels_temp.dev_attr.attr,
|
||||
&sensor_dev_attr_pwm2_auto_point1_pwm.dev_attr.attr,
|
||||
&sensor_dev_attr_pwm2_auto_point2_pwm.dev_attr.attr,
|
||||
&sensor_dev_attr_pwm3.dev_attr.attr,
|
||||
&sensor_dev_attr_pwm3_freq.dev_attr.attr,
|
||||
&sensor_dev_attr_pwm3_enable.dev_attr.attr,
|
||||
&sensor_dev_attr_pwm3_auto_channel_temp.dev_attr.attr,
|
||||
&sensor_dev_attr_pwm3_auto_channels_temp.dev_attr.attr,
|
||||
&sensor_dev_attr_pwm3_auto_point1_pwm.dev_attr.attr,
|
||||
&sensor_dev_attr_pwm3_auto_point2_pwm.dev_attr.attr,
|
||||
NULL,
|
||||
|
@ -1152,7 +1151,7 @@ static struct adt7475_data *adt7475_update_device(struct device *dev)
|
|||
}
|
||||
|
||||
/* Limits and settings, should never change update every 60 seconds */
|
||||
if (time_after(jiffies, data->limits_updated + HZ * 2) ||
|
||||
if (time_after(jiffies, data->limits_updated + HZ * 60) ||
|
||||
!data->valid) {
|
||||
data->config5 = adt7475_read(REG_CONFIG5);
|
||||
|
||||
|
|
|
@ -323,14 +323,21 @@ static int __devinit s3c_hwmon_probe(struct platform_device *dev)
|
|||
}
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(pdata->in); i++) {
|
||||
if (!pdata->in[i])
|
||||
struct s3c24xx_adc_hwmon_incfg *cfg = pdata->in[i];
|
||||
|
||||
if (!cfg)
|
||||
continue;
|
||||
|
||||
if (pdata->in[i]->mult >= 0x10000)
|
||||
if (cfg->mult >= 0x10000)
|
||||
dev_warn(&dev->dev,
|
||||
"channel %d multiplier too large\n",
|
||||
i);
|
||||
|
||||
if (cfg->divider == 0) {
|
||||
dev_err(&dev->dev, "channel %d divider zero\n", i);
|
||||
continue;
|
||||
}
|
||||
|
||||
ret = s3c_hwmon_create_attr(&dev->dev, pdata->in[i],
|
||||
&hwmon->attrs[i], i);
|
||||
if (ret) {
|
||||
|
|
Loading…
Reference in a new issue