aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/hwmon/lm90
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2005-10-26 15:39:40 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-10-28 17:02:14 -0400
commitc3df5806cdae6fac678c662b527cb974bef4b60c (patch)
treea510da8447852247907dd6896cdf51c7e3d60844 /Documentation/hwmon/lm90
parent8256fe0f40f1cd72f80f2c46fe0ab1638f03a98d (diff)
[PATCH] hwmon: Add PEC support to the lm90 driver
Add PEC support to the lm90 driver. Only the ADM1032 chip supports it, and in a rather tricky way, which is why this patch comes with documentation reinforcements. At least, this demonstrates that the new PEC support logic in i2c-core can properly deal with chips with partial PEC support. As enabling PEC causes a significant performance drop, it can be disabled through a sysfs file (unsurprisingly named "pec"). Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'Documentation/hwmon/lm90')
-rw-r--r--Documentation/hwmon/lm9039
1 files changed, 37 insertions, 2 deletions
diff --git a/Documentation/hwmon/lm90 b/Documentation/hwmon/lm90
index 2c4cf39471f4..70abf93ea376 100644
--- a/Documentation/hwmon/lm90
+++ b/Documentation/hwmon/lm90
@@ -71,8 +71,8 @@ increased resolution of the remote temperature measurement.
71 71
72The different chipsets of the family are not strictly identical, although 72The different chipsets of the family are not strictly identical, although
73very similar. This driver doesn't handle any specific feature for now, 73very similar. This driver doesn't handle any specific feature for now,
74but could if there ever was a need for it. For reference, here comes a 74with the exception of SMBus PEC. For reference, here comes a non-exhaustive
75non-exhaustive list of specific features: 75list of specific features:
76 76
77LM90: 77LM90:
78 * Filter and alert configuration register at 0xBF. 78 * Filter and alert configuration register at 0xBF.
@@ -91,6 +91,7 @@ ADM1032:
91 * Conversion averaging. 91 * Conversion averaging.
92 * Up to 64 conversions/s. 92 * Up to 64 conversions/s.
93 * ALERT is triggered by open remote sensor. 93 * ALERT is triggered by open remote sensor.
94 * SMBus PEC support for Write Byte and Receive Byte transactions.
94 95
95ADT7461 96ADT7461
96 * Extended temperature range (breaks compatibility) 97 * Extended temperature range (breaks compatibility)
@@ -119,3 +120,37 @@ The lm90 driver will not update its values more frequently than every
119other second; reading them more often will do no harm, but will return 120other second; reading them more often will do no harm, but will return
120'old' values. 121'old' values.
121 122
123PEC Support
124-----------
125
126The ADM1032 is the only chip of the family which supports PEC. It does
127not support PEC on all transactions though, so some care must be taken.
128
129When reading a register value, the PEC byte is computed and sent by the
130ADM1032 chip. However, in the case of a combined transaction (SMBus Read
131Byte), the ADM1032 computes the CRC value over only the second half of
132the message rather than its entirety, because it thinks the first half
133of the message belongs to a different transaction. As a result, the CRC
134value differs from what the SMBus master expects, and all reads fail.
135
136For this reason, the lm90 driver will enable PEC for the ADM1032 only if
137the bus supports the SMBus Send Byte and Receive Byte transaction types.
138These transactions will be used to read register values, instead of
139SMBus Read Byte, and PEC will work properly.
140
141Additionally, the ADM1032 doesn't support SMBus Send Byte with PEC.
142Instead, it will try to write the PEC value to the register (because the
143SMBus Send Byte transaction with PEC is similar to a Write Byte transaction
144without PEC), which is not what we want. Thus, PEC is explicitely disabled
145on SMBus Send Byte transactions in the lm90 driver.
146
147PEC on byte data transactions represents a significant increase in bandwidth
148usage (+33% for writes, +25% for reads) in normal conditions. With the need
149to use two SMBus transaction for reads, this overhead jumps to +50%. Worse,
150two transactions will typically mean twice as much delay waiting for
151transaction completion, effectively doubling the register cache refresh time.
152I guess reliability comes at a price, but it's quite expensive this time.
153
154So, as not everyone might enjoy the slowdown, PEC can be disabled through
155sysfs. Just write 0 to the "pec" file and PEC will be disabled. Write 1
156to that file to enable PEC again.