aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorRobert Coulson <rob.coulson@gmail.com>2013-05-09 01:45:54 -0400
committerGuenter Roeck <linux@roeck-us.net>2013-06-27 13:29:01 -0400
commit3a8fe3315571e896489d2e271ffe7f935bfc5ce8 (patch)
treec97f18dc6b5326d0dfee71bac65d318d994896f8 /Documentation
parentcd6c8a4297ad036a155966db49982d6807e23ef8 (diff)
hwmon: (ds1621) Add ds1721 update interval sysfs attribute
The ds1721 device can be configured for 9..12 bit resolutions; add a sysfs attribute for userspace to configure this attribute. The definition, description, details, and usage are shown in the documentation and were crafted from an LM73 driver patch done by Chris Verges & Guenter Roeck). Signed-off-by: Robert Coulson <rob.coulson@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/hwmon/ds162165
1 files changed, 65 insertions, 0 deletions
diff --git a/Documentation/hwmon/ds1621 b/Documentation/hwmon/ds1621
index d66f76f9d85d..b61e77c6b1cb 100644
--- a/Documentation/hwmon/ds1621
+++ b/Documentation/hwmon/ds1621
@@ -75,3 +75,68 @@ The DS1721 is pin compatible with the DS1621, has an accuracy of +/- 1.0
75degree Celsius over a -10 to +85 degree range, a minimum/maximum alarm 75degree Celsius over a -10 to +85 degree range, a minimum/maximum alarm
76default setting of 75 and 80 degrees respectively, and a maximum conversion 76default setting of 75 and 80 degrees respectively, and a maximum conversion
77time of 750ms. 77time of 750ms.
78
79In addition, the DS1721 supports four resolution settings from 9 to 12 bits
80(defined in degrees C per LSB: 0.5, 0.25, 0.125, and 0.0625, respectifully),
81that are set at device power on to the highest resolution: 12-bits (0.0625 degree C).
82
83Changing the DS1721 resolution mode affects the conversion time and can be
84done from userspace, via the device 'update_interval' sysfs attribute. This
85attribute will normalize range of input values to the device maximum resolution
86values defined in the datasheet as such:
87
88Resolution Conversion Time Input Range
89 (C/LSB) (msec) (msec)
90--------------------------------------------
910.5 93.75 0....94
920.25 187.5 95...187
930.125 375 188..375
940.0625 750 376..infinity
95--------------------------------------
96
97The following examples show how the 'update_interval' attribute can be
98used to change the conversion time:
99
100$ cat update_interval
101750
102$ cat temp1_input
10322062
104$
105$ echo 300 > update_interval
106$ cat update_interval
107375
108$ cat temp1_input
10922125
110$
111$ echo 150 > update_interval
112$ cat update_interval
113188
114$ cat temp1_input
11522250
116$
117$ echo 1 > update_interval
118$ cat update_interval
11994
120$ cat temp1_input
12122000
122$
123$ echo 1000 > update_interval
124$ cat update_interval
125750
126$ cat temp1_input
12722062
128$
129
130As shown, the ds1621 driver automatically adjusts the 'update_interval'
131user input, via a step function. Reading back the 'update_interval' value
132after a write operation provides the conversion time used by the device.
133
134Mathematically, the resolution can be derived from the conversion time
135via the following function:
136
137 g(x) = 0.5 * [minimum_conversion_time/x]
138
139where:
140 -> 'x' = the output from 'update_interval'
141 -> 'g(x)' = the resolution in degrees C per LSB.
142 -> 93.75ms = minimum conversion time