1*4882a593SmuzhiyunKernel driver lm77 2*4882a593Smuzhiyun================== 3*4882a593Smuzhiyun 4*4882a593SmuzhiyunSupported chips: 5*4882a593Smuzhiyun 6*4882a593Smuzhiyun * National Semiconductor LM77 7*4882a593Smuzhiyun 8*4882a593Smuzhiyun Prefix: 'lm77' 9*4882a593Smuzhiyun 10*4882a593Smuzhiyun Addresses scanned: I2C 0x48 - 0x4b 11*4882a593Smuzhiyun 12*4882a593Smuzhiyun Datasheet: Publicly available at the National Semiconductor website 13*4882a593Smuzhiyun 14*4882a593Smuzhiyun http://www.national.com/ 15*4882a593Smuzhiyun 16*4882a593Smuzhiyun 17*4882a593SmuzhiyunAuthor: Andras BALI <drewie@freemail.hu> 18*4882a593Smuzhiyun 19*4882a593SmuzhiyunDescription 20*4882a593Smuzhiyun----------- 21*4882a593Smuzhiyun 22*4882a593SmuzhiyunThe LM77 implements one temperature sensor. The temperature 23*4882a593Smuzhiyunsensor incorporates a band-gap type temperature sensor, 24*4882a593Smuzhiyun10-bit ADC, and a digital comparator with user-programmable upper 25*4882a593Smuzhiyunand lower limit values. 26*4882a593Smuzhiyun 27*4882a593SmuzhiyunThe LM77 implements 3 limits: low (temp1_min), high (temp1_max) and 28*4882a593Smuzhiyuncritical (temp1_crit.) It also implements an hysteresis mechanism which 29*4882a593Smuzhiyunapplies to all 3 limits. The relative difference is stored in a single 30*4882a593Smuzhiyunregister on the chip, which means that the relative difference between 31*4882a593Smuzhiyunthe limit and its hysteresis is always the same for all 3 limits. 32*4882a593Smuzhiyun 33*4882a593SmuzhiyunThis implementation detail implies the following: 34*4882a593Smuzhiyun 35*4882a593Smuzhiyun* When setting a limit, its hysteresis will automatically follow, the 36*4882a593Smuzhiyun difference staying unchanged. For example, if the old critical limit 37*4882a593Smuzhiyun was 80 degrees C, and the hysteresis was 75 degrees C, and you change 38*4882a593Smuzhiyun the critical limit to 90 degrees C, then the hysteresis will 39*4882a593Smuzhiyun automatically change to 85 degrees C. 40*4882a593Smuzhiyun* All 3 hysteresis can't be set independently. We decided to make 41*4882a593Smuzhiyun temp1_crit_hyst writable, while temp1_min_hyst and temp1_max_hyst are 42*4882a593Smuzhiyun read-only. Setting temp1_crit_hyst writes the difference between 43*4882a593Smuzhiyun temp1_crit_hyst and temp1_crit into the chip, and the same relative 44*4882a593Smuzhiyun hysteresis applies automatically to the low and high limits. 45*4882a593Smuzhiyun* The limits should be set before the hysteresis. 46