summaryrefslogtreecommitdiffstats
path: root/Documentation/hwmon/lm90.rst
blob: 23af17a0ab442da9e3882fcbe0c0d0f325e4bad5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
Kernel driver lm90
==================

Supported chips:

  * National Semiconductor LM84

    Prefix: 'lm84'

    Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e

    Datasheet: Publicly available at the National Semiconductor website

  * National Semiconductor LM90

    Prefix: 'lm90'

    Addresses scanned: I2C 0x4c

    Datasheet: Publicly available at the National Semiconductor website

	       http://www.national.com/pf/LM/LM90.html

  * National Semiconductor LM89

    Prefix: 'lm89' (no auto-detection)

    Addresses scanned: I2C 0x4c and 0x4d

    Datasheet: Publicly available at the National Semiconductor website

	       http://www.national.com/mpf/LM/LM89.html

  * National Semiconductor LM99

    Prefix: 'lm99'

    Addresses scanned: I2C 0x4c and 0x4d

    Datasheet: Publicly available at the National Semiconductor website

	       http://www.national.com/pf/LM/LM99.html

  * National Semiconductor LM86

    Prefix: 'lm86'

    Addresses scanned: I2C 0x4c

    Datasheet: Publicly available at the National Semiconductor website

	       http://www.national.com/mpf/LM/LM86.html

  * Analog Devices ADM1020

    Prefix: 'adm1020'

    Addresses scanned: I2C 0x4c - 0x4e

    Datasheet: Publicly available at the Analog Devices website

  * Analog Devices ADM1021

    Prefix: 'adm1021'

    Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e

    Datasheet: Publicly available at the Analog Devices website

  * Analog Devices ADM1021A/ADM1023

    Prefix: 'adm1023'

    Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e

    Datasheet: Publicly available at the Analog Devices website

  * Analog Devices ADM1032

    Prefix: 'adm1032'

    Addresses scanned: I2C 0x4c and 0x4d

    Datasheet: Publicly available at the ON Semiconductor website

	       https://www.onsemi.com/PowerSolutions/product.do?id=ADM1032

  * Analog Devices ADT7461

    Prefix: 'adt7461'

    Addresses scanned: I2C 0x4c and 0x4d

    Datasheet: Publicly available at the ON Semiconductor website

	       https://www.onsemi.com/PowerSolutions/product.do?id=ADT7461

  * Analog Devices ADT7461A

    Prefix: 'adt7461a'

    Addresses scanned: I2C 0x4c and 0x4d

    Datasheet: Publicly available at the ON Semiconductor website

	       https://www.onsemi.com/PowerSolutions/product.do?id=ADT7461A

  * Analog Devices ADT7481

    Prefix: 'adt7481'

    Addresses scanned: I2C 0x4b and 0x4c

    Datasheet: Publicly available at the ON Semiconductor website

	       https://www.onsemi.com/PowerSolutions/product.do?id=ADT7481

  * Analog Devices ADT7482

    Prefix: 'adt7482'

    Addresses scanned: I2C 0x4c

    Datasheet: Publicly available at the ON Semiconductor website

	       https://www.onsemi.com/PowerSolutions/product.do?id=ADT7482

  * Analog Devices ADT7483A

    Prefix: 'adt7483a'

    Addresses scanned: I2C 0x18, 0x19, 0x1a, 0x29, 0x2a, 0x2b, 0x4c, 0x4d, 0x4e

    Datasheet: Publicly available at the ON Semiconductor website

	       https://www.onsemi.com/PowerSolutions/product.do?id=ADT7483A

  * ON Semiconductor NCT1008

    Prefix: 'nct1008'

    Addresses scanned: I2C 0x4c and 0x4d

    Datasheet: Publicly available at the ON Semiconductor website

	       https://www.onsemi.com/PowerSolutions/product.do?id=NCT1008

  * ON Semiconductor NCT210

    Prefix: 'adm1021'

    Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e

    Datasheet: Publicly available at the ON Semiconductor website

	       https://www.onsemi.com/PowerSolutions/product.do?id=NCT210

  * ON Semiconductor NCT214

    Prefix: 'nct214'

    Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e

    Datasheet: Publicly available at the ON Semiconductor website

	       https://www.onsemi.com/PowerSolutions/product.do?id=NCT214

  * ON Semiconductor NCT218

    Prefix: 'nct218'

    Addresses scanned: I2C 0x4c - 0x4d

    Datasheet: Publicly available at the ON Semiconductor website

	       https://www.onsemi.com/PowerSolutions/product.do?id=NCT218

  * ON Semiconductor NCT72

    Prefix: 'nct72'

    Addresses scanned: I2C 0x4c - 0x4d

    Datasheet: Publicly available at the ON Semiconductor website

	       https://www.onsemi.com/PowerSolutions/product.do?id=NCT72

  * Maxim MAX1617

    Prefix: 'max1617'

    Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e

    Datasheet: Publicly available at the Maxim website

  * Maxim MAX1617A

    Prefix: 'max1617a'

    Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e

    Datasheet: Publicly available at the Maxim website

  * Maxim MAX6642

    Prefix: 'max6642'

    Addresses scanned: I2C 0x48-0x4f

    Datasheet: Publicly available at the Maxim website

	       http://datasheets.maxim-ic.com/en/ds/MAX6642.pdf

  * Maxim MAX6646

    Prefix: 'max6646'

    Addresses scanned: I2C 0x4d

    Datasheet: Publicly available at the Maxim website

	       http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3497

  * Maxim MAX6647

    Prefix: 'max6646'

    Addresses scanned: I2C 0x4e

    Datasheet: Publicly available at the Maxim website

	       http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3497

  * Maxim MAX6648

    Prefix: 'max6648'

    Addresses scanned: I2C 0x4c

    Datasheet: Publicly available at the Maxim website

	       http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3500

  * Maxim MAX6649

    Prefix: 'max6646'

    Addresses scanned: I2C 0x4c

    Datasheet: Publicly available at the Maxim website

	       http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3497

  * Maxim MAX6654

    Prefix: 'max6654'

    Addresses scanned: I2C 0x18, 0x19, 0x1a, 0x29, 0x2a, 0x2b,

			   0x4c, 0x4d and 0x4e

    Datasheet: Publicly available at the Maxim website

	       https://www.maximintegrated.com/en/products/sensors/MAX6654.html

  * Maxim MAX6657

    Prefix: 'max6657'

    Addresses scanned: I2C 0x4c

    Datasheet: Publicly available at the Maxim website

	       http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2578

  * Maxim MAX6658

    Prefix: 'max6657'

    Addresses scanned: I2C 0x4c

    Datasheet: Publicly available at the Maxim website

	       http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2578

  * Maxim MAX6659

    Prefix: 'max6659'

    Addresses scanned: I2C 0x4c, 0x4d, 0x4e

    Datasheet: Publicly available at the Maxim website

	       http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2578

  * Maxim MAX6680

    Prefix: 'max6680'

    Addresses scanned: I2C 0x18, 0x19, 0x1a, 0x29, 0x2a, 0x2b,

			   0x4c, 0x4d and 0x4e

    Datasheet: Publicly available at the Maxim website

	       http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3370

  * Maxim MAX6681

    Prefix: 'max6680'

    Addresses scanned: I2C 0x18, 0x19, 0x1a, 0x29, 0x2a, 0x2b,

			   0x4c, 0x4d and 0x4e

    Datasheet: Publicly available at the Maxim website

	       http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3370

  * Maxim MAX6692

    Prefix: 'max6648'

    Addresses scanned: I2C 0x4c

    Datasheet: Publicly available at the Maxim website

	       http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3500

  * Maxim MAX6695

    Prefix: 'max6695'

    Addresses scanned: I2C 0x18

    Datasheet: Publicly available at the Maxim website

	       http://www.maxim-ic.com/datasheet/index.mvp/id/4199

  * Maxim MAX6696

    Prefix: 'max6695'

    Addresses scanned: I2C 0x18, 0x19, 0x1a, 0x29, 0x2a, 0x2b,

			   0x4c, 0x4d and 0x4e

    Datasheet: Publicly available at the Maxim website

	       http://www.maxim-ic.com/datasheet/index.mvp/id/4199

  * Winbond/Nuvoton W83L771W/G

    Prefix: 'w83l771'

    Addresses scanned: I2C 0x4c

    Datasheet: No longer available

  * Winbond/Nuvoton W83L771AWG/ASG

    Prefix: 'w83l771'

    Addresses scanned: I2C 0x4c

    Datasheet: Not publicly available, can be requested from Nuvoton

  * Philips/NXP SA56004X

    Prefix: 'sa56004'

    Addresses scanned: I2C 0x48 through 0x4F

    Datasheet: Publicly available at NXP website

	       http://ics.nxp.com/products/interface/datasheet/sa56004x.pdf

  * GMT G781

    Prefix: 'g781'

    Addresses scanned: I2C 0x4c, 0x4d

    Datasheet: Not publicly available from GMT

  * Texas Instruments TMP451

    Prefix: 'tmp451'

    Addresses scanned: I2C 0x4c

    Datasheet: Publicly available at TI website

	       https://www.ti.com/litv/pdf/sbos686

  * Texas Instruments TMP461

    Prefix: 'tmp461'

    Addresses scanned: I2C 0x48 through 0x4F

    Datasheet: Publicly available at TI website

	       https://www.ti.com/lit/gpn/tmp461

  * Philips NE1617, NE1617A

    Prefix: 'max1617' (probably detected as a max1617)

    Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e

    Datasheets: Publicly available at the Philips website

  * Philips NE1618

    Prefix: 'ne1618'

    Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e

    Datasheets: Publicly available at the Philips website

  * Genesys Logic GL523SM

    Prefix: 'gl523sm'

    Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e

    Datasheet:

  * TI THMC10

    Prefix: 'thmc10'

    Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e

    Datasheet: Publicly available at the TI website

  * Onsemi MC1066

    Prefix: 'mc1066'

    Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e

    Datasheet: Publicly available at the Onsemi website

