diff options
author | Chris Verges <kg4ysn@gmail.com> | 2013-01-05 04:41:19 -0500 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2013-02-06 12:57:57 -0500 |
commit | 8c14d126ae2efbcd094b24e5413b8cbe1d2c01e4 (patch) | |
tree | ac4ee5056c7889dda4a08d248f655f8b43e10c6b /Documentation/hwmon | |
parent | 91bba688016be0ba87ecb9d80d6490c2ebc63b0d (diff) |
hwmon: (lm73) Add 'update_interval' attribute
The LM73 supports four A/D conversion resolutions. The default used by
the existing lm73 driver is the chip's default, 11-bit (0.25 C/LSB).
This patch enables changing of this resolution from userspace via the
update_interval sysfs attribute. Full details on usage are included in
Documentation/hwmon/lm73.
Signed-off-by: Chris Verges <kg4ysn@gmail.com>
[linux@roeck-us.net: cleanup]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'Documentation/hwmon')
-rw-r--r-- | Documentation/hwmon/lm73 | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/Documentation/hwmon/lm73 b/Documentation/hwmon/lm73 new file mode 100644 index 000000000000..782b3e1055ca --- /dev/null +++ b/Documentation/hwmon/lm73 | |||
@@ -0,0 +1,79 @@ | |||
1 | Kernel driver lm73 | ||
2 | ================== | ||
3 | |||
4 | Supported chips: | ||
5 | * Texas Instruments LM73 | ||
6 | Prefix: 'lm73' | ||
7 | Addresses scanned: I2C 0x48, 0x49, 0x4a, 0x4c, 0x4d, and 0x4e | ||
8 | Datasheet: Publicly available at the Texas Instruments website | ||
9 | http://www.ti.com/product/lm73 | ||
10 | |||
11 | Author: Guillaume Ligneul <guillaume.ligneul@gmail.com> | ||
12 | Documentation: Chris Verges <kg4ysn@gmail.com> | ||
13 | |||
14 | |||
15 | Description | ||
16 | ----------- | ||
17 | |||
18 | The LM73 is a digital temperature sensor. All temperature values are | ||
19 | given in degrees Celsius. | ||
20 | |||
21 | Measurement Resolution Support | ||
22 | ------------------------------ | ||
23 | |||
24 | The LM73 supports four resolutions, defined in terms of degrees C per | ||
25 | LSB: 0.25, 0.125, 0.0625, and 0.3125. Changing the resolution mode | ||
26 | affects the conversion time of the LM73's analog-to-digital converter. | ||
27 | From userspace, the desired resolution can be specified as a function of | ||
28 | conversion time via the 'update_interval' sysfs attribute for the | ||
29 | device. This attribute will normalize ranges of input values to the | ||
30 | maximum times defined for the resolution in the datasheet. | ||
31 | |||
32 | Resolution Conv. Time Input Range | ||
33 | (C/LSB) (msec) (msec) | ||
34 | -------------------------------------- | ||
35 | 0.25 14 0..14 | ||
36 | 0.125 28 15..28 | ||
37 | 0.0625 56 29..56 | ||
38 | 0.03125 112 57..infinity | ||
39 | -------------------------------------- | ||
40 | |||
41 | The following examples show how the 'update_interval' attribute can be | ||
42 | used to change the conversion time: | ||
43 | |||
44 | $ echo 0 > update_interval | ||
45 | $ cat update_interval | ||
46 | 14 | ||
47 | $ cat temp1_input | ||
48 | 24250 | ||
49 | |||
50 | $ echo 22 > update_interval | ||
51 | $ cat update_interval | ||
52 | 28 | ||
53 | $ cat temp1_input | ||
54 | 24125 | ||
55 | |||
56 | $ echo 56 > update_interval | ||
57 | $ cat update_interval | ||
58 | 56 | ||
59 | $ cat temp1_input | ||
60 | 24062 | ||
61 | |||
62 | $ echo 85 > update_interval | ||
63 | $ cat update_interval | ||
64 | 112 | ||
65 | $ cat temp1_input | ||
66 | 24031 | ||
67 | |||
68 | As shown here, the lm73 driver automatically adjusts any user input for | ||
69 | 'update_interval' via a step function. Reading back the | ||
70 | 'update_interval' value after a write operation will confirm the | ||
71 | conversion time actively in use. | ||
72 | |||
73 | Mathematically, the resolution can be derived from the conversion time | ||
74 | via the following function: | ||
75 | |||
76 | g(x) = 0.250 * [log(x/14) / log(2)] | ||
77 | |||
78 | where 'x' is the output from 'update_interval' and 'g(x)' is the | ||
79 | resolution in degrees C per LSB. | ||