Commit a41a8927 authored by Guenter Roeck's avatar Guenter Roeck

hwmon: (lm95245) Make temp2_crit_hyst read-only

The hysteresis register is shared among both temperature sensors.
This means changing one also affects the other. To avoid confusion,
established way to express this is to make only the first instance writable
and keep all other instances as read-only. Otherwise users may be
confused that changing the second writable value also affects the first,
while it is more obvious that a writable value may affect a different
read-only value.
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Reviewed-by: default avatarJean Delvare <jdelvare@suse.de>
parent 7276d55e
...@@ -24,8 +24,12 @@ is given within a range of -127 to +127.875 degrees. Remote temperatures are ...@@ -24,8 +24,12 @@ is given within a range of -127 to +127.875 degrees. Remote temperatures are
given within a range of -127 to +255 degrees. Resolution depends on given within a range of -127 to +255 degrees. Resolution depends on
temperature input and range. temperature input and range.
Each sensor has its own critical limit, but the hysteresis is common to all Each sensor has its own critical limit. Additionally, there is a relative
two channels. hysteresis value common to both critical limits. To make life easier to
user-space applications, two absolute values are exported, one for each
channel, but these values are of course linked. Only the local hysteresis
can be set from user-space, and the same delta applies to the remote
hysteresis.
The lm95245 driver can change its update interval to a fixed set of values. The lm95245 driver can change its update interval to a fixed set of values.
It will round up to the next selectable interval. See the datasheet for exact It will round up to the next selectable interval. See the datasheet for exact
......
...@@ -395,8 +395,7 @@ static SENSOR_DEVICE_ATTR(temp1_crit_alarm, S_IRUGO, show_alarm, NULL, ...@@ -395,8 +395,7 @@ static SENSOR_DEVICE_ATTR(temp1_crit_alarm, S_IRUGO, show_alarm, NULL,
static SENSOR_DEVICE_ATTR(temp2_input, S_IRUGO, show_input, NULL, 2); static SENSOR_DEVICE_ATTR(temp2_input, S_IRUGO, show_input, NULL, 2);
static SENSOR_DEVICE_ATTR(temp2_crit, S_IWUSR | S_IRUGO, show_limit, static SENSOR_DEVICE_ATTR(temp2_crit, S_IWUSR | S_IRUGO, show_limit,
set_limit, 7); set_limit, 7);
static SENSOR_DEVICE_ATTR(temp2_crit_hyst, S_IWUSR | S_IRUGO, show_crit_hyst, static SENSOR_DEVICE_ATTR(temp2_crit_hyst, S_IRUGO, show_crit_hyst, NULL, 7);
set_crit_hyst, 7);
static SENSOR_DEVICE_ATTR(temp2_crit_alarm, S_IRUGO, show_alarm, NULL, static SENSOR_DEVICE_ATTR(temp2_crit_alarm, S_IRUGO, show_alarm, NULL,
STATUS1_RTCRIT); STATUS1_RTCRIT);
static SENSOR_DEVICE_ATTR(temp2_type, S_IWUSR | S_IRUGO, show_type, static SENSOR_DEVICE_ATTR(temp2_type, S_IWUSR | S_IRUGO, show_type,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment