History

Merge tag 'hwmon-for-linus-v4.11-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging

Pull hwmon fixes from Guenter Roeck: - bug fixes in asus_atk0110, it87 and max31790 drivers - added missing API definition to hwmon core * tag 'hwmon-for-linus-v4.11-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: hwmon: (asus_atk0110) fix uninitialized data access hwmon: Add missing HWMON_T_ALARM hwmon: (it87) Avoid registering the same chip on both SIO addresses hwmon: (max31790) Set correct PWM value

Linus Torvalds committed 9 years ago

Commit a00da402 parents 4a01fa5 a2125d04 files · +24 −6Browse files

Unified · Split

4 files
  1. drivers/hwmon/asus_atk0110.c +3 −0
  2. drivers/hwmon/it87.c +19 −5
  3. drivers/hwmon/max31790.c +1 −1
  4. include/linux/hwmon.h +1 −0
drivers/hwmon/asus_atk0110.c+3−0
@@ -646,6 +646,9 @@ static int atk_read_value(struct atk_sensor_data *sensor, u64 *value) · 645 unmodified lines
646646 else
647647 err = atk_read_value_new(sensor, value);
648648
649+ if (err)
650+ return err;
651+
649652 sensor->is_valid = true;
650653 sensor->last_updated = jiffies;
651654 sensor->cached_value = *value;
drivers/hwmon/it87.c+19−5
@@ -3198,7 +3198,7 @@ static int __init sm_it87_init(void) · 3197 unmodified lines
31983198 {
31993199 int sioaddr[2] = { REG_2E, REG_4E };
32003200 struct it87_sio_data sio_data;
3201− unsigned short isa_address;
3201+ unsigned short isa_address[2];
32023202 bool found = false;
32033203 int i, err;
32043204
@@ -3208,15 +3208,29 @@ static int __init sm_it87_init(void) · 3 unmodified lines
32083208
32093209 for (i = 0; i < ARRAY_SIZE(sioaddr); i++) {
32103210 memset(&sio_data, 0, sizeof(struct it87_sio_data));
3211− isa_address = 0;
3212− err = it87_find(sioaddr[i], &isa_address, &sio_data);
3213− if (err || isa_address == 0)
3211+ isa_address[i] = 0;
3212+ err = it87_find(sioaddr[i], &isa_address[i], &sio_data);
3213+ if (err || isa_address[i] == 0)
32143214 continue;
3215+ /*
3216+ * Don't register second chip if its ISA address matches
3217+ * the first chip's ISA address.
3218+ */
3219+ if (i && isa_address[i] == isa_address[0])
3220+ break;
32153221
3216− err = it87_device_add(i, isa_address, &sio_data);
3222+ err = it87_device_add(i, isa_address[i], &sio_data);
32173223 if (err)
32183224 goto exit_dev_unregister;
3225+
32193226 found = true;
3227+
3228+ /*
3229+ * IT8705F may respond on both SIO addresses.
3230+ * Stop probing after finding one.
3231+ */
3232+ if (sio_data.type == it87)
3233+ break;
32203234 }
32213235
32223236 if (!found) {
drivers/hwmon/max31790.c+1−1
@@ -311,7 +311,7 @@ static int max31790_write_pwm(struct device *dev, u32 attr, int channel, · 310 unmodified lines
311311 data->pwm[channel] = val << 8;
312312 err = i2c_smbus_write_word_swapped(client,
313313 MAX31790_REG_PWMOUT(channel),
314− val);
314+ data->pwm[channel]);
315315 break;
316316 case hwmon_pwm_enable:
317317 fan_config = data->fan_config[channel];
include/linux/hwmon.h+1−0
@@ -88,6 +88,7 @@ enum hwmon_temp_attributes { · 87 unmodified lines
8888 #define HWMON_T_CRIT_HYST BIT(hwmon_temp_crit_hyst)
8989 #define HWMON_T_EMERGENCY BIT(hwmon_temp_emergency)
9090 #define HWMON_T_EMERGENCY_HYST BIT(hwmon_temp_emergency_hyst)
91+#define HWMON_T_ALARM BIT(hwmon_temp_alarm)
9192 #define HWMON_T_MIN_ALARM BIT(hwmon_temp_min_alarm)
9293 #define HWMON_T_MAX_ALARM BIT(hwmon_temp_max_alarm)
9394 #define HWMON_T_CRIT_ALARM BIT(hwmon_temp_crit_alarm)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t