Changeset 2600

Show
Ignore:
Timestamp:
06/19/04 19:07:40 (9 years ago)
Author:
mds
Message:

add support for VRM 10.0

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/kernel/include/sensors_vid.h

    r2152 r2600  
    22    sensors_vid.h - Part of lm_sensors, Linux kernel modules for hardware 
    33               monitoring 
    4     Copyright (c) 2002 Mark D. Studebaker <mdsxyz123@yahoo.com> 
     4    Copyright (c) 2002-2004 Mark D. Studebaker <mdsxyz123@yahoo.com> 
    55    With assistance from Trent Piepho <xyzzy@speakeasy.org> 
    66 
     
    2222/* 
    2323    This file contains common code for decoding VID pins. 
    24     This file is #included in various chip drivers in this directory. 
     24    This file is #included in various sensor chip drivers. 
    2525    As the user is unlikely to load more than one driver which 
    2626    includes this code we don't worry about the wasted space. 
    27     Reference: VRM x.y DC-DC Converter Design Guidelines, 
    28     available at http://developer.intel.com 
     27    References: VRM x.y DC-DC Converter Design Guidelines, 
     28                VRD 10.0 Design Guide, 
     29                available at http://developer.intel.com 
    2930*/ 
    3031 
     
    4546 
    4647/* 
    47     Legal val values 00 - 1F. 
     48    Legal val values 00 - 1F except for VRD 10.0, 0x00-0x3f. 
    4849    vrm is the Intel VRM document version. 
    4950    Note: vrm version is scaled by 10 and the return value is scaled by 1000 
     
    5556static inline int vid_from_reg(int val, int vrm) 
    5657{ 
     58        int vid; 
     59 
    5760        switch(vrm) { 
     61 
     62        case 100:               /* VRD 10.0 */ 
     63                if((val & 0x1f) == 0x1f) 
     64                        return 0; 
     65                if((val & 0x1f) <= 0x09 || val == 0x0a) 
     66                        vid = 10875 - (val & 0x1f) * 250; 
     67                else 
     68                        vid = 18625 - (val & 0x1f) * 250; 
     69                if(val & 0x20) 
     70                        vid += 125; 
     71                vid /= 10;      /* only return 3 dec. places for now */ 
     72                return vid; 
    5873 
    5974        case 24:                /* Opteron processor */