linux/Documentation/w1
Ivan Zaentsev 021da53e65 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>
2020-10-02 11:49:50 +02:00
..
masters docs: w1: Fix a typo in omap-hdq.rst 2019-12-30 11:58:02 -07:00
slaves w1: w1_therm: Add sysfs entries to control conversion time and driver features 2020-10-02 11:49:50 +02:00
index.rst docs: w1: Fix SPDX-License-Identifier syntax 2019-10-18 09:45:56 -06:00
w1-generic.rst docs: w1: convert to ReST and add to the kAPI group of docs 2019-07-31 14:16:17 -06:00
w1-netlink.rst docs: w1: convert to ReST and add to the kAPI group of docs 2019-07-31 14:16:17 -06:00