hwmon fixes for v4.11-rc4
Bug fixes in asus_atk0110, it87 and max31790 drivers. Added missing API definition to hwmon core. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABAgAGBQJY1uZbAAoJEMsfJm/On5mB/vAP/1DjalKgmwB/rAHFNqmGzrmm nptUQWtpeeThT/8imZ+uMWkADq/CRTkCIXrNt/V5PgLUvDAgFOgw6OnfbHIbw4h3 BG6XU959UmHoQCksSJ+r24xzMBXIZ3c+hlM1mAfFgA52r1m+S7L7a+5D3X2lfcqc TmaqslBL7VNvPKlKG1JzFM6ZTIia3zGFprUgO+j379akk4u4MKnTk2x8hVHjxLfK 5t3gpCqCVTlycnl4qdnprxWVZg40nU7wU0Cr026aaFzzJGjDt6Zz5XFNJWRwnYrn 5Anb62mFZLJui38wkIIKnq+o3pKjEy7lfN7Kx2dP31Q1OC38AsgjGoySsxgwrksR FektDrkNOoTK6kStXsgua0dGHuxLZHoABGzxx/FjKyrvlh0mUrMUzLxonpKDVyuS i3SPVJmg+b8xeam9XcA2JCKnd6g4GVOj+4EJD2LMHxUUFvGP9Ll9jMEMhYTcazhV gzu3lE/wyaRFByuh+kX3wuqqhkv3bAaJ0nsXDFBaP68/obpdPhBCm6R8wCuuI/Rt vCzjOqQLP247Awh4fAVjZ87BxobTok9vml58kiDSsbZ0fP0NshiIX2vCqLaOSeDG 0HrbjEpH1UARa9Kzk+2rZvve/agnIXR7c2mw+ZKzfZhc7eGOxC440nPUGYeijJa0 E8irmld7/poZuZ5LjBtb =XQKx -----END PGP SIGNATURE----- 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
This commit is contained in:
commit
a00da40fc7
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
@ -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) {
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue