xref: /OK3568_Linux_fs/kernel/Documentation/hwmon/lm90.rst (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunKernel driver lm90
2*4882a593Smuzhiyun==================
3*4882a593Smuzhiyun
4*4882a593SmuzhiyunSupported chips:
5*4882a593Smuzhiyun
6*4882a593Smuzhiyun  * National Semiconductor LM90
7*4882a593Smuzhiyun
8*4882a593Smuzhiyun    Prefix: 'lm90'
9*4882a593Smuzhiyun
10*4882a593Smuzhiyun    Addresses scanned: I2C 0x4c
11*4882a593Smuzhiyun
12*4882a593Smuzhiyun    Datasheet: Publicly available at the National Semiconductor website
13*4882a593Smuzhiyun
14*4882a593Smuzhiyun	       http://www.national.com/pf/LM/LM90.html
15*4882a593Smuzhiyun
16*4882a593Smuzhiyun  * National Semiconductor LM89
17*4882a593Smuzhiyun
18*4882a593Smuzhiyun    Prefix: 'lm89' (no auto-detection)
19*4882a593Smuzhiyun
20*4882a593Smuzhiyun    Addresses scanned: I2C 0x4c and 0x4d
21*4882a593Smuzhiyun
22*4882a593Smuzhiyun    Datasheet: Publicly available at the National Semiconductor website
23*4882a593Smuzhiyun
24*4882a593Smuzhiyun	       http://www.national.com/mpf/LM/LM89.html
25*4882a593Smuzhiyun
26*4882a593Smuzhiyun  * National Semiconductor LM99
27*4882a593Smuzhiyun
28*4882a593Smuzhiyun    Prefix: 'lm99'
29*4882a593Smuzhiyun
30*4882a593Smuzhiyun    Addresses scanned: I2C 0x4c and 0x4d
31*4882a593Smuzhiyun
32*4882a593Smuzhiyun    Datasheet: Publicly available at the National Semiconductor website
33*4882a593Smuzhiyun
34*4882a593Smuzhiyun	       http://www.national.com/pf/LM/LM99.html
35*4882a593Smuzhiyun
36*4882a593Smuzhiyun  * National Semiconductor LM86
37*4882a593Smuzhiyun
38*4882a593Smuzhiyun    Prefix: 'lm86'
39*4882a593Smuzhiyun
40*4882a593Smuzhiyun    Addresses scanned: I2C 0x4c
41*4882a593Smuzhiyun
42*4882a593Smuzhiyun    Datasheet: Publicly available at the National Semiconductor website
43*4882a593Smuzhiyun
44*4882a593Smuzhiyun	       http://www.national.com/mpf/LM/LM86.html
45*4882a593Smuzhiyun
46*4882a593Smuzhiyun  * Analog Devices ADM1032
47*4882a593Smuzhiyun
48*4882a593Smuzhiyun    Prefix: 'adm1032'
49*4882a593Smuzhiyun
50*4882a593Smuzhiyun    Addresses scanned: I2C 0x4c and 0x4d
51*4882a593Smuzhiyun
52*4882a593Smuzhiyun    Datasheet: Publicly available at the ON Semiconductor website
53*4882a593Smuzhiyun
54*4882a593Smuzhiyun	       https://www.onsemi.com/PowerSolutions/product.do?id=ADM1032
55*4882a593Smuzhiyun
56*4882a593Smuzhiyun  * Analog Devices ADT7461
57*4882a593Smuzhiyun
58*4882a593Smuzhiyun    Prefix: 'adt7461'
59*4882a593Smuzhiyun
60*4882a593Smuzhiyun    Addresses scanned: I2C 0x4c and 0x4d
61*4882a593Smuzhiyun
62*4882a593Smuzhiyun    Datasheet: Publicly available at the ON Semiconductor website
63*4882a593Smuzhiyun
64*4882a593Smuzhiyun	       https://www.onsemi.com/PowerSolutions/product.do?id=ADT7461
65*4882a593Smuzhiyun
66*4882a593Smuzhiyun  * Analog Devices ADT7461A
67*4882a593Smuzhiyun
68*4882a593Smuzhiyun    Prefix: 'adt7461a'
69*4882a593Smuzhiyun
70*4882a593Smuzhiyun    Addresses scanned: I2C 0x4c and 0x4d
71*4882a593Smuzhiyun
72*4882a593Smuzhiyun    Datasheet: Publicly available at the ON Semiconductor website
73*4882a593Smuzhiyun
74*4882a593Smuzhiyun	       https://www.onsemi.com/PowerSolutions/product.do?id=ADT7461A
75*4882a593Smuzhiyun
76*4882a593Smuzhiyun  * ON Semiconductor NCT1008
77*4882a593Smuzhiyun
78*4882a593Smuzhiyun    Prefix: 'nct1008'
79*4882a593Smuzhiyun
80*4882a593Smuzhiyun    Addresses scanned: I2C 0x4c and 0x4d
81*4882a593Smuzhiyun
82*4882a593Smuzhiyun    Datasheet: Publicly available at the ON Semiconductor website
83*4882a593Smuzhiyun
84*4882a593Smuzhiyun	       https://www.onsemi.com/PowerSolutions/product.do?id=NCT1008
85*4882a593Smuzhiyun
86*4882a593Smuzhiyun  * Maxim MAX6646
87*4882a593Smuzhiyun
88*4882a593Smuzhiyun    Prefix: 'max6646'
89*4882a593Smuzhiyun
90*4882a593Smuzhiyun    Addresses scanned: I2C 0x4d
91*4882a593Smuzhiyun
92*4882a593Smuzhiyun    Datasheet: Publicly available at the Maxim website
93*4882a593Smuzhiyun
94*4882a593Smuzhiyun	       http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3497
95*4882a593Smuzhiyun
96*4882a593Smuzhiyun  * Maxim MAX6647
97*4882a593Smuzhiyun
98*4882a593Smuzhiyun    Prefix: 'max6646'
99*4882a593Smuzhiyun
100*4882a593Smuzhiyun    Addresses scanned: I2C 0x4e
101*4882a593Smuzhiyun
102*4882a593Smuzhiyun    Datasheet: Publicly available at the Maxim website
103*4882a593Smuzhiyun
104*4882a593Smuzhiyun	       http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3497
105*4882a593Smuzhiyun
106*4882a593Smuzhiyun  * Maxim MAX6648
107*4882a593Smuzhiyun
108*4882a593Smuzhiyun    Prefix: 'max6646'
109*4882a593Smuzhiyun
110*4882a593Smuzhiyun    Addresses scanned: I2C 0x4c
111*4882a593Smuzhiyun
112*4882a593Smuzhiyun    Datasheet: Publicly available at the Maxim website
113*4882a593Smuzhiyun
114*4882a593Smuzhiyun	       http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3500
115*4882a593Smuzhiyun
116*4882a593Smuzhiyun  * Maxim MAX6649
117*4882a593Smuzhiyun
118*4882a593Smuzhiyun    Prefix: 'max6646'
119*4882a593Smuzhiyun
120*4882a593Smuzhiyun    Addresses scanned: I2C 0x4c
121*4882a593Smuzhiyun
122*4882a593Smuzhiyun    Datasheet: Publicly available at the Maxim website
123*4882a593Smuzhiyun
124*4882a593Smuzhiyun	       http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3497
125*4882a593Smuzhiyun
126*4882a593Smuzhiyun  * Maxim MAX6654
127*4882a593Smuzhiyun
128*4882a593Smuzhiyun    Prefix: 'max6654'
129*4882a593Smuzhiyun
130*4882a593Smuzhiyun    Addresses scanned: I2C 0x18, 0x19, 0x1a, 0x29, 0x2a, 0x2b,
131*4882a593Smuzhiyun
132*4882a593Smuzhiyun			   0x4c, 0x4d and 0x4e
133*4882a593Smuzhiyun
134*4882a593Smuzhiyun    Datasheet: Publicly available at the Maxim website
135*4882a593Smuzhiyun
136*4882a593Smuzhiyun	       https://www.maximintegrated.com/en/products/sensors/MAX6654.html
137*4882a593Smuzhiyun
138*4882a593Smuzhiyun  * Maxim MAX6657
139*4882a593Smuzhiyun
140*4882a593Smuzhiyun    Prefix: 'max6657'
141*4882a593Smuzhiyun
142*4882a593Smuzhiyun    Addresses scanned: I2C 0x4c
143*4882a593Smuzhiyun
144*4882a593Smuzhiyun    Datasheet: Publicly available at the Maxim website
145*4882a593Smuzhiyun
146*4882a593Smuzhiyun	       http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2578
147*4882a593Smuzhiyun
148*4882a593Smuzhiyun  * Maxim MAX6658
149*4882a593Smuzhiyun
150*4882a593Smuzhiyun    Prefix: 'max6657'
151*4882a593Smuzhiyun
152*4882a593Smuzhiyun    Addresses scanned: I2C 0x4c
153*4882a593Smuzhiyun
154*4882a593Smuzhiyun    Datasheet: Publicly available at the Maxim website
155*4882a593Smuzhiyun
156*4882a593Smuzhiyun	       http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2578
157*4882a593Smuzhiyun
158*4882a593Smuzhiyun  * Maxim MAX6659
159*4882a593Smuzhiyun
160*4882a593Smuzhiyun    Prefix: 'max6659'
161*4882a593Smuzhiyun
162*4882a593Smuzhiyun    Addresses scanned: I2C 0x4c, 0x4d, 0x4e
163*4882a593Smuzhiyun
164*4882a593Smuzhiyun    Datasheet: Publicly available at the Maxim website
165*4882a593Smuzhiyun
166*4882a593Smuzhiyun	       http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2578
167*4882a593Smuzhiyun
168*4882a593Smuzhiyun  * Maxim MAX6680
169*4882a593Smuzhiyun
170*4882a593Smuzhiyun    Prefix: 'max6680'
171*4882a593Smuzhiyun
172*4882a593Smuzhiyun    Addresses scanned: I2C 0x18, 0x19, 0x1a, 0x29, 0x2a, 0x2b,
173*4882a593Smuzhiyun
174*4882a593Smuzhiyun			   0x4c, 0x4d and 0x4e
175*4882a593Smuzhiyun
176*4882a593Smuzhiyun    Datasheet: Publicly available at the Maxim website
177*4882a593Smuzhiyun
178*4882a593Smuzhiyun	       http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3370
179*4882a593Smuzhiyun
180*4882a593Smuzhiyun  * Maxim MAX6681
181*4882a593Smuzhiyun
182*4882a593Smuzhiyun    Prefix: 'max6680'
183*4882a593Smuzhiyun
184*4882a593Smuzhiyun    Addresses scanned: I2C 0x18, 0x19, 0x1a, 0x29, 0x2a, 0x2b,
185*4882a593Smuzhiyun
186*4882a593Smuzhiyun			   0x4c, 0x4d and 0x4e
187*4882a593Smuzhiyun
188*4882a593Smuzhiyun    Datasheet: Publicly available at the Maxim website
189*4882a593Smuzhiyun
190*4882a593Smuzhiyun	       http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3370
191*4882a593Smuzhiyun
192*4882a593Smuzhiyun  * Maxim MAX6692
193*4882a593Smuzhiyun
194*4882a593Smuzhiyun    Prefix: 'max6646'
195*4882a593Smuzhiyun
196*4882a593Smuzhiyun    Addresses scanned: I2C 0x4c
197*4882a593Smuzhiyun
198*4882a593Smuzhiyun    Datasheet: Publicly available at the Maxim website
199*4882a593Smuzhiyun
200*4882a593Smuzhiyun	       http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3500
201*4882a593Smuzhiyun
202*4882a593Smuzhiyun  * Maxim MAX6695
203*4882a593Smuzhiyun
204*4882a593Smuzhiyun    Prefix: 'max6695'
205*4882a593Smuzhiyun
206*4882a593Smuzhiyun    Addresses scanned: I2C 0x18
207*4882a593Smuzhiyun
208*4882a593Smuzhiyun    Datasheet: Publicly available at the Maxim website
209*4882a593Smuzhiyun
210*4882a593Smuzhiyun	       http://www.maxim-ic.com/datasheet/index.mvp/id/4199
211*4882a593Smuzhiyun
212*4882a593Smuzhiyun  * Maxim MAX6696
213*4882a593Smuzhiyun
214*4882a593Smuzhiyun    Prefix: 'max6695'
215*4882a593Smuzhiyun
216*4882a593Smuzhiyun    Addresses scanned: I2C 0x18, 0x19, 0x1a, 0x29, 0x2a, 0x2b,
217*4882a593Smuzhiyun
218*4882a593Smuzhiyun			   0x4c, 0x4d and 0x4e
219*4882a593Smuzhiyun
220*4882a593Smuzhiyun    Datasheet: Publicly available at the Maxim website
221*4882a593Smuzhiyun
222*4882a593Smuzhiyun	       http://www.maxim-ic.com/datasheet/index.mvp/id/4199
223*4882a593Smuzhiyun
224*4882a593Smuzhiyun  * Winbond/Nuvoton W83L771W/G
225*4882a593Smuzhiyun
226*4882a593Smuzhiyun    Prefix: 'w83l771'
227*4882a593Smuzhiyun
228*4882a593Smuzhiyun    Addresses scanned: I2C 0x4c
229*4882a593Smuzhiyun
230*4882a593Smuzhiyun    Datasheet: No longer available
231*4882a593Smuzhiyun
232*4882a593Smuzhiyun  * Winbond/Nuvoton W83L771AWG/ASG
233*4882a593Smuzhiyun
234*4882a593Smuzhiyun    Prefix: 'w83l771'
235*4882a593Smuzhiyun
236*4882a593Smuzhiyun    Addresses scanned: I2C 0x4c
237*4882a593Smuzhiyun
238*4882a593Smuzhiyun    Datasheet: Not publicly available, can be requested from Nuvoton
239*4882a593Smuzhiyun
240*4882a593Smuzhiyun  * Philips/NXP SA56004X
241*4882a593Smuzhiyun
242*4882a593Smuzhiyun    Prefix: 'sa56004'
243*4882a593Smuzhiyun
244*4882a593Smuzhiyun    Addresses scanned: I2C 0x48 through 0x4F
245*4882a593Smuzhiyun
246*4882a593Smuzhiyun    Datasheet: Publicly available at NXP website
247*4882a593Smuzhiyun
248*4882a593Smuzhiyun	       http://ics.nxp.com/products/interface/datasheet/sa56004x.pdf
249*4882a593Smuzhiyun
250*4882a593Smuzhiyun  * GMT G781
251*4882a593Smuzhiyun
252*4882a593Smuzhiyun    Prefix: 'g781'
253*4882a593Smuzhiyun
254*4882a593Smuzhiyun    Addresses scanned: I2C 0x4c, 0x4d
255*4882a593Smuzhiyun
256*4882a593Smuzhiyun    Datasheet: Not publicly available from GMT
257*4882a593Smuzhiyun
258*4882a593Smuzhiyun  * Texas Instruments TMP451
259*4882a593Smuzhiyun
260*4882a593Smuzhiyun    Prefix: 'tmp451'
261*4882a593Smuzhiyun
262*4882a593Smuzhiyun    Addresses scanned: I2C 0x4c
263*4882a593Smuzhiyun
264*4882a593Smuzhiyun    Datasheet: Publicly available at TI website
265*4882a593Smuzhiyun
266*4882a593Smuzhiyun	       https://www.ti.com/litv/pdf/sbos686
267*4882a593Smuzhiyun
268*4882a593Smuzhiyun  * Texas Instruments TMP461
269*4882a593Smuzhiyun
270*4882a593Smuzhiyun    Prefix: 'tmp461'
271*4882a593Smuzhiyun
272*4882a593Smuzhiyun    Addresses scanned: I2C 0x48 through 0x4F
273*4882a593Smuzhiyun
274*4882a593Smuzhiyun    Datasheet: Publicly available at TI website
275*4882a593Smuzhiyun
276*4882a593Smuzhiyun	       https://www.ti.com/lit/gpn/tmp461
277*4882a593Smuzhiyun
278*4882a593SmuzhiyunAuthor: Jean Delvare <jdelvare@suse.de>
279*4882a593Smuzhiyun
280*4882a593Smuzhiyun
281*4882a593SmuzhiyunDescription
282*4882a593Smuzhiyun-----------
283*4882a593Smuzhiyun
284*4882a593SmuzhiyunThe LM90 is a digital temperature sensor. It senses its own temperature as
285*4882a593Smuzhiyunwell as the temperature of up to one external diode. It is compatible
286*4882a593Smuzhiyunwith many other devices, many of which are supported by this driver.
287*4882a593Smuzhiyun
288*4882a593SmuzhiyunNote that there is no easy way to differentiate between the MAX6657,
289*4882a593SmuzhiyunMAX6658 and MAX6659 variants. The extra features of the MAX6659 are only
290*4882a593Smuzhiyunsupported by this driver if the chip is located at address 0x4d or 0x4e,
291*4882a593Smuzhiyunor if the chip type is explicitly selected as max6659.
292*4882a593SmuzhiyunThe MAX6680 and MAX6681 only differ in their pinout, therefore they obviously
293*4882a593Smuzhiyuncan't (and don't need to) be distinguished.
294*4882a593Smuzhiyun
295*4882a593SmuzhiyunThe specificity of this family of chipsets over the ADM1021/LM84
296*4882a593Smuzhiyunfamily is that it features critical limits with hysteresis, and an
297*4882a593Smuzhiyunincreased resolution of the remote temperature measurement.
298*4882a593Smuzhiyun
299*4882a593SmuzhiyunThe different chipsets of the family are not strictly identical, although
300*4882a593Smuzhiyunvery similar. For reference, here comes a non-exhaustive list of specific
301*4882a593Smuzhiyunfeatures:
302*4882a593Smuzhiyun
303*4882a593SmuzhiyunLM90:
304*4882a593Smuzhiyun  * Filter and alert configuration register at 0xBF.
305*4882a593Smuzhiyun  * ALERT is triggered by temperatures over critical limits.
306*4882a593Smuzhiyun
307*4882a593SmuzhiyunLM86 and LM89:
308*4882a593Smuzhiyun  * Same as LM90
309*4882a593Smuzhiyun  * Better external channel accuracy
310*4882a593Smuzhiyun
311*4882a593SmuzhiyunLM99:
312*4882a593Smuzhiyun  * Same as LM89
313*4882a593Smuzhiyun  * External temperature shifted by 16 degrees down
314*4882a593Smuzhiyun
315*4882a593SmuzhiyunADM1032:
316*4882a593Smuzhiyun  * Consecutive alert register at 0x22.
317*4882a593Smuzhiyun  * Conversion averaging.
318*4882a593Smuzhiyun  * Up to 64 conversions/s.
319*4882a593Smuzhiyun  * ALERT is triggered by open remote sensor.
320*4882a593Smuzhiyun  * SMBus PEC support for Write Byte and Receive Byte transactions.
321*4882a593Smuzhiyun
322*4882a593SmuzhiyunADT7461, ADT7461A, NCT1008:
323*4882a593Smuzhiyun  * Extended temperature range (breaks compatibility)
324*4882a593Smuzhiyun  * Lower resolution for remote temperature
325*4882a593Smuzhiyun
326*4882a593SmuzhiyunMAX6654:
327*4882a593Smuzhiyun  * Better local resolution
328*4882a593Smuzhiyun  * Selectable address
329*4882a593Smuzhiyun  * Remote sensor type selection
330*4882a593Smuzhiyun  * Extended temperature range
331*4882a593Smuzhiyun  * Extended resolution only available when conversion rate <= 1 Hz
332*4882a593Smuzhiyun
333*4882a593SmuzhiyunMAX6657 and MAX6658:
334*4882a593Smuzhiyun  * Better local resolution
335*4882a593Smuzhiyun  * Remote sensor type selection
336*4882a593Smuzhiyun
337*4882a593SmuzhiyunMAX6659:
338*4882a593Smuzhiyun  * Better local resolution
339*4882a593Smuzhiyun  * Selectable address
340*4882a593Smuzhiyun  * Second critical temperature limit
341*4882a593Smuzhiyun  * Remote sensor type selection
342*4882a593Smuzhiyun
343*4882a593SmuzhiyunMAX6680 and MAX6681:
344*4882a593Smuzhiyun  * Selectable address
345*4882a593Smuzhiyun  * Remote sensor type selection
346*4882a593Smuzhiyun
347*4882a593SmuzhiyunMAX6695 and MAX6696:
348*4882a593Smuzhiyun  * Better local resolution
349*4882a593Smuzhiyun  * Selectable address (max6696)
350*4882a593Smuzhiyun  * Second critical temperature limit
351*4882a593Smuzhiyun  * Two remote sensors
352*4882a593Smuzhiyun
353*4882a593SmuzhiyunW83L771W/G
354*4882a593Smuzhiyun  * The G variant is lead-free, otherwise similar to the W.
355*4882a593Smuzhiyun  * Filter and alert configuration register at 0xBF
356*4882a593Smuzhiyun  * Moving average (depending on conversion rate)
357*4882a593Smuzhiyun
358*4882a593SmuzhiyunW83L771AWG/ASG
359*4882a593Smuzhiyun  * Successor of the W83L771W/G, same features.
360*4882a593Smuzhiyun  * The AWG and ASG variants only differ in package format.
361*4882a593Smuzhiyun  * Diode ideality factor configuration (remote sensor) at 0xE3
362*4882a593Smuzhiyun
363*4882a593SmuzhiyunSA56004X:
364*4882a593Smuzhiyun  * Better local resolution
365*4882a593Smuzhiyun
366*4882a593SmuzhiyunAll temperature values are given in degrees Celsius. Resolution
367*4882a593Smuzhiyunis 1.0 degree for the local temperature, 0.125 degree for the remote
368*4882a593Smuzhiyuntemperature, except for the MAX6654, MAX6657, MAX6658 and MAX6659 which have
369*4882a593Smuzhiyuna resolution of 0.125 degree for both temperatures.
370*4882a593Smuzhiyun
371*4882a593SmuzhiyunEach sensor has its own high and low limits, plus a critical limit.
372*4882a593SmuzhiyunAdditionally, there is a relative hysteresis value common to both critical
373*4882a593Smuzhiyunvalues. To make life easier to user-space applications, two absolute values
374*4882a593Smuzhiyunare exported, one for each channel, but these values are of course linked.
375*4882a593SmuzhiyunOnly the local hysteresis can be set from user-space, and the same delta
376*4882a593Smuzhiyunapplies to the remote hysteresis.
377*4882a593Smuzhiyun
378*4882a593SmuzhiyunThe lm90 driver will not update its values more frequently than configured with
379*4882a593Smuzhiyunthe update_interval attribute; reading them more often will do no harm, but will
380*4882a593Smuzhiyunreturn 'old' values.
381*4882a593Smuzhiyun
382*4882a593SmuzhiyunSMBus Alert Support
383*4882a593Smuzhiyun-------------------
384*4882a593Smuzhiyun
385*4882a593SmuzhiyunThis driver has basic support for SMBus alert. When an alert is received,
386*4882a593Smuzhiyunthe status register is read and the faulty temperature channel is logged.
387*4882a593Smuzhiyun
388*4882a593SmuzhiyunThe Analog Devices chips (ADM1032, ADT7461 and ADT7461A) and ON
389*4882a593SmuzhiyunSemiconductor chips (NCT1008) do not implement the SMBus alert protocol
390*4882a593Smuzhiyunproperly so additional care is needed: the ALERT output is disabled when
391*4882a593Smuzhiyunan alert is received, and is re-enabled only when the alarm is gone.
392*4882a593SmuzhiyunOtherwise the chip would block alerts from other chips in the bus as long
393*4882a593Smuzhiyunas the alarm is active.
394*4882a593Smuzhiyun
395*4882a593SmuzhiyunPEC Support
396*4882a593Smuzhiyun-----------
397*4882a593Smuzhiyun
398*4882a593SmuzhiyunThe ADM1032 is the only chip of the family which supports PEC. It does
399*4882a593Smuzhiyunnot support PEC on all transactions though, so some care must be taken.
400*4882a593Smuzhiyun
401*4882a593SmuzhiyunWhen reading a register value, the PEC byte is computed and sent by the
402*4882a593SmuzhiyunADM1032 chip. However, in the case of a combined transaction (SMBus Read
403*4882a593SmuzhiyunByte), the ADM1032 computes the CRC value over only the second half of
404*4882a593Smuzhiyunthe message rather than its entirety, because it thinks the first half
405*4882a593Smuzhiyunof the message belongs to a different transaction. As a result, the CRC
406*4882a593Smuzhiyunvalue differs from what the SMBus master expects, and all reads fail.
407*4882a593Smuzhiyun
408*4882a593SmuzhiyunFor this reason, the lm90 driver will enable PEC for the ADM1032 only if
409*4882a593Smuzhiyunthe bus supports the SMBus Send Byte and Receive Byte transaction types.
410*4882a593SmuzhiyunThese transactions will be used to read register values, instead of
411*4882a593SmuzhiyunSMBus Read Byte, and PEC will work properly.
412*4882a593Smuzhiyun
413*4882a593SmuzhiyunAdditionally, the ADM1032 doesn't support SMBus Send Byte with PEC.
414*4882a593SmuzhiyunInstead, it will try to write the PEC value to the register (because the
415*4882a593SmuzhiyunSMBus Send Byte transaction with PEC is similar to a Write Byte transaction
416*4882a593Smuzhiyunwithout PEC), which is not what we want. Thus, PEC is explicitly disabled
417*4882a593Smuzhiyunon SMBus Send Byte transactions in the lm90 driver.
418*4882a593Smuzhiyun
419*4882a593SmuzhiyunPEC on byte data transactions represents a significant increase in bandwidth
420*4882a593Smuzhiyunusage (+33% for writes, +25% for reads) in normal conditions. With the need
421*4882a593Smuzhiyunto use two SMBus transaction for reads, this overhead jumps to +50%. Worse,
422*4882a593Smuzhiyuntwo transactions will typically mean twice as much delay waiting for
423*4882a593Smuzhiyuntransaction completion, effectively doubling the register cache refresh time.
424*4882a593SmuzhiyunI guess reliability comes at a price, but it's quite expensive this time.
425*4882a593Smuzhiyun
426*4882a593SmuzhiyunSo, as not everyone might enjoy the slowdown, PEC can be disabled through
427*4882a593Smuzhiyunsysfs. Just write 0 to the "pec" file and PEC will be disabled. Write 1
428*4882a593Smuzhiyunto that file to enable PEC again.
429