Skip to content

Commit

Permalink
Merge tag 'hwmon-for-linus-v4.11-rc4' of git://git.kernel.org/pub/scm…
Browse files Browse the repository at this point in the history
…/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
  • Loading branch information
torvalds committed Mar 25, 2017
2 parents 4a01fa5 + a2125d0 commit a00da40
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 6 deletions.
3 changes: 3 additions & 0 deletions drivers/hwmon/asus_atk0110.c
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,9 @@ static int atk_read_value(struct atk_sensor_data *sensor, u64 *value)
else
err = atk_read_value_new(sensor, value);

if (err)
return err;

sensor->is_valid = true;
sensor->last_updated = jiffies;
sensor->cached_value = *value;
Expand Down
24 changes: 19 additions & 5 deletions drivers/hwmon/it87.c
Original file line number Diff line number Diff line change
Expand Up @@ -3198,7 +3198,7 @@ static int __init sm_it87_init(void)
{
int sioaddr[2] = { REG_2E, REG_4E };
struct it87_sio_data sio_data;
unsigned short isa_address;
unsigned short isa_address[2];
bool found = false;
int i, err;

Expand All @@ -3208,15 +3208,29 @@ static int __init sm_it87_init(void)

for (i = 0; i < ARRAY_SIZE(sioaddr); i++) {
memset(&sio_data, 0, sizeof(struct it87_sio_data));
isa_address = 0;
err = it87_find(sioaddr[i], &isa_address, &sio_data);
if (err || isa_address == 0)
isa_address[i] = 0;
err = it87_find(sioaddr[i], &isa_address[i], &sio_data);
if (err || isa_address[i] == 0)
continue;
/*
* Don't register second chip if its ISA address matches
* the first chip's ISA address.
*/
if (i && isa_address[i] == isa_address[0])
break;

err = it87_device_add(i, isa_address, &sio_data);
err = it87_device_add(i, isa_address[i], &sio_data);
if (err)
goto exit_dev_unregister;

found = true;

/*
* IT8705F may respond on both SIO addresses.
* Stop probing after finding one.
*/
if (sio_data.type == it87)
break;
}

if (!found) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/hwmon/max31790.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ static int max31790_write_pwm(struct device *dev, u32 attr, int channel,
data->pwm[channel] = val << 8;
err = i2c_smbus_write_word_swapped(client,
MAX31790_REG_PWMOUT(channel),
val);
data->pwm[channel]);
break;
case hwmon_pwm_enable:
fan_config = data->fan_config[channel];
Expand Down
1 change: 1 addition & 0 deletions include/linux/hwmon.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ enum hwmon_temp_attributes {
#define HWMON_T_CRIT_HYST BIT(hwmon_temp_crit_hyst)
#define HWMON_T_EMERGENCY BIT(hwmon_temp_emergency)
#define HWMON_T_EMERGENCY_HYST BIT(hwmon_temp_emergency_hyst)
#define HWMON_T_ALARM BIT(hwmon_temp_alarm)
#define HWMON_T_MIN_ALARM BIT(hwmon_temp_min_alarm)
#define HWMON_T_MAX_ALARM BIT(hwmon_temp_max_alarm)
#define HWMON_T_CRIT_ALARM BIT(hwmon_temp_crit_alarm)
Expand Down

0 comments on commit a00da40

Please sign in to comment.