Author: Jean Delvare <jdelvare@suse.de>


Description
-----------

The LM90 is a digital temperature sensor. It senses its own temperature as
well as the temperature of up to one external diode. It is compatible
with many other devices, many of which are supported by this driver.

The family of chips supported by this driver is derived from MAX1617.
This chip as well as various compatible chips support a local and a remote
temperature sensor with 8 bit accuracy. Later chips provide improved accuracy
and other additional features such as hysteresis and temperature offset
registers.

Note that there is no easy way to differentiate between the MAX6657,
MAX6658 and MAX6659 variants. The extra features of the MAX6659 are only
supported by this driver if the chip is located at address 0x4d or 0x4e,
or if the chip type is explicitly selected as max6659.
The MAX6680 and MAX6681 only differ in their pinout, therefore they obviously
can't (and don't need to) be distinguished.

The different chipsets of the family are not strictly identical, although
very similar. For reference, here comes a non-exhaustive list of specific
features:

LM84:
  * 8 bit sensor resolution

ADM1020, ADM1021, GL523SM, MAX1617, NE1617, NE1617A, THMC10:
  * 8 bit sensor resolution
  * Low temperature limits

NCT210, NE1618:
  * 11 bit sensor resolution for remote temperature sensor
  * Low temperature limits

ADM1021A, ADM1023:
  * Temperature offset register for remote temperature sensor
  * 11 bit resolution for remote temperature sensor
  * Low temperature limits

