1*4882a593SmuzhiyunKernel driver emc1403 2*4882a593Smuzhiyun===================== 3*4882a593Smuzhiyun 4*4882a593SmuzhiyunSupported chips: 5*4882a593Smuzhiyun 6*4882a593Smuzhiyun * SMSC / Microchip EMC1402, EMC1412 7*4882a593Smuzhiyun 8*4882a593Smuzhiyun Addresses scanned: I2C 0x18, 0x1c, 0x29, 0x4c, 0x4d, 0x5c 9*4882a593Smuzhiyun 10*4882a593Smuzhiyun Prefix: 'emc1402' 11*4882a593Smuzhiyun 12*4882a593Smuzhiyun Datasheets: 13*4882a593Smuzhiyun 14*4882a593Smuzhiyun - http://ww1.microchip.com/downloads/en/DeviceDoc/1412.pdf 15*4882a593Smuzhiyun - https://ww1.microchip.com/downloads/en/DeviceDoc/1402.pdf 16*4882a593Smuzhiyun 17*4882a593Smuzhiyun * SMSC / Microchip EMC1403, EMC1404, EMC1413, EMC1414 18*4882a593Smuzhiyun 19*4882a593Smuzhiyun Addresses scanned: I2C 0x18, 0x29, 0x4c, 0x4d 20*4882a593Smuzhiyun 21*4882a593Smuzhiyun Prefix: 'emc1403', 'emc1404' 22*4882a593Smuzhiyun 23*4882a593Smuzhiyun Datasheets: 24*4882a593Smuzhiyun 25*4882a593Smuzhiyun - http://ww1.microchip.com/downloads/en/DeviceDoc/1403_1404.pdf 26*4882a593Smuzhiyun - http://ww1.microchip.com/downloads/en/DeviceDoc/1413_1414.pdf 27*4882a593Smuzhiyun 28*4882a593Smuzhiyun * SMSC / Microchip EMC1422 29*4882a593Smuzhiyun 30*4882a593Smuzhiyun Addresses scanned: I2C 0x4c 31*4882a593Smuzhiyun 32*4882a593Smuzhiyun Prefix: 'emc1422' 33*4882a593Smuzhiyun 34*4882a593Smuzhiyun Datasheet: 35*4882a593Smuzhiyun 36*4882a593Smuzhiyun - https://ww1.microchip.com/downloads/en/DeviceDoc/1422.pdf 37*4882a593Smuzhiyun 38*4882a593Smuzhiyun * SMSC / Microchip EMC1423, EMC1424 39*4882a593Smuzhiyun 40*4882a593Smuzhiyun Addresses scanned: I2C 0x4c 41*4882a593Smuzhiyun 42*4882a593Smuzhiyun Prefix: 'emc1423', 'emc1424' 43*4882a593Smuzhiyun 44*4882a593Smuzhiyun Datasheet: 45*4882a593Smuzhiyun 46*4882a593Smuzhiyun - https://ww1.microchip.com/downloads/en/DeviceDoc/1423_1424.pdf 47*4882a593Smuzhiyun 48*4882a593SmuzhiyunAuthor: 49*4882a593Smuzhiyun Kalhan Trisal <kalhan.trisal@intel.com 50*4882a593Smuzhiyun 51*4882a593Smuzhiyun 52*4882a593SmuzhiyunDescription 53*4882a593Smuzhiyun----------- 54*4882a593Smuzhiyun 55*4882a593SmuzhiyunThe Standard Microsystems Corporation (SMSC) / Microchip EMC14xx chips 56*4882a593Smuzhiyuncontain up to four temperature sensors. EMC14x2 support two sensors 57*4882a593Smuzhiyun(one internal, one external). EMC14x3 support three sensors (one internal, 58*4882a593Smuzhiyuntwo external), and EMC14x4 support four sensors (one internal, three 59*4882a593Smuzhiyunexternal). 60*4882a593Smuzhiyun 61*4882a593SmuzhiyunThe chips implement three limits for each sensor: low (tempX_min), high 62*4882a593Smuzhiyun(tempX_max) and critical (tempX_crit.) The chips also implement an 63*4882a593Smuzhiyunhysteresis mechanism which applies to all limits. The relative difference 64*4882a593Smuzhiyunis stored in a single register on the chip, which means that the relative 65*4882a593Smuzhiyundifference between the limit and its hysteresis is always the same for 66*4882a593Smuzhiyunall three limits. 67*4882a593Smuzhiyun 68*4882a593SmuzhiyunThis implementation detail implies the following: 69*4882a593Smuzhiyun 70*4882a593Smuzhiyun* When setting a limit, its hysteresis will automatically follow, the 71*4882a593Smuzhiyun difference staying unchanged. For example, if the old critical limit 72*4882a593Smuzhiyun was 80 degrees C, and the hysteresis was 75 degrees C, and you change 73*4882a593Smuzhiyun the critical limit to 90 degrees C, then the hysteresis will 74*4882a593Smuzhiyun automatically change to 85 degrees C. 75*4882a593Smuzhiyun* The hysteresis values can't be set independently. We decided to make 76*4882a593Smuzhiyun only temp1_crit_hyst writable, while all other hysteresis attributes 77*4882a593Smuzhiyun are read-only. Setting temp1_crit_hyst writes the difference between 78*4882a593Smuzhiyun temp1_crit_hyst and temp1_crit into the chip, and the same relative 79*4882a593Smuzhiyun hysteresis applies automatically to all other limits. 80*4882a593Smuzhiyun* The limits should be set before the hysteresis. 81