Skip to content
Commit 480a3dbd authored by Akira Shimahara's avatar Akira Shimahara Committed by Meng Li
Browse files

w1_therm: adding alarm sysfs entry

commit  f4686c087e6f34fe19dfd2292aec671f8f741a91 from
https://github.com/raspberrypi/linux.git rpi-5.4.y

commit e2c94d6f

 upstream.

Adding device alarms settings by a dedicated sysfs entry alarms (RW):
read or write TH and TL in the device RAM. Checking devices in alarm
state could be performed using the master search command.

As alarms temperature level are store in a 8 bit register on the device
and are signed values, a safe cast shall be performed using the min and
max temperature that device are able to measure. This is done by
int_to_short inline function.

A 'write_data' field is added in the device structure, to bind the
correct writing function, as some devices may have 2 or 3 bytes RAM.

Updating Documentation/ABI/testing/sysfs-driver-w1_therm accordingly.

Signed-off-by: default avatarAkira Shimahara <akira215corp@gmail.com>
Link: https://lore.kernel.org/r/20200511203801.411253-1-akira215corp@gmail.com
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarMeng Li <Meng.Li@windriver.com>
parent 85e65678
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