LM90:
  * 11 bit resolution for remote temperature sensor
  * Temperature offset register for remote temperature sensor
  * Low and critical temperature limits
  * Configurable conversion rate
  * Filter and alert configuration register at 0xBF.
  * ALERT is triggered by temperatures over critical limits.

LM86 and LM89:
  * Same as LM90
  * Better external channel accuracy

LM99:
  * Same as LM89
  * External temperature shifted by 16 degrees down

ADM1032:
  * Consecutive alert register at 0x22.
  * Conversion averaging.
  * Up to 64 conversions/s.
  * ALERT is triggered by open remote sensor.
  * SMBus PEC support for Write Byte and Receive Byte transactions.

ADT7461, ADT7461A, NCT1008:
  * Extended temperature range (breaks compatibility)
  * Lower resolution for remote temperature
  * SMBus PEC support for Write Byte and Receive Byte transactions.
  * 10 bit temperature resolution

ADT7481, ADT7482, ADT7483:
  * Temperature offset register
  * SMBus PEC support
  * 10 bit temperature resolution for external sensors
  * Two remote sensors
  * Selectable address (ADT7483)

MAX6642:
  * No critical limit register
  * Conversion rate not configurable
  * Better local resolution (10 bit)
  * 10 bit external sensor resolution

MAX6646, MAX6647, MAX6649:
  * Better local resolution
  * Extended range unsigned external temperature

