hwmon: (ds1621) Add ds1721 update interval sysfs attribute
[deliverable/linux.git] / Documentation / hwmon / ds1621
CommitLineData
7f15b664
M
1Kernel driver ds1621
2====================
3
4Supported chips:
cd6c8a42 5 * Dallas Semiconductor / Maxim Integrated DS1621
7f15b664
M
6 Prefix: 'ds1621'
7 Addresses scanned: I2C 0x48 - 0x4f
cd6c8a42
RC
8 Datasheet: Publicly available from www.maximintegrated.com
9
7f15b664 10 * Dallas Semiconductor DS1625
cd6c8a42
RC
11 Prefix:
12 'ds1621' - if binding via _detect function
13 'ds1625' - explicit instantiation
14 Addresses scanned: I2C 0x48 - 0x4f
15 Datasheet: Publicly available from www.datasheetarchive.com
16
17 * Maxim Integrated DS1721
18 Prefix: 'ds1721'
7f15b664 19 Addresses scanned: I2C 0x48 - 0x4f
cd6c8a42 20 Datasheet: Publicly available from www.maximintegrated.com
7f15b664
M
21
22Authors:
23 Christian W. Zuckschwerdt <zany@triq.net>
24 valuable contributions by Jan M. Sendler <sendler@sendler.de>
25 ported to 2.6 by Aurelien Jarno <aurelien@aurel32.net>
26 with the help of Jean Delvare <khali@linux-fr.org>
27
28Module Parameters
29------------------
30
31* polarity int
32 Output's polarity: 0 = active high, 1 = active low
33
34Description
35-----------
36
37The DS1621 is a (one instance) digital thermometer and thermostat. It has
38both high and low temperature limits which can be user defined (i.e.
39programmed into non-volatile on-chip registers). Temperature range is -55
40degree Celsius to +125 in 0.5 increments. You may convert this into a
41Fahrenheit range of -67 to +257 degrees with 0.9 steps. If polarity
42parameter is not provided, original value is used.
43
44As for the thermostat, behavior can also be programmed using the polarity
45toggle. On the one hand ("heater"), the thermostat output of the chip,
46Tout, will trigger when the low limit temperature is met or underrun and
47stays high until the high limit is met or exceeded. On the other hand
48("cooler"), vice versa. That way "heater" equals "active low", whereas
49"conditioner" equals "active high". Please note that the DS1621 data sheet
50is somewhat misleading in this point since setting the polarity bit does
51not simply invert Tout.
52
53A second thing is that, during extensive testing, Tout showed a tolerance
54of up to +/- 0.5 degrees even when compared against precise temperature
55readings. Be sure to have a high vs. low temperature limit gap of al least
561.0 degree Celsius to avoid Tout "bouncing", though!
57
25f3311a
JD
58The alarm bits are set when the high or low limits are met or exceeded and
59are reset by the module as soon as the respective temperature ranges are
60left.
7f15b664
M
61
62The alarm registers are in no way suitable to find out about the actual
63status of Tout. They will only tell you about its history, whether or not
64any of the limits have ever been met or exceeded since last power-up or
65reset. Be aware: When testing, it showed that the status of Tout can change
66with neither of the alarms set.
67
68Temperature conversion of the DS1621 takes up to 1000ms; internal access to
69non-volatile registers may last for 10ms or below.
cd6c8a42
RC
70
71The DS1625 is pin compatible and functionally equivalent with the DS1621,
72but the DS1621 is meant to replace it.
73
74The 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
76default setting of 75 and 80 degrees respectively, and a maximum conversion
77time of 750ms.
3a8fe331
RC
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
This page took 0.896955 seconds and 5 git commands to generate.