17ebd8b66SMauro Carvalho ChehabKernel driver lm63 27ebd8b66SMauro Carvalho Chehab================== 37ebd8b66SMauro Carvalho Chehab 47ebd8b66SMauro Carvalho ChehabSupported chips: 57ebd8b66SMauro Carvalho Chehab 67ebd8b66SMauro Carvalho Chehab * National Semiconductor LM63 77ebd8b66SMauro Carvalho Chehab 87ebd8b66SMauro Carvalho Chehab Prefix: 'lm63' 97ebd8b66SMauro Carvalho Chehab 107ebd8b66SMauro Carvalho Chehab Addresses scanned: I2C 0x4c 117ebd8b66SMauro Carvalho Chehab 127ebd8b66SMauro Carvalho Chehab Datasheet: Publicly available at the National Semiconductor website 137ebd8b66SMauro Carvalho Chehab 147ebd8b66SMauro Carvalho Chehab http://www.national.com/pf/LM/LM63.html 157ebd8b66SMauro Carvalho Chehab 167ebd8b66SMauro Carvalho Chehab * National Semiconductor LM64 177ebd8b66SMauro Carvalho Chehab 187ebd8b66SMauro Carvalho Chehab Prefix: 'lm64' 197ebd8b66SMauro Carvalho Chehab 207ebd8b66SMauro Carvalho Chehab Addresses scanned: I2C 0x18 and 0x4e 217ebd8b66SMauro Carvalho Chehab 227ebd8b66SMauro Carvalho Chehab Datasheet: Publicly available at the National Semiconductor website 237ebd8b66SMauro Carvalho Chehab 247ebd8b66SMauro Carvalho Chehab http://www.national.com/pf/LM/LM64.html 257ebd8b66SMauro Carvalho Chehab 267ebd8b66SMauro Carvalho Chehab * National Semiconductor LM96163 277ebd8b66SMauro Carvalho Chehab 287ebd8b66SMauro Carvalho Chehab Prefix: 'lm96163' 297ebd8b66SMauro Carvalho Chehab 307ebd8b66SMauro Carvalho Chehab Addresses scanned: I2C 0x4c 317ebd8b66SMauro Carvalho Chehab 327ebd8b66SMauro Carvalho Chehab Datasheet: Publicly available at the National Semiconductor website 337ebd8b66SMauro Carvalho Chehab 347ebd8b66SMauro Carvalho Chehab http://www.national.com/pf/LM/LM96163.html 357ebd8b66SMauro Carvalho Chehab 367ebd8b66SMauro Carvalho Chehab 377ebd8b66SMauro Carvalho ChehabAuthor: Jean Delvare <jdelvare@suse.de> 387ebd8b66SMauro Carvalho Chehab 397ebd8b66SMauro Carvalho ChehabThanks go to Tyan and especially Alex Buckingham for setting up a remote 407ebd8b66SMauro Carvalho Chehabaccess to their S4882 test platform for this driver. 417ebd8b66SMauro Carvalho Chehab 42*ad736c1aSAlexander A. Klimov https://www.tyan.com/ 437ebd8b66SMauro Carvalho Chehab 447ebd8b66SMauro Carvalho ChehabDescription 457ebd8b66SMauro Carvalho Chehab----------- 467ebd8b66SMauro Carvalho Chehab 477ebd8b66SMauro Carvalho ChehabThe LM63 is a digital temperature sensor with integrated fan monitoring 487ebd8b66SMauro Carvalho Chehaband control. 497ebd8b66SMauro Carvalho Chehab 507ebd8b66SMauro Carvalho ChehabThe LM63 is basically an LM86 with fan speed monitoring and control 517ebd8b66SMauro Carvalho Chehabcapabilities added. It misses some of the LM86 features though: 527ebd8b66SMauro Carvalho Chehab 537ebd8b66SMauro Carvalho Chehab - No low limit for local temperature. 547ebd8b66SMauro Carvalho Chehab - No critical limit for local temperature. 557ebd8b66SMauro Carvalho Chehab - Critical limit for remote temperature can be changed only once. We 567ebd8b66SMauro Carvalho Chehab will consider that the critical limit is read-only. 577ebd8b66SMauro Carvalho Chehab 587ebd8b66SMauro Carvalho ChehabThe datasheet isn't very clear about what the tachometer reading is. 597ebd8b66SMauro Carvalho Chehab 607ebd8b66SMauro Carvalho ChehabAn explanation from National Semiconductor: The two lower bits of the read 617ebd8b66SMauro Carvalho Chehabvalue have to be masked out. The value is still 16 bit in width. 627ebd8b66SMauro Carvalho Chehab 637ebd8b66SMauro Carvalho ChehabAll temperature values are given in degrees Celsius. Resolution is 1.0 647ebd8b66SMauro Carvalho Chehabdegree for the local temperature, 0.125 degree for the remote temperature. 657ebd8b66SMauro Carvalho Chehab 667ebd8b66SMauro Carvalho ChehabThe fan speed is measured using a tachometer. Contrary to most chips which 677ebd8b66SMauro Carvalho Chehabstore the value in an 8-bit register and have a selectable clock divider 687ebd8b66SMauro Carvalho Chehabto make sure that the result will fit in the register, the LM63 uses 16-bit 697ebd8b66SMauro Carvalho Chehabvalue for measuring the speed of the fan. It can measure fan speeds down to 707ebd8b66SMauro Carvalho Chehab83 RPM, at least in theory. 717ebd8b66SMauro Carvalho Chehab 727ebd8b66SMauro Carvalho ChehabNote that the pin used for fan monitoring is shared with an alert out 737ebd8b66SMauro Carvalho Chehabfunction. Depending on how the board designer wanted to use the chip, fan 747ebd8b66SMauro Carvalho Chehabspeed monitoring will or will not be possible. The proper chip configuration 757ebd8b66SMauro Carvalho Chehabis left to the BIOS, and the driver will blindly trust it. Only the original 767ebd8b66SMauro Carvalho ChehabLM63 suffers from this limitation, the LM64 and LM96163 have separate pins 777ebd8b66SMauro Carvalho Chehabfor fan monitoring and alert out. On the LM64, monitoring is always enabled; 787ebd8b66SMauro Carvalho Chehabon the LM96163 it can be disabled. 797ebd8b66SMauro Carvalho Chehab 807ebd8b66SMauro Carvalho ChehabA PWM output can be used to control the speed of the fan. The LM63 has two 817ebd8b66SMauro Carvalho ChehabPWM modes: manual and automatic. Automatic mode is not fully implemented yet 827ebd8b66SMauro Carvalho Chehab(you cannot define your custom PWM/temperature curve), and mode change isn't 837ebd8b66SMauro Carvalho Chehabsupported either. 847ebd8b66SMauro Carvalho Chehab 857ebd8b66SMauro Carvalho ChehabThe lm63 driver will not update its values more frequently than configured with 867ebd8b66SMauro Carvalho Chehabthe update_interval sysfs attribute; reading them more often will do no harm, 877ebd8b66SMauro Carvalho Chehabbut will return 'old' values. Values in the automatic fan control lookup table 887ebd8b66SMauro Carvalho Chehab(attributes pwm1_auto_*) have their own independent lifetime of 5 seconds. 897ebd8b66SMauro Carvalho Chehab 907ebd8b66SMauro Carvalho ChehabThe LM64 is effectively an LM63 with GPIO lines. The driver does not 917ebd8b66SMauro Carvalho Chehabsupport these GPIO lines at present. 927ebd8b66SMauro Carvalho Chehab 937ebd8b66SMauro Carvalho ChehabThe LM96163 is an enhanced version of LM63 with improved temperature accuracy 947ebd8b66SMauro Carvalho Chehaband better PWM resolution. For LM96163, the external temperature sensor type is 957ebd8b66SMauro Carvalho Chehabconfigurable as CPU embedded diode(1) or 3904 transistor(2). 96