MAX6648, MAX6692:
  * Better local resolution
  * Unsigned temperature

MAX6654, MAX6690:
  * Better local resolution
  * Selectable address
  * Remote sensor type selection
  * Extended temperature range
  * Extended resolution only available when conversion rate <= 1 Hz

MAX6657 and MAX6658:
  * Better local resolution
  * Remote sensor type selection

MAX6659:
  * Better local resolution
  * Selectable address
  * Second critical temperature limit
  * Remote sensor type selection

MAX6680 and MAX6681:
  * Selectable address
  * Remote sensor type selection

MAX6695 and MAX6696:
  * Better local resolution
  * Selectable address (max6696)
  * Second critical temperature limit
  * Two remote sensors

W83L771W/G
  * The G variant is lead-free, otherwise similar to the W.
  * Filter and alert configuration register at 0xBF
  * Moving average (depending on conversion rate)

W83L771AWG/ASG
  * Successor of the W83L771W/G, same features.
  * The AWG and ASG variants only differ in package format.
  * Diode ideality factor configuration (remote sensor) at 0xE3

SA56004X:
  * Better local resolution

All temperature values are given in degrees Celsius. Resolution
is 1.0 degree for the local temperature, 0.125 degree for the remote
temperature, except for the MAX6654, MAX6657, MAX6658 and MAX6659 which have
a resolution of 0.125 degree for both temperatures.

Each sensor has its own high and low limits, plus a critical limit.
Additionally, there is a relative hysteresis value common to both critical
values. To make life easier to user-space applications, two absolute values
are exported, one for each channel, but these values are of course linked.
Only the local hysteresis can be set from user-space, and the same delta
applies to the remote hysteresis.

The lm90 driver will not update its values more frequently than configured with
the update_interval attribute; reading them more often will do no harm, but will
return 'old' values.

SMBus Alert Support
-------------------

This driver has basic support for SMBus alert. When an alert is received,
the status register is read and the faulty temperature channel is logged.

The Analog Devices chips (ADM1032, ADT7461 and ADT7461A) and ON
Semiconductor chips (NCT1008) do not implement the SMBus alert protocol
properly so additional care is needed: the ALERT output is disabled when
an alert is received, and is re-enabled only when the alarm is gone.
Otherwise the chip would block alerts from other chips in the bus as long
as the alarm is active.

PEC Support
-----------

The ADM1032 is the only chip of the family which supports PEC. It does
not support PEC on all transactions though, so some care must be taken.

When reading a register value, the PEC byte is computed and sent by the
ADM1032 chip. However, in the case of a combined transaction (SMBus Read
Byte), the ADM1032 computes the CRC value over only the second half of
the message rather than its entirety, because it thinks the first half
of the message belongs to a different transaction. As a result, the CRC
value differs from what the SMBus master expects, and all reads fail.

For this reason, the lm90 driver will enable PEC for the ADM1032 only if
the bus supports the SMBus Send Byte and Receive Byte transaction types.
These transactions will be used to read register values, instead of
SMBus Read Byte, and PEC will work properly.

Additionally, the ADM1032 doesn't support SMBus Send Byte with PEC.
Instead, it will try to write the PEC value to the register (because the
SMBus Send Byte transaction with PEC is similar to a Write Byte transaction
without PEC), which is not what we want. Thus, PEC is explicitly disabled
on SMBus Send Byte transactions in the lm90 driver.

PEC on byte data transactions represents a significant increase in bandwidth
usage (+33% for writes, +25% for reads) in normal conditions. With the need
to use two SMBus transaction for reads, this overhead jumps to +50%. Worse,
two transactions will typically mean twice as much delay waiting for
transaction completion, effectively doubling the register cache refresh time.
I guess reliability comes at a price, but it's quite expensive this time.

So, as not everyone might enjoy the slowdown, PEC is disabled by default and
can be enabled through sysfs. Just write 1 to the "pec" file and PEC will be
enabled. Write 0 to that file to disable PEC again.