diff options
author | Ivan Zaentsev <ivan.zaentsev@wirenboard.ru> | 2020-09-04 19:00:03 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-10-02 11:49:50 +0200 |
commit | 021da53e65fdd0e1b8492c2670dd075c0ea910fc (patch) | |
tree | 1c13a1936d8f43a1d3b7804446b722296c69637b /drivers/net/wireguard | |
parent | b31de43c608ffaa83e67a410ba58d678ff405f55 (diff) |
w1: w1_therm: Add sysfs entries to control conversion time and driver features
The conversion time of common DS18B20 clones deviates from
datasheet specs. Allow adjustment and automatic measure of the
conversion time.
Add 'conv_time' sysfs attribute:
*read*: Current conversion time in milliseconds.
*write*:
'0': Set default conversion time.
'1': Measure and set the conversion time. Make a
single temperature conversion, poll and measure
an actual value. Measured value is increased
by 20% for temperature drift. A new conversion
time is returned by reading the same attribute.
other positive value:
Set the conversion time in milliseconds.
The setting is active until a resolution change. Then it is reset to
default conversion time for a new resolution.
Add 'features' sysfs attribute to control optional driver settings
per device. Bit masks to read/write (logical OR):
1: Enable check for conversion success. If byte 6 of
scratchpad memory is 0xC after conversion, and
temperature reads 85.00 (powerup value) or 127.94
(insufficient power) - return a conversion error.
2: Enable poll for conversion completion. Generate read cycles
after the conversion start and wait for 1's. In parasite
power mode this feature is not available.
There are some clones of DS18B20 with fixed 12 bit resolution. Make the
driver verify the resolution by reading back the device after resolution
change.
Signed-off-by: Ivan Zaentsev <ivan.zaentsev@wirenboard.ru>
Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
Link: https://lore.kernel.org/r/20200904160004.87710-1-ivan.zaentsev@wirenboard.ru
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/net/wireguard')
0 files changed, 0 insertions, 0 deletions